use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class PostgreBackupWizard method performFinish.
@Override
public boolean performFinish() {
objectsPage.saveState();
final DBPPreferenceStore store = DBeaverCore.getGlobalPreferenceStore();
store.setValue("Postgre.export.outputFilePattern", this.outputFilePattern);
store.setValue("Postgre.export.showViews", showViews);
return super.performFinish();
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class ERDPreferencesInitializer method initializeDefaultPreferences.
@Override
public void initializeDefaultPreferences() {
// Init default preferences
DBPPreferenceStore store = new BundlePreferenceStore(ERDActivator.getDefault().getBundle());
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_DIAGRAM_SHOW_VIEWS, false);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_PRINT_PAGE_MODE, ERDConstants.PRINT_MODE_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_PRINT_MARGIN_TOP, ERDConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_PRINT_MARGIN_BOTTOM, ERDConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_PRINT_MARGIN_LEFT, ERDConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_PRINT_MARGIN_RIGHT, ERDConstants.PRINT_MARGIN_DEFAULT);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_GRID_ENABLED, true);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_GRID_SNAP_ENABLED, true);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_GRID_WIDTH, 20);
PrefUtils.setDefaultPreferenceValue(store, ERDConstants.PREF_GRID_HEIGHT, 20);
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class DiagramToggleGridAction method run.
@Override
public void run() {
final DBPPreferenceStore store = ERDActivator.getDefault().getPreferences();
final boolean gridEnabled = store.getBoolean(ERDConstants.PREF_GRID_ENABLED);
store.setValue(ERDConstants.PREF_GRID_ENABLED, !gridEnabled);
PrefUtils.savePreferenceStore(store);
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class ERDPreferencePage method performOk.
@Override
public boolean performOk() {
DBPPreferenceStore store = ERDActivator.getDefault().getPreferences();
store.setValue(ERDConstants.PREF_DIAGRAM_SHOW_VIEWS, contentsShowViews.getSelection());
store.setValue(ERDConstants.PREF_GRID_ENABLED, gridCheck.getSelection());
store.setValue(ERDConstants.PREF_GRID_SNAP_ENABLED, snapCheck.getSelection());
store.setValue(ERDConstants.PREF_GRID_WIDTH, spinnerGridWidth.getSelection());
store.setValue(ERDConstants.PREF_GRID_HEIGHT, spinnerGridHeight.getSelection());
int pageMode;
switch(modeCombo.getSelectionIndex()) {
case 1:
pageMode = PrintFigureOperation.FIT_PAGE;
break;
case 2:
pageMode = PrintFigureOperation.FIT_WIDTH;
break;
case 3:
pageMode = PrintFigureOperation.FIT_HEIGHT;
break;
default:
pageMode = PrintFigureOperation.TILE;
break;
}
store.setValue(ERDConstants.PREF_PRINT_PAGE_MODE, pageMode);
store.setValue(ERDConstants.PREF_PRINT_MARGIN_TOP, spinnerMarginTop.getSelection());
store.setValue(ERDConstants.PREF_PRINT_MARGIN_BOTTOM, spinnerMarginBottom.getSelection());
store.setValue(ERDConstants.PREF_PRINT_MARGIN_LEFT, spinnerMarginLeft.getSelection());
store.setValue(ERDConstants.PREF_PRINT_MARGIN_RIGHT, spinnerMarginRight.getSelection());
for (Button radio : visibilityButtons) {
if (radio.getSelection()) {
ERDAttributeVisibility.setDefaultVisibility(store, (ERDAttributeVisibility) radio.getData());
}
}
List<ERDAttributeStyle> enabledStyles = new ArrayList<>();
for (Button check : styleButtons) {
if (check.getSelection()) {
enabledStyles.add((ERDAttributeStyle) check.getData());
}
}
ERDAttributeStyle.setDefaultStyles(store, enabledStyles.toArray(new ERDAttributeStyle[enabledStyles.size()]));
PrefUtils.savePreferenceStore(store);
return true;
}
use of org.jkiss.dbeaver.model.preferences.DBPPreferenceStore in project dbeaver by dbeaver.
the class DataSourceManagementToolbar method changeResultSetSize.
private void changeResultSetSize() {
DBPDataSourceContainer dsContainer = getDataSourceContainer();
if (dsContainer != null) {
String rsSize = resultSetSize.getText();
if (rsSize.length() == 0) {
// $NON-NLS-1$
rsSize = "1";
}
DBPPreferenceStore store = dsContainer.getPreferenceStore();
store.setValue(DBeaverPreferences.RESULT_SET_MAX_ROWS, rsSize);
PrefUtils.savePreferenceStore(store);
}
}
Aggregations