Example usage for org.eclipse.jface.preference IPreferenceStore setDefault

List of usage examples for org.eclipse.jface.preference IPreferenceStore setDefault

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore setDefault.

Prototype

void setDefault(String name, boolean value);

Source Link

Document

Sets the default value for the boolean-valued preference with the given name.

Usage

From source file:com.codenvy.eclipse.ui.preferences.CodenvyPreferencesInitializer.java

License:Open Source License

@Override
public void initializeDefaultPreferences() {
    IPreferenceStore codenvyUIPreferenceStore = CodenvyUIPlugin.getDefault().getPreferenceStore();
    codenvyUIPreferenceStore.setDefault(REMOTE_REPOSITORIES_LOCATION_KEY_NAME, DEFAULT_LOCATION);
}

From source file:com.coldfire.debugger.core.PreferenceInitializer.java

License:Open Source License

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    // TODO: clean-up the default values
    store.setDefault(Constants.pref_GDB_COMMAND, Constants.pref_GDB_COMMMAND_default);
    store.setDefault(Constants.pref_GDB_INIT_FILE, Constants.pref_GDB_INIT_FILE_default);
    store.setDefault(Constants.pref_IS_INTERNAL_PROGRAMMER, Constants.pref_IS_INTERNAL_PROGRAMMER_default);

}

From source file:com.density.ezsbt.util.SbtPlugin.java

License:Apache License

@Override
protected void initializeDefaultPreferences(IPreferenceStore store) {
    store.setDefault(PluginConstants.COMMANDS_NAME_KEY,
            CommandsConvertor.arrayToString(PluginConstants.DEFAULT_COMMANDS));
    store.setDefault(PluginConstants.JAVA_HOME_KEY, getJavaHome());
    store.setDefault(PluginConstants.JAVA_OPTIONS_KEY, PluginConstants.DEFAULT_JAVA_OPTIONS);
    store.setDefault(PluginConstants.HIDE_RESOLVE_KEY, PluginConstants.DEFAULT_HIDE_RESOLVE);
}

From source file:com.dnw.depmap.preferences.PreferenceInitializer.java

License:Open Source License

/**
 * This method is called by the preference initializer to initialize default preference values.
 * Clients should get the correct node for their bundle and then set the default values on it.
 * /*from   w ww  .  j  a  v a2s .  co m*/
 * @author manbaum
 * @since Oct 20, 2014
 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 */
public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(PrefKeys.P_USESTANDALONE, true);
    store.setDefault(PrefKeys.P_DBURL, "http://localhost:7474/db/data");
    store.setDefault(PrefKeys.P_USEEMBEDDED, false);
    store.setDefault(PrefKeys.P_DBDIR, "./neo4j-community-2.1.5/data/graph.db");
    store.setDefault(PrefKeys.P_WHITELIST, "com\\.dnw\\..*\n@java.lang.Object");
    store.setDefault(PrefKeys.P_BLACKLIST, ".*");
    store.setDefault(PrefKeys.P_PREFERWHITE, true);
    store.setDefault(PrefKeys.P_USEPREEXEC, false);
    store.setDefault(PrefKeys.P_PREEXEC, "match ()-[r]-() delete r\n" // delete all relations.
            + "match (n) delete n\n" // delete all nodes.
            + "drop constraint on (t:Type) ASSERT t.name is unique\n" // delete unique constraint on type names.
            + "drop constraint on (m:Method) ASSERT m.name is unique\n" // delete unique constraint on method names.
            + "drop index on :Type(caption)\n" // delete index on type captions.
            + "drop index on :Method(caption)\n" // delete index on method captions.
            + "create constraint on (t:Type) ASSERT t.name is unique\n" // create unique constraint on type names.
            + "create constraint on (m:Method) ASSERT m.name is unique\n" // create unique constraint on method names.
            + "create index on :Type(caption)\n" // create index on type captions.
            + "create index on :Method(caption)" // create index on method captions.
    );
}

From source file:com.doapps.cakephp.preferences.PreferenceInitializer.java

License:MIT License

public void initializeDefaultPreferences() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    store.setDefault(PreferenceConstants.P_CAKE_VER, PreferenceConstants.DEFAULT_CAKE_VER);
    store.setDefault(PreferenceConstants.P_CREATE_FILES_AUTOMATICALLY,
            PreferenceConstants.DEFAULT_CREATE_FILES_AUTOMATICALLY);
    store.setDefault(PreferenceConstants.P_APP_DIR,
            CakeVersion.getVersion(PreferenceConstants.DEFAULT_CAKE_VER).getDefaultAppDirName());
}

