Java Code Examples for org.eclipse.swt.widgets.Tree#getColumns()

The following examples show how to use org.eclipse.swt.widgets.Tree#getColumns() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeStatsTableControl.java    From depan with Apache License 2.0 5 votes vote down vote up
private void configSorters(Tree tree) {
  int index = 0;
  for (TreeColumn column : tree.getColumns()) {
    final int colIndex = index++;

    column.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        updateSortColumn((TreeColumn) event.widget, colIndex);
      }
    });
  }
}
 
Example 2
Source File: NodeDisplayTableControl.java    From depan with Apache License 2.0 5 votes vote down vote up
private void configSorters(Tree tree) {
  int index = 0;
  for (TreeColumn column : tree.getColumns()) {
    final int colIndex = index++;

    column.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        updateSortColumn((TreeColumn) event.widget, colIndex);
      }
    });
  }
}
 
Example 3
Source File: AbstractSection.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Pack tree.
 *
 * @param p_tree the tree
 */
public void packTree(Tree p_tree) {
  TreeColumn[] columns = p_tree.getColumns();
  for (int i = 0; i < columns.length; i++) {
    columns[i].pack();
  }
}
 
Example 4
Source File: Trees.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public static void bindColumnWidths(final Tree tree, int minimum, final double... percents) {
	if (tree == null || percents == null)
		return;
	TreeResizeListener treeListener = new TreeResizeListener(tree, minimum, percents);
	ColumnResizeListener columnListener = new ColumnResizeListener(treeListener);
	for (TreeColumn column : tree.getColumns())
		column.addControlListener(columnListener);
	tree.addControlListener(treeListener);
}