Java Code Examples for org.eclipse.swt.widgets.TreeColumn#getParent()

The following examples show how to use org.eclipse.swt.widgets.TreeColumn#getParent() . 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: SortTreeColumnSelectionListener.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected Tree getParent(SelectionEvent e) {
	// 1) Get tree column which fire this selection event
	TreeColumn treeColumn = (TreeColumn) e.getSource();
	// 2) Get the owner tree
	return treeColumn.getParent();
}
 
Example 2
Source File: SortTreeColumnSelectionListener.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void sort(SelectionEvent e) {
	// 1) Get tree column which fire this selection event
	TreeColumn treeColumn = (TreeColumn) e.getSource();
	// 2) Get the owner tree
	Tree tree = treeColumn.getParent();
	// 3) Modify the SWT Tree sort
	tree.setSortColumn(treeColumn);
	tree.setSortDirection(getSortDirection());
}