use of org.jkiss.dbeaver.model.DBPDataSourceContainer in project dbeaver by serge-rider.
the class DBXTreeFolder method getChildren.
@NotNull
@Override
public List<DBXTreeNode> getChildren(DBNNode context) {
List<DBXTreeNode> children = super.getChildren(context);
if (!CommonUtils.isEmpty(contributedCategories) && context instanceof DBNDatabaseNode) {
// Add contributed editors
List<DBXTreeNode> childrenWithContributions = new ArrayList<>(children);
DBPDataSourceProviderRegistry dspRegistry = DBWorkbench.getPlatform().getDataSourceProviderRegistry();
DBPDataSourceContainer dataSource = ((DBNDatabaseNode) context).getDataSourceContainer();
for (String category : contributedCategories) {
DBPEditorContribution[] editors = dspRegistry.getContributedEditors(category, dataSource);
for (DBPEditorContribution editor : editors) {
DBXTreeObject editorNode = new DBXTreeObject(getSource(), // No parent - otherwise we'll have dups after each call
null, null, null, editor.getLabel(), editor.getDescription(), editor.getEditorId());
editorNode.setDefaultIcon(editor.getIcon());
childrenWithContributions.add(editorNode);
}
}
return childrenWithContributions;
}
return children;
}
use of org.jkiss.dbeaver.model.DBPDataSourceContainer in project dbeaver by serge-rider.
the class NativeToolConfigPanel method updateHomeSelector.
private void updateHomeSelector() {
DBPDataSourceContainer newDataSource = null;
if (selectedObject instanceof DBPDataSourceContainer) {
newDataSource = (DBPDataSourceContainer) selectedObject;
} else if (selectedObject != null) {
newDataSource = selectedObject.getDataSource().getContainer();
}
if (newDataSource != null && curDataSource != newDataSource) {
homesSelector.populateHomes(newDataSource.getDriver(), newDataSource.getConnectionConfiguration().getClientHomeId(), true);
}
curDataSource = newDataSource;
}
use of org.jkiss.dbeaver.model.DBPDataSourceContainer in project dbeaver by serge-rider.
the class NativeToolWizardDialog method openClientConfiguration.
private void openClientConfiguration() {
AbstractNativeToolWizard toolWizard = (AbstractNativeToolWizard) getWizard();
DBPDataSourceContainer dataSource = toolWizard.getSettings().getDataSourceContainer();
if (dataSource != null) {
NativeClientConfigDialog dialog = new NativeClientConfigDialog(getShell(), dataSource);
if (dialog.open() == IDialogConstants.OK_ID) {
toolWizard.updateErrorMessage();
updateButtons();
}
}
}
use of org.jkiss.dbeaver.model.DBPDataSourceContainer in project dbeaver by serge-rider.
the class SQLEditorHandlerSeparateConnectionOption method updateElement.
@Override
public void updateElement(UIElement element, Map parameters) {
element.setText(SQLEditorMessages.pref_page_sql_editor_label_separate_connection_each_editor);
element.setTooltip(SQLEditorMessages.pref_page_sql_editor_label_separate_connection_each_editor);
IEditorPart activeEditor = UIUtils.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
DBPDataSourceContainer dsContainer = activeEditor == null ? null : getDataSourceContainerFromPart(activeEditor);
DBPPreferenceStore prefStore = dsContainer == null ? DBWorkbench.getPlatform().getPreferenceStore() : dsContainer.getPreferenceStore();
element.setChecked(prefStore.getBoolean(SQLPreferenceConstants.EDITOR_SEPARATE_CONNECTION));
}
use of org.jkiss.dbeaver.model.DBPDataSourceContainer in project dbeaver by serge-rider.
the class DBGSourcePathComputer method computeSourceContainers.
@Override
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
DBPDataSourceContainer dataSource = DebugUtils.getDataSourceContainer(configuration);
DatabaseNavigatorSourceContainer container = new DatabaseNavigatorSourceContainer(dataSource);
return new ISourceContainer[] { container };
}
Aggregations