From source file:com.drgarbage.bytecodevisualizer.preferences.BytecodeVisualizerPreferenceInitializer.java

License:Apache License

@Override
public void initializeDefaultPreferences() {
    IPreferenceStore store = BytecodeVisualizerPlugin.getDefault().getPreferenceStore();

    /* General */
    store.setDefault(GRAPH_PANEL_ATTR_RENDER_GRAPHS, true);

    store.setDefault(CLASS_FILE_ATTR_SHOW_CONSTANT_POOL, false);
    store.setDefault(CLASS_FILE_ATTR_SHOW_LINE_NUMBER_TABLE, false);
    store.setDefault(CLASS_FILE_ATTR_SHOW_VARIABLE_TABLE, false);
    store.setDefault(CLASS_FILE_ATTR_SHOW_EXCEPTION_TABLE, false);
    store.setDefault(CLASS_FILE_ATTR_SHOW_MAXS, false);

    store.setDefault(RETRIEVE_CLASS_FROM, RETRIEVE_CLASS_FROM_FILE_SYSTEM);
    store.setDefault(BRANCH_TARGET_ADDRESS_RENDERING, BRANCH_TARGET_ADDRESS_RELATIVE);

    store.setDefault(CLASS_FILE_ATTR_RENDER_TRYCATCH_BLOCKS, true);
    store.setDefault(CLASS_FILE_ATTR_SHOW_SOURCE_LINE_NUMBERS, true);

    store.setDefault(CLASS_FILE_ATTR_SHOW_MAXS, false);

    /* Syntax Highlighting */
    /* default is black */
    PreferenceConverter.setDefault(store, BYTECODE_MNEMONIC, new RGB(0, 0, 0));
    store.setDefault(BYTECODE_MNEMONIC_BOLD, true);
    store.setDefault(BYTECODE_MNEMONIC_ITALIC, false);
    store.setDefault(BYTECODE_MNEMONIC_STRIKETHROUGH, false);
    store.setDefault(BYTECODE_MNEMONIC_UNDERLINE, false);

    /* Source Code */
    store.setDefault(SHOW_TAB, SHOW_SOURCECODE_IF_AVALIABLE);

}

From source file:com.drgarbage.core.preferences.PreferenceInitializer.java

License:Apache License

public void initializeDefaultPreferences() {
    IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore();

    store.setDefault(CorePreferenceConstants.GRAPH_PANEL_LOCATION,
            CorePreferenceConstants.GRAPH_PANEL_LOCATION_EDITOR);

    PreferenceConverter.setDefault(store, CorePreferenceConstants.INSTRUCTION_BGCOLOR,
            CorePreferenceConstants.DEFAULT_INSTRUCTION_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.BASIC_BLOCK_BGCOLOR,
            CorePreferenceConstants.DEFAULT_BASIC_BLOCK_BGCOLOR);

    PreferenceConverter.setDefault(store, CorePreferenceConstants.GET_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_GET_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.INVOKE_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_INVOKE_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.SWITCH_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_SWITCH_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.DECISION_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_DECISION_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.GOTO_JUMP_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_GOTO_JUMP_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.RETURN_VERTEX_BGCOLOR,
            CorePreferenceConstants.DEFAULT_RETURN_VERTEX_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.ENTRY_END_BGCOLOR,
            CorePreferenceConstants.DEFAULT_ENTRY_END_BGCOLOR);
    PreferenceConverter.setDefault(store, CorePreferenceConstants.COMMENT_BGCOLOR,
            CorePreferenceConstants.DEFAULT_COMMENT_BGCOLOR);
}

From source file:com.dubture.twig.ui.editor.SemanticHighlightingManager.java

License:Open Source License

/**
 * Initialize default preferences in the given preference store.
 * //from  w  w w .j  a  va 2s  . c  o m
 * @param store
 *            The preference store
 */
public SemanticHighlightingManager initDefaults(IPreferenceStore store) {
    Collection<AbstractSemanticHighlighting> semanticHighlightings = highlightings.values();
    for (AbstractSemanticHighlighting rule : semanticHighlightings) {
        rule.initDefaultPreferences();
        SemanticHighlightingStyle style = rule.getStyle();
        setDefaultAndFireEvent(store, rule.getColorPreferenceKey(), style.getDefaultTextColor());
        setDefaultAndFireEvent(store, rule.getBackgroundColorPreferenceKey(),
                style.getDefaultBackgroundColor());

        store.setDefault(rule.getBoldPreferenceKey(), style.isBoldByDefault());
        store.setDefault(rule.getItalicPreferenceKey(), style.isItalicByDefault());
        store.setDefault(rule.getStrikethroughPreferenceKey(), style.isStrikethroughByDefault());
        store.setDefault(rule.getUnderlinePreferenceKey(), style.isUnderlineByDefault());
        store.setDefault(rule.getEnabledPreferenceKey(), style.isEnabledByDefault());
    }
    return this;
}

