org.eclipse.swt.widgets.Table.setTopIndex()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中org.eclipse.swt.widgets.Table.setTopIndex()方法的一些代码示例,展示了Table.setTopIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setTopIndex()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:setTopIndex

Table.setTopIndex介绍

[英]Sets the zero-relative index of the item which is currently at the top of the receiver. This index can change when items are scrolled or new items are added and removed.
[中]设置当前位于接收器顶部的项的零相对索引。滚动项目或添加和删除新项目时,此索引可能会更改。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void run() {
  if ( wFields.isDisposed() ) {
   return;
  }
  if ( waitingForRows ) {
   PreviewRowsDialog.this.rowMeta = rowMeta;
   addFields();
  }
  TableItem item = new TableItem( wFields.table, SWT.NONE );
  getDataForRow( item, rowData );
  if ( waitingForRows ) {
   waitingForRows = false;
   wFields.removeEmptyRows();
   PreviewRowsDialog.this.rowMeta = rowMeta;
   if ( wFields.table.getItemCount() < 10 ) {
    wFields.optWidth( true );
   }
  }
  if ( wFields.table.getItemCount() > props.getDefaultPreviewSize() ) {
   wFields.table.remove( 0 );
  }
  // wFields.table.setSelection(new TableItem[] { item, });
  wFields.table.setTopIndex( wFields.table.getItemCount() - 1 );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

transGridView.getTable().setTopIndex( topIdx );

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void
  run()
  {
    libraryTable.setTopIndex( f_i );
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

private static void  setTopIndex(Table table, int index)
{
  table.setTopIndex(index);
}

代码示例来源:origin: com.diffplug.durian/durian-swt

@Override
  protected void setTopRowImpl() {
    int offset, topIndex;
    if (topPixel < 0) {
      offset = -topPixel;
      topIndex = 0;
    } else {
      topIndex = Math.floorDiv(topPixel, rowHeight);
      int maxTopIndex = table.getItemCount() - (height / rowHeight) - 1;
      if (topIndex > maxTopIndex) {
        topIndex = Math.max(0, maxTopIndex);
        offset = (topIndex * rowHeight) - topPixel;
      } else {
        offset = -Math.floorMod(topPixel, rowHeight);
      }
    }
    if (this.offset != offset) {
      setRedraw(false);
      table.setTopIndex(topIndex);
      setOffset(offset);
      setRedraw(true);
    } else {
      table.setTopIndex(topIndex);
    }
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

private static void readTopIndex( final Table table ) {
 String value = WidgetLCAUtil.readPropertyValue( table, "topIndex" );
 if( value != null ) {
  int topIndex = NumberFormatUtil.parseInt( value );
  int topOffset = topIndex * table.getItemHeight();
  table.setTopIndex( topIndex );
  processScrollBarSelection( table.getVerticalBar(), topOffset );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

if( itemIndex < topIndex ) {
 setTopIndex( itemIndex );
} else if( itemCount > 0 && itemIndex >= topIndex + itemCount ) {
 setTopIndex( itemIndex - itemCount + 1 );

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

public void handleSetTopItemIndex( Table table, JsonObject properties ) {
 JsonValue value = properties.get( PROP_TOP_ITEM_INDEX );
 if( value != null ) {
  int topItemIndex = value.asInt();
  table.setTopIndex( topItemIndex );
  int scrollTop = topItemIndex * table.getItemHeight();
  setScrollBarSelection( table.getVerticalBar(), scrollTop );
 }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

table.setTopIndex(Integer.parseInt(topIndexStr));
} catch (NumberFormatException e) {

代码示例来源:origin: org.codehaus.openxma/xmartclient

/**
 * Resets the order to the natural order of the rows. I.e., to the state after
 * construction and before any <tt>sort</tt>-calls.
 */
protected void sortNatural () {
  if (!isUIAttached()) return;
  int topIndex = table_.getTopIndex();
  if (sortingCol_ != -1) {
    sortingCol_ = -1;
    ascending = true;
    rows2UI();
    selection2UI();
    table_.setTopIndex(topIndex);   // restore top index
    //erease the old sort indicator
    actualizeSortIndicator2UI();
  }
}

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

private void updateCurrentDocument () {
  int n = cbDocument.getSelectionIndex();
  if ( n == -1 ) return;
  // Get the document id for the new selected document
  URI uri = (URI)cbDocument.getData(cbDocument.getItem(n));
  // Find the first issue for that document in from the top of the displayed issues
  for ( int i=0; i<tblIssues.getItemCount(); i++ ) {
    Issue issue = (Issue)tblIssues.getItem(i).getData();
    if ( uri.equals(issue.getDocumentURI()) ) {
      tblIssues.setTopIndex(i);
      tblIssues.setSelection(i);
      updateCurrentIssue();
      return;
    }
  }
  // Else: No issue for that document: do nothing
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public void refresh() {
    int topIndex = getTable().getTopIndex();
    super.refresh();
    // XXX workaround for http://bugs.eclipse.org/bugs/show_bug.cgi?id=9390
    setCheckState((IMemberActionInfo[])getInput());
    if (topIndex < getTable().getItemCount())
      getTable().setTopIndex(topIndex); //see bug 31645
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
  public void refresh() {
    int topIndex = getTable().getTopIndex();
    super.refresh();
    // XXX workaround for http://bugs.eclipse.org/bugs/show_bug.cgi?id=9390
    setCheckState((IMemberActionInfo[])getInput());
    if (topIndex < getTable().getItemCount())
      getTable().setTopIndex(topIndex); //see bug 31645
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public void refresh() {
    int topIndex = getTable().getTopIndex();
    super.refresh();
    // XXX workaround for http://bugs.eclipse.org/bugs/show_bug.cgi?id=9390
    setCheckState((IMemberActionInfo[])getInput());
    if (topIndex < getTable().getItemCount())
      getTable().setTopIndex(topIndex); //see bug 31645
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

getTable().setTopIndex(idx);
tableTopIndexSetComplete();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

if (topIndex != 0) {
  setRedraw (false);
  setTopIndex (0);
  setTopIndex (topIndex);
  setRedraw (true);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

if (topIndex != 0) {
  setRedraw (false);
  setTopIndex (0);
setItemHeight (false);
if (topIndex != 0) {
  setTopIndex (topIndex);
  setRedraw (true);

代码示例来源:origin: org.eclipse.egit/ui

void setInput(final RevFlag hFlag, final SWTCommitList list,
    final SWTCommit[] asArray, HistoryPageInput input, boolean keepPosition) {
  int topIndex = -1;
  if (keepPosition)
    topIndex = table.getTable().getTopIndex();
  setHistoryPageInput(input);
  final SWTCommitList oldList = allCommits;
  if (oldList != null && oldList != list)
    oldList.dispose();
  highlight = hFlag;
  allCommits = list;
  int newAllCommitsLength = allCommits.size();
  table.setInput(asArray);
  if (asArray != null && asArray.length > 0) {
    if (oldList != list || allCommitsLength < newAllCommitsLength)
      initCommitsMap();
  } else
    table.getTable().deselectAll();
  allCommitsLength = newAllCommitsLength;
  if (commitToShow != null)
    selectCommit(commitToShow);
  if (keepPosition)
    table.getTable().setTopIndex(topIndex);
}

代码示例来源:origin: org.codehaus.openxma/xmartclient

table_.setTopIndex(topIndex);   // restore top index

代码示例来源:origin: org.codehaus.openxma/xmartclient

int topIndex = table_.getTopIndex();
  rows2UI();
  table_.setTopIndex(topIndex);
} else if (event instanceof TableWM.RowChangedEvent) {
  int modelIndex = ((TableWM.RowChangedEvent)event).getIndex();

相关文章

Table类方法