Search in sources :

Example 11 with BundlePreferenceStore

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

the class DBeaverActivator 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);
    DBRFeatureRegistry.getInstance().registerFeatures(CoreFeatures.class);
    try {
        coreResourceBundle = ResourceBundle.getBundle(CoreMessages.BUNDLE_NAME);
        pluginResourceBundle = Platform.getResourceBundle(bundle);
    } catch (MissingResourceException x) {
        coreResourceBundle = null;
    }
}
Also used : BundlePreferenceStore(org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore) ResourceBundle(java.util.ResourceBundle) Bundle(org.osgi.framework.Bundle) MissingResourceException(java.util.MissingResourceException)

Example 12 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)

Example 13 with BundlePreferenceStore

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

the class ModelPreferences method setMainBundle.

public static void setMainBundle(Bundle mainBundle) {
    ModelPreferences.mainBundle = mainBundle;
    ModelPreferences.preferences = new BundlePreferenceStore(mainBundle);
    initializeDefaultPreferences(ModelPreferences.preferences);
}
Also used : BundlePreferenceStore(org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore)

Example 14 with BundlePreferenceStore

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

the class ERDUIActivator method start.

@Override
public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    preferences = new BundlePreferenceStore(getBundle());
    try {
        resourceBundle = ResourceBundle.getBundle(ERDUIMessages.BUNDLE_NAME);
    } catch (MissingResourceException x) {
        resourceBundle = null;
    }
    // Switch off D3D because of Sun XOR painting bug
    // See http://www.jgraph.com/forum/viewtopic.php?t=4066
    // $NON-NLS-1$
    System.setProperty("sun.java2d.d3d", Boolean.FALSE.toString());
}
Also used : BundlePreferenceStore(org.jkiss.dbeaver.model.impl.preferences.BundlePreferenceStore) MissingResourceException(java.util.MissingResourceException)

Example 15 with BundlePreferenceStore

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

the class DBeaverPreferencesInitializer method initializeDefaultPreferences.

@Override
public void initializeDefaultPreferences() {
    boolean isWindows = RuntimeUtils.isPlatformWindows();
    // Init default preferences
    DBPPreferenceStore store = new BundlePreferenceStore(DBeaverActivator.getInstance().getBundle());
    // Resources
    // PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.DEFAULT_RESOURCE_ENCODING, GeneralUtils.UTF8_ENCODING);
    // Agent
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.AGENT_ENABLED, true);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.AGENT_LONG_OPERATION_NOTIFY, isWindows);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.AGENT_LONG_OPERATION_TIMEOUT, 30);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.SECURITY_USE_BOUNCY_CASTLE, true);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.NAVIGATOR_EDITOR_FULL_NAME, false);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.TOOLBARS_SHOW_GENERAL_ALWAYS, false);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.TOOLBARS_SHOW_EDIT, false);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.TEXT_EDIT_UNDO_LEVEL, 200);
    // General UI
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.UI_AUTO_UPDATE_CHECK, true);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.UI_KEEP_DATABASE_EDITORS, true);
    // QM
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_HISTORY_DAYS, 90);
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_ENTRIES_PER_PAGE, 200);
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_OBJECT_TYPES, QMObjectType.toString(Arrays.asList(QMObjectType.txn, QMObjectType.query)));
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_QUERY_TYPES, DBCExecutionPurpose.USER + "," + DBCExecutionPurpose.USER_FILTERED + "," + DBCExecutionPurpose.USER_SCRIPT);
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_STORE_LOG_FILE, false);
    PrefUtils.setDefaultPreferenceValue(store, QMConstants.PROP_LOG_DIRECTORY, GeneralUtils.getMetadataFolder().getAbsolutePath());
    // Logs
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.LOGS_DEBUG_ENABLED, true);
    PrefUtils.setDefaultPreferenceValue(store, DBeaverPreferences.LOGS_DEBUG_LOCATION, "${" + SystemVariablesResolver.VAR_WORKSPACE + "}" + File.separator + ".metadata" + File.separator + DBConstants.DEBUG_LOG_FILE_NAME);
}
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)21 DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)6 MissingResourceException (java.util.MissingResourceException)5 Bundle (org.osgi.framework.Bundle)3 ResourceBundle (java.util.ResourceBundle)2