本文整理了Java中org.eclipse.swt.widgets.Tree.getColumnOrder()
方法的一些代码示例,展示了Tree.getColumnOrder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getColumnOrder()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名: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.rap/org.eclipse.rap.rwt
private static int getTreeColumn( Tree tree ) {
int[] values = tree.getColumnOrder();
return values.length > 0 ? values[ 0 ] : 0;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static Integer getTreeColumn( final Tree tree ) {
int[] values = tree.getColumnOrder();
return new Integer( values.length > 0 ? values[ 0 ] : 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.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.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.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.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.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.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.rap/org.eclipse.rap.rwt
private static String[] getColumnOrder( Tree tree ) {
int[] order = tree.getColumnOrder();
String[] result = new String[ order.length ];
for( int i = 0; i < result.length; i++ ) {
result[ i ] = getId( tree.getColumn( order[ i ] ) );
}
return result;
}
代码示例来源: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
boolean isTreeColumn( int index ) {
return index == 0 && getColumnCount() == 0
|| getColumnCount() > 0 && getColumnOrder()[ 0 ] == index;
}
代码示例来源:origin: inspectIT/inspectIT
/**
*
* @return The list of integers representing the column order in the tree. Note that only
* columns that are currently visible will be included in the list.
* @see org.eclipse.swt.widgets.Table#getColumnOrder()
*/
public List<Integer> getColumnOrder() {
int[] order = treeViewer.getTree().getColumnOrder();
List<Integer> orderWithoutHidden = new ArrayList<>();
for (int index : order) {
if (treeViewer.getTree().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++ ) {
TreeColumn 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;
TreeColumn[] 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.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);
}
内容来源于网络,如有侵权,请联系作者删除!