use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class UIDashboardPreferencesInitializer method initializeDefaultPreferences.
@Override
public void initializeDefaultPreferences() {
// Init default preferences
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
PrefUtils.setDefaultPreferenceValue(store, DashboardConstants.PREF_OPEN_SEPARATE_CONNECTION, false);
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class PrefPageSQLCodeEditing method performOk.
@Override
public boolean performOk() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
try {
store.setValue(SQLPreferenceConstants.FOLDING_ENABLED, csFoldingEnabled.getSelection());
store.setValue(SQLPreferenceConstants.MARK_OCCURRENCES_UNDER_CURSOR, csMarkOccurrencesUnderCursor.getSelection());
store.setValue(SQLPreferenceConstants.MARK_OCCURRENCES_FOR_SELECTION, csMarkOccurrencesForSelection.getSelection());
store.setValue(SQLPreferenceConstants.SQLEDITOR_CLOSE_SINGLE_QUOTES, acSingleQuotesCheck.getSelection());
store.setValue(SQLPreferenceConstants.SQLEDITOR_CLOSE_DOUBLE_QUOTES, acDoubleQuotesCheck.getSelection());
store.setValue(SQLPreferenceConstants.SQLEDITOR_CLOSE_BRACKETS, acBracketsCheck.getSelection());
store.setValue(SQLPreferenceConstants.SQL_FORMAT_KEYWORD_CASE_AUTO, afKeywordCase.getSelection());
store.setValue(SQLPreferenceConstants.SQL_FORMAT_EXTRACT_FROM_SOURCE, afExtractFromSource.getSelection());
} catch (Exception e) {
log.warn(e);
}
PrefUtils.savePreferenceStore(store);
PrefUtils.savePreferenceStore(store);
return super.performOk();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class SQLEditorHandlerEnableDisableFolding method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
DBPPreferenceStore preferenceStore = DBWorkbench.getPlatform().getPreferenceStore();
boolean previousValue = preferenceStore.getBoolean(SQLPreferenceConstants.FOLDING_ENABLED);
preferenceStore.setValue(SQLPreferenceConstants.FOLDING_ENABLED, !previousValue);
try {
preferenceStore.save();
} catch (IOException e) {
throw new ExecutionException("Error saving folding preference", e);
}
return null;
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class PrefPageSQLDialects method performOk.
@Override
public boolean performOk() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
// store.setValue(SQLPreferenceConstants.SCRIPT_BIND_EMBEDDED_READ, bindEmbeddedReadCheck.getSelection());
PrefUtils.savePreferenceStore(store);
return super.performOk();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class PrefPageSQLResources method performDefaults.
@Override
protected void performDefaults() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
bindEmbeddedReadCheck.setSelection(store.getBoolean(SQLPreferenceConstants.SCRIPT_BIND_EMBEDDED_READ));
bindEmbeddedWriteCheck.setSelection(store.getBoolean(SQLPreferenceConstants.SCRIPT_BIND_EMBEDDED_WRITE));
try {
SQLScriptBindingType bindingType = SQLScriptBindingType.valueOf(store.getString(SQLPreferenceConstants.SCRIPT_BIND_COMMENT_TYPE));
for (Control ch : commentTypeComposite.getChildren()) {
if (ch instanceof Button && ch.getData() == bindingType) {
((Button) ch).setSelection(true);
}
}
} catch (IllegalArgumentException e) {
log.error(e);
}
enableCommentType();
deleteEmptyCombo.setText(SQLPreferenceConstants.EmptyScriptCloseBehavior.getByName(store.getString(SQLPreferenceConstants.SCRIPT_DELETE_EMPTY)).getTitle());
autoFoldersCheck.setSelection(store.getBoolean(SQLPreferenceConstants.SCRIPT_AUTO_FOLDERS));
connectionFoldersCheck.setSelection(store.getBoolean(SQLPreferenceConstants.SCRIPT_CREATE_CONNECTION_FOLDERS));
scriptTitlePattern.setText(store.getString(SQLPreferenceConstants.SCRIPT_TITLE_PATTERN));
super.performDefaults();
}
Aggregations