From source file:com.dubture.twig.ui.editor.SemanticHighlightingManager.java

License:Open Source License

/**
 * Sets the default value and fires a property change event if necessary.
 * //from   www . j ava 2s  .  c o  m
 * @param store
 *            the preference store
 * @param key
 *            the preference key
 * @param newValue
 *            the new value
 */
private static void setDefaultAndFireEvent(IPreferenceStore store, String key, RGB newValue) {
    RGB oldValue = null;
    if (store.isDefault(key))
        oldValue = PreferenceConverter.getDefaultColor(store, key);

    PreferenceConverter.setDefault(store, key, newValue);
    store.setDefault(key, ColorHelper.toRGBString(newValue));

    if (oldValue != null && !oldValue.equals(newValue))
        store.firePropertyChangeEvent(key, oldValue, newValue);
}

From source file:com.dubture.twig.ui.preferences.PreferenceConstants.java

License:Open Source License

public static void initializeDefaultValues() {

    // Override Editor Preference defaults:
    IPreferenceStore editorStore = EditorsPlugin.getDefault().getPreferenceStore();

    // Show current line:
    editorStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true);

    // Show line numbers:
    editorStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, true);

    IPreferenceStore store = getPreferenceStore();

    // SyntaxColoringPage
    store.setDefault(EDITOR_NORMAL_COLOR, EDITOR_NORMAL_DEFAULT_COLOR);
    store.setDefault(EDITOR_BOUNDARYMARKER_COLOR, EDITOR_BOUNDARYMARKER_DEFAULT_COLOR);
    store.setDefault(EDITOR_STMT_BOUNDARYMARKER_COLOR, EDITOR_STMT_BOUNDARYMARKER_DEFAULT_COLOR);
    store.setDefault(EDITOR_LABEL_COLOR, EDITOR_LABEL_DEFAULT_COLOR);
    store.setDefault(EDITOR_VARIABLE_COLOR, EDITOR_VARIABLE_DEFAULT_COLOR);
    store.setDefault(EDITOR_STRING_COLOR, EDITOR_STRING_DEFAULT_COLOR);
    store.setDefault(EDITOR_HASH_COLOR, EDITOR_HASH_DEFAULT_COLOR);
    store.setDefault(EDITOR_INTERPOLATION_COLOR, EDITOR_STMT_BOUNDARYMARKER_DEFAULT_COLOR);
    store.setDefault(EDITOR_KEYWORD_COLOR, EDITOR_KEYWORD_DEFAULT_COLOR);
    store.setDefault(EDITOR_BLOCKNAME_COLOR, EDITOR_BLOCKNAME_DEFAULT_COLOR);
    store.setDefault(EDITOR_NUMBER_COLOR, EDITOR_NUMBER_DEFAULT_COLOR);
    store.setDefault(EDITOR_DOUBLE_QUOTED_COLOR, EDITOR_DOUBLE_QUOTED_DEFAULT_COLOR);
    store.setDefault(EDITOR_COMMENT_COLOR, EDITOR_COMMENT_DEFAULT_COLOR);

    store.setDefault(getEnabledPreferenceKey(EDITOR_NORMAL_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_BOUNDARYMARKER_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_STMT_BOUNDARYMARKER_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_LABEL_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_VARIABLE_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_STRING_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_HASH_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_INTERPOLATION_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_KEYWORD_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_BLOCKNAME_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_NUMBER_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_DOUBLE_QUOTED_COLOR), true);
    store.setDefault(getEnabledPreferenceKey(EDITOR_COMMENT_COLOR), true);

    store.setDefault(TwigCoreConstants.SYNTAX_PROBLEM_SEVERITY, TwigCoreConstants.SYNTAX_IGNORE);
    store.setDefault(MARK_OCCURRENCES, true);

    // code assist
    store.setDefault(AUTOCLOSE_PRINT_TAGS, true);
    store.setDefault(AUTOCLOSE_STATEMENT_TAGS, true);

    SemanticHighlightingManager.getInstance().initDefaults(store);

}