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

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

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

Table.showItem介绍

[英]Shows the item. If the item is already showing in the receiver, this method simply returns. Otherwise, the items are scrolled until the item is visible.
[中]显示项目。如果该项已经显示在接收器中,则该方法只返回。否则,将滚动项目,直到项目可见。

代码示例

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

table.showItem( table.getItem( activeTableRow ) );
e.doit = false;
return;
table.showItem( table.getItem( activeTableRow ) );
e.doit = false;
return;
table.showItem( activeTableItem );
e.doit = false;
return;
table.showItem( activeTableItem );
e.doit = false;
return;
table.deselectAll();
table.select( activeTableRow );
table.showItem( table.getItem( activeTableRow ) );
e.doit = false;
return;

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

table.showItem( row );
table.setSelection( new TableItem[]{ row } );

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

@Override
protected void doShowItem(Item item) {
  table.showItem((TableItem) item);
}

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

@Override
protected void doShowItem(Item item) {
  table.showItem((TableItem) item);
}

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

protected void doShowItem(Item item) {
  table.showItem((TableItem)item);
}

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

@Override
public void reveal(Object element) {
  Assert.isNotNull(element);
  Widget w = findItem(element);
  if (w instanceof TableItem) {
    getTable().showItem((TableItem) w);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Shows the selection.  If the selection is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the selection is visible.
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showItem(TableItem)
 */
public void showSelection () {
  checkWidget();
  TableItem [] selection = getSelection ();
  if (selection.length == 0) return;
  TableItem item = selection [0];
  showItem (item.handle);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Shows the selection.  If the selection is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the selection is visible.
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showItem(TableItem)
 */
public void showSelection () {
  checkWidget();
  TableItem [] selection = getSelection ();
  if (selection.length == 0) return;
  TableItem item = selection [0];
  showItem (item.handle);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Shows the selection.  If the selection is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the selection is visible.
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showItem(TableItem)
 */
public void showSelection () {
  checkWidget();
  TableItem [] selection = getSelection ();
  if (selection.length == 0) return;
  TableItem item = selection [0];
  showItem (item.handle);
}

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

/**
 * Shows the selection.  If the selection is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the selection is visible.
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showItem(TableItem)
 */
public void showSelection() {
 checkWidget();
 int index = getSelectionIndex();
 if( index != -1 ) {
  showItem( _getItem( index ) );
 }
}

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

/**
 * Shows the item.  If the item is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled
 * and expanded until the item is visible.
 *
 * @param item the item to be shown
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see TableTree#showSelection()
 */
public void showItem (TableTreeItem item) {
  checkWidget();
  if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
  if (!item.getVisible()) expandItem (item);
  TableItem tableItem = item.tableItem;
  table.showItem(tableItem);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Shows the item.  If the item is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the item is visible.
 *
 * @param item the item to be shown
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showSelection()
 */
public void showItem (TableItem item) {
  checkWidget ();
  if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
  if (item.parent != this) return;
  showItem (item.handle);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Shows the item.  If the item is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the item is visible.
 *
 * @param item the item to be shown
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showSelection()
 */
public void showItem (TableItem item) {
  checkWidget ();
  if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
  if (item.parent != this) return;
  showItem (item.handle);
}

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

@Override
  protected boolean scrollCellIntoView(int columnIndex) {
    item.getParent().showItem(item);
    if( hasColumns() ) {
      item.getParent().showColumn(item.getParent().getColumn(columnIndex));
    }

    return true;
  }
}

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

@Override
  protected boolean scrollCellIntoView(int columnIndex) {
    item.getParent().showItem(item);
    if( hasColumns() ) {
      item.getParent().showColumn(item.getParent().getColumn(columnIndex));
    }

    return true;
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Shows the item.  If the item is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled
 * and expanded until the item is visible.
 *
 * @param item the item to be shown
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see TableTree#showSelection()
 */
public void showItem (TableTreeItem item) {
  checkWidget();
  if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
  if (!item.getVisible()) expandItem (item);
  TableItem tableItem = item.tableItem;
  table.showItem(tableItem);
}

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

protected boolean scrollCellIntoView(int columnIndex) {
  item.getParent().showItem(item);
  if( hasColumns() ) {
   item.getParent().showColumn(item.getParent().getColumn(columnIndex));  
  }
  
  return true;
 }
}

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

/**
 * Shows the item.  If the item is already showing in the receiver,
 * this method simply returns.  Otherwise, the items are scrolled until
 * the item is visible.
 *
 * @param item the item to be shown
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see Table#showSelection()
 */
public void showItem (TableItem item) {
  checkWidget ();
  if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
  int index = indexOf (item);
  if (index != -1) showItem (index);
}

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

@Override
protected ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal) {
  if (acceptsSelection(selection)) {
    List<?> list = ((IStructuredSelection) selection).toList();
    if (list == null) {
      fTable.deselectAll();
      return StructuredSelection.EMPTY;
    }
    int[] indices = new int[list.size()];
    ModelNode[] nodes = getModel().getRootNode().getChildrenNodes();
    if (nodes != null) {
      int index = 0;
      // I'm not sure if it would be faster to check TableItems first...
      for (int i = 0; i < nodes.length; i++) {
        Object element = nodes[i].getElement();
        if (list.contains(element)) {
          indices[index] = i;
          index++;
        }
      }
      fTable.setSelection(indices);
      if (reveal && indices.length > 0) {
        TableItem item = fTable.getItem(indices[0]);
        fTable.showItem(item);
      }
    }
  }
  return StructuredSelection.EMPTY;
}

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls

public void refreshAll(boolean recreateColumns) {
 try {
  m_table.setRedraw(false);
  if (recreateColumns) {
   createColumns(m_table);
  }
  m_viewer.refresh();
  TableItem[] selection = m_table.getSelection();
  if (selection != null && selection.length > 0) {
   TableItem row = (selection.length == 0) ? m_table.getItem(m_table.getTopIndex()) : selection[0];
   m_table.showItem(row);
   m_cursorManager.ensureFocus(row);
  }
 }
 finally {
  m_table.setRedraw(true);
 }
}

相关文章

Table类方法