use of org.eclipse.jface.viewers.ITreeSelection in project cubrid-manager by CUBRID.
the class ExpandTreeItemAction method run.
@SuppressWarnings("rawtypes")
public void run() {
if (treeViewer != null) {
ITreeSelection selectedNodes = (ITreeSelection) treeViewer.getSelection();
Iterator iter = selectedNodes.iterator();
while (iter.hasNext()) {
Object node = iter.next();
if (!(node instanceof ICubridNode)) {
continue;
}
treeViewer.expandToLevel(node, 1);
}
}
}
use of org.eclipse.jface.viewers.ITreeSelection in project tdi-studio-se by Talend.
the class AbstractTreeNodeButton method init.
private void init(Composite parent, String tooltip, Image image) {
button = new Button(parent, SWT.PUSH);
button.setToolTipText(tooltip);
button.setImage(image);
button.setEnabled(false);
button.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
if (treeViewer != null && !treeViewer.getTree().isDisposed() && treeViewer.getSelection() instanceof ITreeSelection) {
handleSelectionEvent((TreeSelection) treeViewer.getSelection());
}
}
});
treeViewer = manager.getUiManager().getFoxUI().getTreeViewer();
addTreeListeners();
}
Aggregations