Search in sources :

Example 6 with ITreeSelection

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);
        }
    }
}
Also used : ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) Iterator(java.util.Iterator) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode)

Example 7 with ITreeSelection

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();
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) Listener(org.eclipse.swt.widgets.Listener) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) Button(org.eclipse.swt.widgets.Button) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) TreeSelection(org.eclipse.jface.viewers.TreeSelection) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Event(org.eclipse.swt.widgets.Event)

Aggregations

ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)7 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)2 Iterator (java.util.Iterator)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)2 Button (org.eclipse.swt.widgets.Button)2 Event (org.eclipse.swt.widgets.Event)2 Listener (org.eclipse.swt.widgets.Listener)2 IFolder (org.eclipse.core.resources.IFolder)1 IProject (org.eclipse.core.resources.IProject)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 TreePath (org.eclipse.jface.viewers.TreePath)1 FilterPlacement (org.mongodb.meclipse.views.FilterPlacement)1 Collection (org.mongodb.meclipse.views.objects.Collection)1 Filter (org.mongodb.meclipse.views.objects.Filter)1 TreeParent (org.mongodb.meclipse.views.objects.TreeParent)1