use of org.jkiss.dbeaver.ui.editors.DatabaseEditorInput in project dbeaver by dbeaver.
the class TabbedFolderPageProperties method detachPropertiesPanel.
private void detachPropertiesPanel() {
boolean attached = isAttached();
String title = attached ? "Detach properties to top panel" : "Move properties to tab";
if (UIUtils.confirmAction(part.getSite().getShell(), title, title + " will require to reopen editor.\nAre you sure?")) {
DBPPreferenceStore prefs = DBeaverCore.getGlobalPreferenceStore();
prefs.setValue(DBeaverPreferences.ENTITY_EDITOR_DETACH_INFO, attached);
IEditorPart editor;
if (part.getSite() instanceof MultiPageEditorSite) {
editor = ((MultiPageEditorSite) part.getSite()).getMultiPageEditor();
} else {
editor = (IEditorPart) part;
}
if (editor != null) {
DBNDatabaseNode node = null;
if (editor.getEditorInput() instanceof DatabaseEditorInput) {
node = ((DatabaseEditorInput) editor.getEditorInput()).getNavigatorNode();
}
DBeaverUI.getActiveWorkbenchWindow().getActivePage().closeEditor(editor, false);
if (node != null) {
NavigatorHandlerObjectOpen.openEntityEditor(node, null, DBeaverUI.getActiveWorkbenchWindow());
}
}
}
}
Aggregations