use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class SQLAutoIndentStrategy method clearCachedValues.
private void clearCachedValues() {
autoCompletionMap.clear();
DBPPreferenceStore preferenceStore = DBWorkbench.getPlatform().getPreferenceStore();
boolean closeBeginEnd = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_BEGIN_END);
if (closeBeginEnd) {
autoCompletionMap.put(SQLIndentSymbols.Tokenbegin, SQLIndentSymbols.end);
autoCompletionMap.put(SQLIndentSymbols.TokenBEGIN, SQLIndentSymbols.END);
}
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore 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.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class ConfirmationDialog method open.
public static int open(int kind, int imageKind, Shell parent, String title, String message, String toggleMessage, boolean toggleState, String key) {
DBPPreferenceStore prefStore = DBWorkbench.getPlatform().getPreferenceStore();
if (toggleMessage != null) {
if (ConfirmationDialog.ALWAYS.equals(prefStore.getString(key))) {
if (kind == QUESTION || kind == QUESTION_WITH_CANCEL) {
return IDialogConstants.YES_ID;
} else {
return IDialogConstants.OK_ID;
}
} else if (ConfirmationDialog.NEVER.equals(prefStore.getString(key))) {
if (kind == QUESTION || kind == QUESTION_WITH_CANCEL) {
return IDialogConstants.NO_ID;
} else {
return IDialogConstants.CANCEL_ID;
}
}
}
ConfirmationDialog dialog = new ConfirmationDialog(parent == null ? UIUtils.getActiveWorkbenchShell() : parent, title, // accept the default window icon
null, message, imageKind, getButtonLabels(kind), getDefaultIndex(kind, imageKind), toggleMessage, toggleState);
dialog.setPrefStore(new PreferenceStoreDelegate(prefStore));
dialog.setPrefKey(key);
return dialog.open();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class ERDPreferencesInitializer method initializeDefaultPreferences.
@Override
public void initializeDefaultPreferences() {
// Init default preferences
DBPPreferenceStore store = new BundlePreferenceStore(ERDUIActivator.getDefault().getBundle());
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_DIAGRAM_SHOW_VIEWS, true);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_DIAGRAM_SHOW_PARTITIONS, false);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_DIAGRAM_CHANGE_BORDER_COLORS, true);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_DIAGRAM_CHANGE_HEADER_COLORS, true);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_PRINT_PAGE_MODE, ERDUIConstants.PRINT_MODE_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_PRINT_MARGIN_TOP, ERDUIConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_PRINT_MARGIN_BOTTOM, ERDUIConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_PRINT_MARGIN_LEFT, ERDUIConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_PRINT_MARGIN_RIGHT, ERDUIConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_GRID_ENABLED, false);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_GRID_SNAP_ENABLED, true);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_GRID_WIDTH, 20);
PrefUtils.setDefaultPreferenceValue(store, ERDUIConstants.PREF_GRID_HEIGHT, 20);
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class DiagramToggleGridAction method run.
@Override
public void run() {
final DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();
final boolean gridEnabled = store.getBoolean(ERDUIConstants.PREF_GRID_ENABLED);
store.setValue(ERDUIConstants.PREF_GRID_ENABLED, !gridEnabled);
PrefUtils.savePreferenceStore(store);
}
Aggregations