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

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

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

Table.setColumnOrder介绍

[英]Sets the order that the items in the receiver should be displayed in to the given argument which is described in terms of the zero-relative ordering of when the items were added.
[中]设置接收器中的项在给定参数中的显示顺序,该参数是根据添加项时的零相对顺序描述的。

代码示例

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

  1. /**
  2. * @param columnOrder
  3. */
  4. private void setColumnOrder(int[] order) {
  5. if (targetControl instanceof Table) {
  6. ((Table) targetControl).setColumnOrder(order);
  7. } else if (targetControl instanceof Tree) {
  8. ((Tree) targetControl).setColumnOrder(order);
  9. }
  10. }
  11. }

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

  1. /**
  2. * @param columnOrder
  3. */
  4. private void setColumnOrder(int[] order) {
  5. if (targetControl instanceof Table) {
  6. ((Table) targetControl).setColumnOrder(order);
  7. } else if (targetControl instanceof Tree) {
  8. ((Tree) targetControl).setColumnOrder(order);
  9. }
  10. }
  11. }

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

  1. /**
  2. * @param columnOrder
  3. */
  4. private void setColumnOrder(int[] order) {
  5. if (targetControl instanceof Table) {
  6. ((Table) targetControl).setColumnOrder(order);
  7. } else if (targetControl instanceof Tree) {
  8. ((Tree) targetControl).setColumnOrder(order);
  9. }
  10. }
  11. }

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

  1. static void moveColumn( final TableColumn column, final int newLeft ) {
  2. Table table = column.getParent();
  3. int targetColumn = findMoveTarget( table, newLeft );
  4. int[] columnOrder = table.getColumnOrder();
  5. int index = table.indexOf( column );
  6. int orderIndex = arrayIndexOf( columnOrder, index );
  7. columnOrder = arrayRemove( columnOrder, orderIndex );
  8. if( orderIndex < targetColumn ) {
  9. targetColumn--;
  10. }
  11. columnOrder = arrayInsert( columnOrder, targetColumn, index );
  12. if( Arrays.equals( columnOrder, table.getColumnOrder() ) ) {
  13. // TODO [rh] HACK mark left as changed
  14. TableColumn[] columns = table.getColumns();
  15. for( int i = 0; i < columns.length; i++ ) {
  16. IWidgetAdapter adapter = WidgetUtil.getAdapter( columns[ i ] );
  17. adapter.preserve( PROP_LEFT, null );
  18. }
  19. } else {
  20. table.setColumnOrder( columnOrder );
  21. // [if] HACK mark left as changed - see bug 336340
  22. IWidgetAdapter adapter = WidgetUtil.getAdapter( column );
  23. adapter.preserve( PROP_LEFT, null );
  24. }
  25. }

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

  1. static void moveColumn( TableColumn column, int newLeft ) {
  2. Table table = column.getParent();
  3. int targetColumn = findMoveTarget( table, newLeft );
  4. int[] columnOrder = table.getColumnOrder();
  5. int index = table.indexOf( column );
  6. int orderIndex = arrayIndexOf( columnOrder, index );
  7. columnOrder = arrayRemove( columnOrder, orderIndex );
  8. if( orderIndex < targetColumn ) {
  9. targetColumn--;
  10. }
  11. if( isFixed( column ) || isFixed( table.getColumn( targetColumn ) ) ) {
  12. targetColumn = table.indexOf( column );
  13. }
  14. columnOrder = arrayInsert( columnOrder, targetColumn, index );
  15. if( Arrays.equals( columnOrder, table.getColumnOrder() ) ) {
  16. // TODO [rh] HACK mark left as changed
  17. TableColumn[] columns = table.getColumns();
  18. for( int i = 0; i < columns.length; i++ ) {
  19. getAdapter( columns[ i ] ).preserve( PROP_LEFT, null );
  20. }
  21. } else {
  22. table.setColumnOrder( columnOrder );
  23. // [if] HACK mark left as changed - see bug 336340
  24. getAdapter( column ).preserve( PROP_LEFT, null );
  25. }
  26. }

代码示例来源:origin: inspectIT/inspectIT

  1. table.setColumnOrder(columnOrder);
  2. } else if (null != columnOrder) {

相关文章

Table类方法