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

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

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

Table.getColumnOrder介绍

[英]Returns an array of zero-relative integers that map the creation order of the receiver's items to the order in which they are currently being displayed.

Specifically, the indices of the returned array represent the current visual order of the items, and the contents of the array represent the creation order of the items.

Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
[中]返回一个由零个相对整数组成的数组,这些整数将接收方项的创建顺序映射到它们当前的显示顺序。
具体来说,返回数组的索引表示项的当前视觉顺序,数组的内容表示项的创建顺序。
注意:这不是接收方维护其项目列表所使用的实际结构,因此修改数组不会影响接收方。

代码示例

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

/**
 * @return
 */
private int[] getColumnOrder() {
  if (targetControl instanceof Table) {
    return ((Table) targetControl).getColumnOrder();
  } else if (targetControl instanceof Tree) {
    return ((Tree) targetControl).getColumnOrder();
  }
  return new int[0];
}

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

/**
 * @return
 */
private int[] getColumnOrder() {
  if (targetControl instanceof Table) {
    return ((Table) targetControl).getColumnOrder();
  } else if (targetControl instanceof Tree) {
    return ((Tree) targetControl).getColumnOrder();
  }
  return new int[0];
}

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

private boolean isFixedColumn( int index ) {
 int[] columnOrder = getColumnOrder();
 int visualIndex = -1;
 for( int i = 0; i < columnOrder.length && visualIndex == -1; i++ ) {
  if( index == columnOrder[ i ] ) {
   visualIndex = i;
  }
 }
 return visualIndex < getFixedColumns();
}

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

/**
 * @return
 */
private int[] getColumnOrder() {
  if (targetControl instanceof Table) {
    return ((Table) targetControl).getColumnOrder();
  } else if (targetControl instanceof Tree) {
    return ((Tree) targetControl).getColumnOrder();
  }
  return new int[0];
}

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

private boolean isValidOrderIndex(int currentIndex) {
  return currentIndex < this.item.getParent().getColumnOrder().length;
}

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

private boolean isValidOrderIndex(int currentIndex) {
  return currentIndex < this.item.getParent().getColumnOrder().length;
}

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

private boolean isValidOrderIndex(int currentIndex) {
 return currentIndex < this.item.getParent().getColumnOrder().length;
}

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

@Override
public int getVisualIndex(int creationIndex) {
  int[] order = item.getParent().getColumnOrder();
  for (int i = 0; i < order.length; i++) {
    if (order[i] == creationIndex) {
      return i;
    }
  }
  return super.getVisualIndex(creationIndex);
}

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

@Override
public int getVisualIndex(int creationIndex) {
  int[] order = item.getParent().getColumnOrder();
  for (int i = 0; i < order.length; i++) {
    if (order[i] == creationIndex) {
      return i;
    }
  }
  return super.getVisualIndex(creationIndex);
}

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

private static String[] getColumnOrder( Table table ) {
 int[] order = table.getColumnOrder();
 String[] result = new String[ order.length ];
 for( int i = 0; i < result.length; i++ ) {
  result[ i ] = getId( table.getColumn( order[ i ] ) );
 }
 return result;
}

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

public int getVisualIndex(int creationIndex) {
 int[] order = item.getParent().getColumnOrder();
 for (int i = 0; i < order.length; i++) {
  if (order[i] == creationIndex) {
   return i;
  }
 }
 return super.getVisualIndex(creationIndex);
}

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

final Point getCheckSize( int index ) {
 Point result = new Point( 0, 0 );
 if( index == 0 && getColumnCount() == 0 ) {
  result = getCheckSize();
 } else {
  int[] columnOrder = getColumnOrder();
  if( columnOrder[ 0 ] == index ) {
   result = getCheckSize();
  }
 }
 return result;
}

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

/**
 *
 * @return The list of integers representing the column order in the table. Note that only
 *         columns that are currently visible will be included in the list.
 * @see Table#getColumnOrder()
 */
public List<Integer> getColumnOrder() {
  int[] order = tableViewer.getTable().getColumnOrder();
  List<Integer> orderWithoutHidden = new ArrayList<>();
  for (int index : order) {
    if (tableViewer.getTable().getColumns()[index].getWidth() > 0) {
      orderWithoutHidden.add(index);
    }
  }
  return orderWithoutHidden;
}

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

private void processNextColumnsMoveEvent() {
 int[] columnsOrder = parent.getColumnOrder();
 boolean found = false;
 for( int i = 0; i < columnsOrder.length; i++ ) {
  TableColumn column = parent.getColumn( columnsOrder[ i ] );
  if( column == this ) {
   found = true;
  } else if( found ) {
   column.notifyListeners( SWT.Move, new Event() );
  }
 }
}

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

final int getLeft() {
 int result = 0;
 TableColumn[] columns = parent.getColumns();
 int[] columnOrder = parent.getColumnOrder();
 int orderedIndex = -1;
 for( int i = 0; orderedIndex == -1 && i < columnOrder.length; i++ ) {
  if( columnOrder[ i ] == parent.indexOf( this ) ) {
   orderedIndex = i;
  }
 }
 for( int i = 0; i < orderedIndex; i++ ) {
  result += columns[ columnOrder[ i ] ].getWidth();
 }
 return result;
}

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

public int getColumnIndex( Point point ) {
 int result = -1;
 int count = getColumnCount();
 // If there are no columns the column-index is 0
 if( count == 0 ) {
  result = 0;
 } else {
  int[] columnOrder = item.getParent().getColumnOrder();
  for( int i = 0; i < columnOrder.length && result == -1; i++ ) {
   if( getBounds( columnOrder[ i ] ).contains( point ) ) {
    result = columnOrder[ i ];
   }
  }
 }
 return result;
}
// RAPEND

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

@Override
public int getCreationIndex(int visualIndex) {
  if( item != null && ! item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex) ) {
    return item.getParent().getColumnOrder()[visualIndex];
  }
  return super.getCreationIndex(visualIndex);
}

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

@Override
public int getCreationIndex(int visualIndex) {
  if( item != null && ! item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex) ) {
    return item.getParent().getColumnOrder()[visualIndex];
  }
  return super.getCreationIndex(visualIndex);
}

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

public int getCreationIndex(int visualIndex) {
 if( item != null && ! item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex) ) {
  return item.getParent().getColumnOrder()[visualIndex];
 }
 return super.getCreationIndex(visualIndex);
}

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

@Override
 protected void layout(Composite composite, boolean flushCache) {
  Rectangle parentBounds = composite.getClientArea();
  TableColumn[] columns = m_tableViewer.getTable().getColumns();
  int[] colOrder = m_tableViewer.getTable().getColumnOrder();
  int x = -m_tableViewer.getTable().getHorizontalBar().getSelection();
  for (int i = 0; i < columns.length; i++) {
   TableColumn column = columns[colOrder[i]];
   if (i == NlsTable.AMOUNT_UTILITY_COLS) {
    // layout button
    m_resetButton.setBounds(1, 1, x - 2, parentBounds.height - 2);
   }
   if (i >= NlsTable.AMOUNT_UTILITY_COLS) {
    Language lang = (Language) column.getData(NlsTable.LANGUAGE_COLUMN_ID);
    Text text = m_filterFields.get(lang);
    if (text != null) {
     text.setBounds(x + 1, 1, column.getWidth() - 2, parentBounds.height - 2);
    }
   }
   x += column.getWidth();
  }
  composite.update();
 }
} // end P_FilterComponentLayout

相关文章

Table类方法