Search in sources :

Example 16 with DBNProject

use of org.jkiss.dbeaver.model.navigator.DBNProject in project dbeaver by serge-rider.

the class DatabaseBrowserView method getRootNode.

@Override
public DBNNode getRootNode() {
    String secondaryId = getViewSite().getSecondaryId();
    if (!CommonUtils.isEmpty(secondaryId)) {
        try {
            return getNodeFromSecondaryId(secondaryId);
        } catch (DBException e) {
            DBWorkbench.getPlatformUI().showError("Open database browser", "Can't find database navigator node", e);
        }
    }
    DBNProject projectNode = getModel().getRoot().getProjectNode(DBWorkbench.getPlatform().getWorkspace().getActiveProject());
    return projectNode == null ? new DBNEmptyNode() : projectNode.getDatabases();
}
Also used : DBException(org.jkiss.dbeaver.DBException) DBNProject(org.jkiss.dbeaver.model.navigator.DBNProject) DBNEmptyNode(org.jkiss.dbeaver.model.navigator.DBNEmptyNode)

Aggregations

DBNProject (org.jkiss.dbeaver.model.navigator.DBNProject)16 GridData (org.eclipse.swt.layout.GridData)7 DBNDataSource (org.jkiss.dbeaver.model.navigator.DBNDataSource)6 DBNDatabaseNode (org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)5 List (java.util.List)4 ISelection (org.eclipse.jface.viewers.ISelection)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 DBException (org.jkiss.dbeaver.DBException)4 DBNResource (org.jkiss.dbeaver.model.navigator.DBNResource)4 ArrayList (java.util.ArrayList)3 CheckboxTreeViewer (org.eclipse.jface.viewers.CheckboxTreeViewer)3 ICheckStateProvider (org.eclipse.jface.viewers.ICheckStateProvider)3 ModifyEvent (org.eclipse.swt.events.ModifyEvent)3 ModifyListener (org.eclipse.swt.events.ModifyListener)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 Text (org.eclipse.swt.widgets.Text)3 DBPDataSourceContainer (org.jkiss.dbeaver.model.DBPDataSourceContainer)3