Search in sources :

Example 1 with ProjectNavigatorView

use of org.jkiss.dbeaver.ui.navigator.project.ProjectNavigatorView in project dbeaver by serge-rider.

the class NavigatorHandlerProjectSelect method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final DBeaverCore core = DBeaverCore.getInstance();
    final DBNProject projectNode = core.getNavigatorModel().getRoot().getProject(core.getProjectRegistry().getActiveProject());
    if (projectNode != null) {
        final IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
        try {
            final ProjectNavigatorView projectsView = (ProjectNavigatorView) workbenchWindow.getActivePage().showView(ProjectNavigatorView.VIEW_ID);
            if (projectsView != null) {
                projectsView.showNode(projectNode);
            }
        } catch (PartInitException e) {
            log.error(e);
        }
    }
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) DBNProject(org.jkiss.dbeaver.model.navigator.DBNProject) DBeaverCore(org.jkiss.dbeaver.core.DBeaverCore) ProjectNavigatorView(org.jkiss.dbeaver.ui.navigator.project.ProjectNavigatorView) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1 DBeaverCore (org.jkiss.dbeaver.core.DBeaverCore)1 DBNProject (org.jkiss.dbeaver.model.navigator.DBNProject)1 ProjectNavigatorView (org.jkiss.dbeaver.ui.navigator.project.ProjectNavigatorView)1