use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class PrefPageQueryManager method performDefaults.
@Override
protected void performDefaults() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
Collection<QMObjectType> objectTypes = QMObjectType.fromString(store.getString(QMConstants.PROP_OBJECT_TYPES));
Collection<String> queryTypes = CommonUtils.splitString(store.getString(QMConstants.PROP_QUERY_TYPES), ',');
checkObjectTypeSessions.setSelection(objectTypes.contains(QMObjectType.session));
checkObjectTypeTxn.setSelection(objectTypes.contains(QMObjectType.txn));
checkObjectTypeQueries.setSelection(objectTypes.contains(QMObjectType.query));
checkQueryTypeUser.setSelection(queryTypes.contains(DBCExecutionPurpose.USER.name()));
checkQueryTypeUserFiltered.setSelection(queryTypes.contains(DBCExecutionPurpose.USER_FILTERED.name()));
checkQueryTypeScript.setSelection(queryTypes.contains(DBCExecutionPurpose.USER_SCRIPT.name()));
checkQueryTypeUtil.setSelection(queryTypes.contains(DBCExecutionPurpose.UTIL.name()));
checkQueryTypeMeta.setSelection(queryTypes.contains(DBCExecutionPurpose.META.name()));
checkQueryTypeDDL.setSelection(queryTypes.contains(DBCExecutionPurpose.META_DDL.name()));
textHistoryDays.setText(store.getString(QMConstants.PROP_HISTORY_DAYS));
textEntriesPerPage.setText(store.getString(QMConstants.PROP_ENTRIES_PER_PAGE));
checkStoreLog.setSelection(store.getBoolean(QMConstants.PROP_STORE_LOG_FILE));
textOutputFolder.setText(store.getString(QMConstants.PROP_LOG_DIRECTORY));
UIUtils.enableWithChildren(textOutputFolder.getParent(), checkStoreLog.getSelection());
super.performDefaults();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class PrefPageDatabaseUserInterface method performOk.
@Override
public boolean performOk() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
if (isStandalone) {
store.setValue(DBeaverPreferences.UI_AUTO_UPDATE_CHECK, automaticUpdateCheck.getSelection());
}
store.setValue(ModelPreferences.NOTIFICATIONS_ENABLED, notificationsEnabled.getSelection());
store.setValue(ModelPreferences.NOTIFICATIONS_CLOSE_DELAY_TIMEOUT, notificationsCloseDelay.getSelection());
store.setValue(DBeaverPreferences.AGENT_LONG_OPERATION_NOTIFY, longOperationsCheck.getSelection());
store.setValue(DBeaverPreferences.AGENT_LONG_OPERATION_TIMEOUT, longOperationsTimeout.getSelection());
PrefUtils.savePreferenceStore(store);
if (workspaceLanguage.getSelectionIndex() >= 0) {
PlatformLanguageDescriptor language = PlatformLanguageRegistry.getInstance().getLanguages().get(workspaceLanguage.getSelectionIndex());
try {
DBPPlatformLanguage curLanguage = DBWorkbench.getPlatform().getLanguage();
if (curLanguage != language) {
((DBPPlatformLanguageManager) DBWorkbench.getPlatform()).setPlatformLanguage(language);
if (UIUtils.confirmAction(getShell(), "Restart " + GeneralUtils.getProductName(), "You need to restart " + GeneralUtils.getProductName() + " to perform actual language change.\nDo you want to restart?")) {
UIUtils.asyncExec(() -> PlatformUI.getWorkbench().restart());
}
}
} catch (DBException e) {
DBWorkbench.getPlatformUI().showError("Change language", "Can't switch language to " + language, e);
}
}
return true;
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class PrefPageDatabaseUserInterface method performDefaults.
@Override
protected void performDefaults() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
if (isStandalone) {
automaticUpdateCheck.setSelection(store.getBoolean(DBeaverPreferences.UI_AUTO_UPDATE_CHECK));
}
notificationsEnabled.setSelection(store.getBoolean(ModelPreferences.NOTIFICATIONS_ENABLED));
notificationsCloseDelay.setSelection(store.getInt(ModelPreferences.NOTIFICATIONS_CLOSE_DELAY_TIMEOUT));
longOperationsCheck.setSelection(store.getBoolean(DBeaverPreferences.AGENT_LONG_OPERATION_NOTIFY));
longOperationsTimeout.setSelection(store.getInt(DBeaverPreferences.AGENT_LONG_OPERATION_TIMEOUT));
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class GISViewerConfigurationDialog method okPressed.
@Override
protected void okPressed() {
DBPPreferenceStore preferences = GISViewerActivator.getDefault().getPreferences();
preferences.setValue(GeometryViewerConstants.PREF_DEFAULT_SRID, defaultSridText.getText());
preferences.setValue(GeometryViewerConstants.PREF_MAX_OBJECTS_RENDER, CommonUtils.toInt(maxObjectsText.getText()));
super.okPressed();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by serge-rider.
the class PrefPageDatabaseEditors method performDefaults.
@Override
protected void performDefaults() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
syncEditorDataSourceWithNavigator.setSelection(store.getBoolean(NavigatorPreferences.NAVIGATOR_SYNC_EDITOR_DATASOURCE));
showGeneralToolbarEverywhere.setSelection(store.getBoolean(DBeaverPreferences.TOOLBARS_SHOW_GENERAL_ALWAYS));
showEditToolbar.setSelection(store.getBoolean(DBeaverPreferences.TOOLBARS_SHOW_EDIT));
// toolbarDatabaseSelectorWidth.setSelection(store.getInt(DBeaverPreferences.TOOLBARS_DATABASE_SELECTOR_WIDTH));
// toolbarSchemaSelectorWidth.setSelection(store.getInt(DBeaverPreferences.TOOLBARS_SCHEMA_SELECTOR_WIDTH));
keepEditorsOnRestart.setSelection(store.getBoolean(DBeaverPreferences.UI_KEEP_DATABASE_EDITORS));
refreshEditorOnOpen.setSelection(store.getBoolean(NavigatorPreferences.NAVIGATOR_REFRESH_EDITORS_ON_OPEN));
editorFullName.setSelection(store.getBoolean(DBeaverPreferences.NAVIGATOR_EDITOR_FULL_NAME));
showTableGrid.setSelection(store.getBoolean(NavigatorPreferences.NAVIGATOR_EDITOR_SHOW_TABLE_GRID));
showPreviewOnSave.setSelection(store.getBoolean(NavigatorPreferences.NAVIGATOR_SHOW_SQL_PREVIEW));
}
Aggregations