Search in sources :

Example 31 with BundlePreferenceStore

use of org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore in project dbeaver by dbeaver.

the class DBeaverTestActivator method start.

@Override
public void start(BundleContext context) throws Exception {
    super.start(context);
    instance = this;
    Bundle bundle = getBundle();
    ModelPreferences.setMainBundle(bundle);
    preferences = new BundlePreferenceStore(bundle);
}
Also used : BundlePreferenceStore(org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore) Bundle(org.osgi.framework.Bundle)

Example 32 with BundlePreferenceStore

use of org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore in project dbeaver by serge-rider.

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);
}
Also used : BundlePreferenceStore(org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)

Aggregations

BundlePreferenceStore (org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore)32 DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)8 MissingResourceException (java.util.MissingResourceException)6 Bundle (org.osgi.framework.Bundle)4 ResourceBundle (java.util.ResourceBundle)2