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

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

本文整理了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

  1. table.showItem( table.getItem( activeTableRow ) );
  2. e.doit = false;
  3. return;
  4. table.showItem( table.getItem( activeTableRow ) );
  5. e.doit = false;
  6. return;
  7. table.showItem( activeTableItem );
  8. e.doit = false;
  9. return;
  10. table.showItem( activeTableItem );
  11. e.doit = false;
  12. return;
  13. table.deselectAll();
  14. table.select( activeTableRow );
  15. table.showItem( table.getItem( activeTableRow ) );
  16. e.doit = false;
  17. return;

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

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

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

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

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

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

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

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

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

  1. @Override
  2. public void reveal(Object element) {
  3. Assert.isNotNull(element);
  4. Widget w = findItem(element);
  5. if (w instanceof TableItem) {
  6. getTable().showItem((TableItem) w);
  7. }
  8. }

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

  1. /**
  2. * Shows the selection. If the selection is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the selection is visible.
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @see Table#showItem(TableItem)
  12. */
  13. public void showSelection () {
  14. checkWidget();
  15. TableItem [] selection = getSelection ();
  16. if (selection.length == 0) return;
  17. TableItem item = selection [0];
  18. showItem (item.handle);
  19. }

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

  1. /**
  2. * Shows the selection. If the selection is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the selection is visible.
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @see Table#showItem(TableItem)
  12. */
  13. public void showSelection () {
  14. checkWidget();
  15. TableItem [] selection = getSelection ();
  16. if (selection.length == 0) return;
  17. TableItem item = selection [0];
  18. showItem (item.handle);
  19. }

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

  1. /**
  2. * Shows the selection. If the selection is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the selection is visible.
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @see Table#showItem(TableItem)
  12. */
  13. public void showSelection () {
  14. checkWidget();
  15. TableItem [] selection = getSelection ();
  16. if (selection.length == 0) return;
  17. TableItem item = selection [0];
  18. showItem (item.handle);
  19. }

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

  1. /**
  2. * Shows the selection. If the selection is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the selection is visible.
  5. *
  6. * @exception SWTException <ul>
  7. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  8. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  9. * </ul>
  10. *
  11. * @see Table#showItem(TableItem)
  12. */
  13. public void showSelection() {
  14. checkWidget();
  15. int index = getSelectionIndex();
  16. if( index != -1 ) {
  17. showItem( _getItem( index ) );
  18. }
  19. }

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

  1. /**
  2. * Shows the item. If the item is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled
  4. * and expanded until the item is visible.
  5. *
  6. * @param item the item to be shown
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
  10. * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
  11. * </ul>
  12. * @exception SWTException <ul>
  13. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  14. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  15. * </ul>
  16. *
  17. * @see TableTree#showSelection()
  18. */
  19. public void showItem (TableTreeItem item) {
  20. checkWidget();
  21. if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
  22. if (!item.getVisible()) expandItem (item);
  23. TableItem tableItem = item.tableItem;
  24. table.showItem(tableItem);
  25. }

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

  1. /**
  2. * Shows the item. If the item is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the item is visible.
  5. *
  6. * @param item the item to be shown
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
  10. * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
  11. * </ul>
  12. * @exception SWTException <ul>
  13. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  14. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  15. * </ul>
  16. *
  17. * @see Table#showSelection()
  18. */
  19. public void showItem (TableItem item) {
  20. checkWidget ();
  21. if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  22. if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
  23. if (item.parent != this) return;
  24. showItem (item.handle);
  25. }

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

  1. /**
  2. * Shows the item. If the item is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the item is visible.
  5. *
  6. * @param item the item to be shown
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
  10. * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
  11. * </ul>
  12. * @exception SWTException <ul>
  13. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  14. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  15. * </ul>
  16. *
  17. * @see Table#showSelection()
  18. */
  19. public void showItem (TableItem item) {
  20. checkWidget ();
  21. if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  22. if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
  23. if (item.parent != this) return;
  24. showItem (item.handle);
  25. }

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

  1. @Override
  2. protected boolean scrollCellIntoView(int columnIndex) {
  3. item.getParent().showItem(item);
  4. if( hasColumns() ) {
  5. item.getParent().showColumn(item.getParent().getColumn(columnIndex));
  6. }
  7. return true;
  8. }
  9. }

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

  1. @Override
  2. protected boolean scrollCellIntoView(int columnIndex) {
  3. item.getParent().showItem(item);
  4. if( hasColumns() ) {
  5. item.getParent().showColumn(item.getParent().getColumn(columnIndex));
  6. }
  7. return true;
  8. }
  9. }

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

  1. /**
  2. * Shows the item. If the item is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled
  4. * and expanded until the item is visible.
  5. *
  6. * @param item the item to be shown
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
  10. * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
  11. * </ul>
  12. * @exception SWTException <ul>
  13. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  14. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  15. * </ul>
  16. *
  17. * @see TableTree#showSelection()
  18. */
  19. public void showItem (TableTreeItem item) {
  20. checkWidget();
  21. if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
  22. if (!item.getVisible()) expandItem (item);
  23. TableItem tableItem = item.tableItem;
  24. table.showItem(tableItem);
  25. }

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

  1. protected boolean scrollCellIntoView(int columnIndex) {
  2. item.getParent().showItem(item);
  3. if( hasColumns() ) {
  4. item.getParent().showColumn(item.getParent().getColumn(columnIndex));
  5. }
  6. return true;
  7. }
  8. }

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

  1. /**
  2. * Shows the item. If the item is already showing in the receiver,
  3. * this method simply returns. Otherwise, the items are scrolled until
  4. * the item is visible.
  5. *
  6. * @param item the item to be shown
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
  10. * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
  11. * </ul>
  12. * @exception SWTException <ul>
  13. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  14. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  15. * </ul>
  16. *
  17. * @see Table#showSelection()
  18. */
  19. public void showItem (TableItem item) {
  20. checkWidget ();
  21. if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  22. if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
  23. int index = indexOf (item);
  24. if (index != -1) showItem (index);
  25. }

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

  1. @Override
  2. protected ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal) {
  3. if (acceptsSelection(selection)) {
  4. List<?> list = ((IStructuredSelection) selection).toList();
  5. if (list == null) {
  6. fTable.deselectAll();
  7. return StructuredSelection.EMPTY;
  8. }
  9. int[] indices = new int[list.size()];
  10. ModelNode[] nodes = getModel().getRootNode().getChildrenNodes();
  11. if (nodes != null) {
  12. int index = 0;
  13. // I'm not sure if it would be faster to check TableItems first...
  14. for (int i = 0; i < nodes.length; i++) {
  15. Object element = nodes[i].getElement();
  16. if (list.contains(element)) {
  17. indices[index] = i;
  18. index++;
  19. }
  20. }
  21. fTable.setSelection(indices);
  22. if (reveal && indices.length > 0) {
  23. TableItem item = fTable.getItem(indices[0]);
  24. fTable.showItem(item);
  25. }
  26. }
  27. }
  28. return StructuredSelection.EMPTY;
  29. }

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

  1. public void refreshAll(boolean recreateColumns) {
  2. try {
  3. m_table.setRedraw(false);
  4. if (recreateColumns) {
  5. createColumns(m_table);
  6. }
  7. m_viewer.refresh();
  8. TableItem[] selection = m_table.getSelection();
  9. if (selection != null && selection.length > 0) {
  10. TableItem row = (selection.length == 0) ? m_table.getItem(m_table.getTopIndex()) : selection[0];
  11. m_table.showItem(row);
  12. m_cursorManager.ensureFocus(row);
  13. }
  14. }
  15. finally {
  16. m_table.setRedraw(true);
  17. }
  18. }

相关文章

Table类方法