Search in sources :

Example 36 with DatabaseNavigatorTree

use of org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorTree in project dbeaver by dbeaver.

the class NavigatorHandlerConnectionFilter method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    if (activePart instanceof DatabaseNavigatorView) {
        DatabaseNavigatorTree navigatorTree = ((DatabaseNavigatorView) activePart).getNavigatorTree();
        navigatorTree.setFilterShowConnected(!navigatorTree.isFilterShowConnected());
        navigatorTree.getViewer().getControl().setRedraw(false);
        try {
            navigatorTree.getViewer().refresh();
        } finally {
            navigatorTree.getViewer().getControl().setRedraw(true);
        }
    }
    ActionUtils.fireCommandRefresh(NavigatorCommands.CMD_FILTER_CONNECTIONS);
    return null;
}
Also used : IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) DatabaseNavigatorView(org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorView) DatabaseNavigatorTree(org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorTree)

Aggregations

DatabaseNavigatorTree (org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorTree)36 GridData (org.eclipse.swt.layout.GridData)28 Composite (org.eclipse.swt.widgets.Composite)23 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)17 SelectionEvent (org.eclipse.swt.events.SelectionEvent)17 DBSObject (org.jkiss.dbeaver.model.struct.DBSObject)14 Text (org.eclipse.swt.widgets.Text)13 GridLayout (org.eclipse.swt.layout.GridLayout)11 TreeNodeSpecial (org.jkiss.dbeaver.ui.navigator.database.load.TreeNodeSpecial)10 ModifyEvent (org.eclipse.swt.events.ModifyEvent)8 ModifyListener (org.eclipse.swt.events.ModifyListener)8 Button (org.eclipse.swt.widgets.Button)8 INavigatorFilter (org.jkiss.dbeaver.ui.navigator.INavigatorFilter)8 Viewer (org.eclipse.jface.viewers.Viewer)6 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)6 SashForm (org.eclipse.swt.custom.SashForm)6 DBNResource (org.jkiss.dbeaver.model.navigator.DBNResource)6 IContainer (org.eclipse.core.resources.IContainer)4 CheckboxTreeViewer (org.eclipse.jface.viewers.CheckboxTreeViewer)4 ICheckStateProvider (org.eclipse.jface.viewers.ICheckStateProvider)4