List of usage examples for org.eclipse.jface.preference IPreferenceStore setDefault
void setDefault(String name, boolean value);
From source file:com.boothen.jsonedit.preferences.JsonPreferenceStore.java
License:Open Source License
@Override public void initializeDefaultPreferences() { IPreferenceStore preferenceStore = getIPreferenceStore(); IPreferenceStore editorPreferenceStore = getEditorPreferenceStore(); preferenceStore.setDefault(OVERRIDE_TAB_SETTING, false); preferenceStore.setDefault(SPACES_FOR_TABS, true); preferenceStore.setDefault(NUM_SPACES, 4); preferenceStore.setDefault(EDITOR_MATCHING_BRACKETS, true); preferenceStore.setDefault(EDITOR_MATCHING_BRACKETS_COLOR, StringConverter.asString(JsonColorProvider.STRING)); preferenceStore.setDefault(AUTO_FORMAT_ON_SAVE, false); preferenceStore.setDefault(STRING_COLOR, StringConverter.asString(JsonColorProvider.STRING)); preferenceStore.setDefault(VALUE_COLOR, StringConverter.asString(JsonColorProvider.VALUE)); preferenceStore.setDefault(NULL_COLOR, StringConverter.asString(JsonColorProvider.NULL)); preferenceStore.setDefault(ERROR_COLOR, StringConverter.asString(JsonColorProvider.ERROR)); preferenceStore.setDefault(DEFAULT_COLOR, StringConverter.asString(JsonColorProvider.DEFAULT)); preferenceStore.setDefault(ERROR_TEXT_STYLE, editorPreferenceStore.getDefaultString(ERROR_TEXT_STYLE)); preferenceStore.setDefault(ERROR_INDICATION, editorPreferenceStore.getDefaultString(ERROR_INDICATION)); preferenceStore.setDefault(ERROR_INDICATION_COLOR, editorPreferenceStore.getDefaultString(ERROR_INDICATION_COLOR)); }
From source file:com.ca.casd.lisa.plugins.odataassistant.preferences.PreferenceInitializer.java
License:Open Source License
public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setDefault(PreferenceConstants.P_MAX_NUMBER_PATH, "4"); store.setDefault(PreferenceConstants.P_ENABLE_POPULATE_TRANSACTIONS, true); }
From source file:com.cb.eclipse.folding.java.preferences.Defaults.java
License:Open Source License
private static void doLoop(IPreferenceStore store, int mode) { Map values = new HashMap(); values.put(PreferenceKeys.COLLAPSE_COMMENT_BLOCKS, COLLAPSE_COMMENT_BLOCKS); values.put(PreferenceKeys.FOLD_COMMENT_BLOCKS, FOLD_COMMENT_BLOCKS); values.put(PreferenceKeys.COLLAPSE_LINE_COMMENTS, COLLAPSE_LINE_COMMENTS); values.put(PreferenceKeys.FOLD_LINE_COMMENTS, FOLD_LINE_COMMENTS); values.put(PreferenceKeys.COLLAPSE_JAVADOCS, COLLAPSE_JAVADOCS); values.put(PreferenceKeys.FOLD_JAVADOCS, FOLD_JAVADOCS); values.put(PreferenceKeys.COLLAPSE_HEADER, COLLAPSE_HEADER); values.put(PreferenceKeys.FOLD_HEADER, FOLD_HEADER); values.put(PreferenceKeys.COLLAPSE_IMPORTS, COLLAPSE_IMPORTS); values.put(PreferenceKeys.FOLD_IMPORTS, FOLD_IMPORTS); values.put(PreferenceKeys.COLLAPSE_INNER_TYPES, COLLAPSE_INNER_TYPES); values.put(PreferenceKeys.FOLD_INNER_TYPES, FOLD_INNER_TYPES); values.put(PreferenceKeys.COLLAPSE_STATICS, COLLAPSE_STATICS); values.put(PreferenceKeys.FOLD_STATICS, FOLD_STATICS); values.put(PreferenceKeys.COLLAPSE_METHODS, COLLAPSE_METHODS); values.put(PreferenceKeys.FOLD_METHODS, FOLD_METHODS); values.put(PreferenceKeys.COLLAPSE_TOP_TYPES, COLLAPSE_TOP_TYPES); values.put(PreferenceKeys.FOLD_TOP_TYPES, FOLD_TOP_TYPES); values.put(PreferenceKeys.FOLD_MAIN_METHODS, FOLD_MAIN_METHODS); values.put(PreferenceKeys.COLLAPSE_MAIN_METHODS, COLLAPSE_MAIN_METHODS); values.put(PreferenceKeys.COLLAPSE_CONSTRUCTORS, COLLAPSE_CONSTRUCTORS); values.put(PreferenceKeys.FOLD_CONSTRUCTORS, FOLD_CONSTRUCTORS); values.put(PreferenceKeys.FOLD_USER_DEFINED, FOLD_USER_DEFINED); values.put(PreferenceKeys.COLLAPSE_USER_DEFINED, COLLAPSE_USER_DEFINED); Iterator entries = values.entrySet().iterator(); while (entries.hasNext()) { Map.Entry entry = (Map.Entry) entries.next(); String key = (String) entry.getKey(); Boolean val = (Boolean) entry.getValue(); if (mode == RESTORE) { store.setToDefault(key);/*from w w w.j ava 2 s. c o m*/ } else { store.setDefault(key, val.booleanValue()); } } if (mode == RESTORE) { store.setToDefault(PreferenceKeys.MINIMUM_SIZE); store.setToDefault(PreferenceKeys.USER_DEFINED_START); store.setToDefault(PreferenceKeys.USER_DEFINED_END); store.setToDefault(PreferenceKeys.LAST_LINE_COMMENTS); store.setToDefault(PreferenceKeys.LAST_LINE_CONTROLS); store.setToDefault(PreferenceKeys.LAST_LINE_TYPES); store.setToDefault(PreferenceKeys.LAST_LINE_METHODS); store.setToDefault(PreferenceKeys.FOLDING_ICONS); } else { store.setDefault(PreferenceKeys.MINIMUM_SIZE, MINIMUM_SIZE); store.setDefault(PreferenceKeys.USER_DEFINED_START, USER_DEFINED_START); store.setDefault(PreferenceKeys.USER_DEFINED_END, USER_DEFINED_END); store.setDefault(PreferenceKeys.LAST_LINE_COMMENTS, LAST_LINE_COMMENT.booleanValue()); store.setDefault(PreferenceKeys.LAST_LINE_CONTROLS, LAST_LINE_CONTROL.booleanValue()); store.setDefault(PreferenceKeys.LAST_LINE_TYPES, LAST_LINE_TYPE.booleanValue()); store.setDefault(PreferenceKeys.LAST_LINE_METHODS, LAST_LINE_METHOD.booleanValue()); store.setDefault(PreferenceKeys.FOLDING_ICONS, FoldingPlugin.getMessage("default.icons.title")); } }
From source file:com.centurylink.mdw.plugin.MessageConsole.java
License:Apache License
public void setDefaultShowPref(boolean defaultValue) { IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); store.setDefault(MessageConsolePageParticipant.PREFS_KEY + "_" + coreName.replaceAll(" ", ""), defaultValue);//w w w . ja v a2 s . c om }
From source file:com.centurylink.mdw.plugin.preferences.model.MdwSettings.java
License:Apache License
public static void setDefaultValues() { IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); store.setDefault(PREFS_MDW_RELEASES_URL, PREFS_DEFAULT_MDW_RELEASES_URL); store.setDefault(PREFS_WORKSPACE_SETUP_URL, PREFS_DEFAULT_WORKSPACE_SETUP_URL); store.setDefault(PREFS_DISCOVERY_URL, PREFS_DEFAULT_DISCOVERY_URL); store.setDefault(PREFS_HTTP_CONNECT_TIMEOUT_MS, Server.DEFAULT_CONNECT_TIMEOUT); store.setDefault(PREFS_HTTP_READ_TIMEOUT_MS, Server.DEFAULT_READ_TIMEOUT); store.setDefault(PREFS_JDBC_FETCH_SIZE, PREFS_DEFAULT_JDBC_FETCH_SIZE); store.setDefault(PREFS_COPYRIGHT_NOTICE, PREFS_DEFAULT_COPYRIGHT_NOTICE); store.setDefault(PREFS_MDW_REPORTING_LEVEL, PREFS_DEFAULT_MDW_REPORTING_LEVEL); store.setDefault(PREFS_TEMP_RESOURCE_DIRECTORY, PREFS_DEFAULT_TEMP_RESOURCE_DIRECTORY); store.setDefault(PREFS_PREVIOUS_TEMP_FILE_VERSIONS_TO_KEEP, PREFS_DEFAULT_PREV_TEMP_FILE_VERSIONS); store.setDefault(PREFS_SMTP_HOST, PREFS_DEFAULT_SMTP_HOST); store.setDefault(PREFS_SMTP_PORT, PREFS_DEFAULT_SMTP_PORT); store.setDefault(PREFS_SWING_LAUNCH_EVENT_MANAGER, true); store.setDefault(PREFS_SWING_LAUNCH_THREAD_POOL_MANAGER, true); store.setDefault(PREFS_USE_DISCOVERED_VCS_CREDS, true); store.setDefault(PREFS_LOAD_SCRIPT_LIBS_ON_EDIT, false); store.setDefault(PREFS_READONLY_BG_RED, 224); store.setDefault(PREFS_READONLY_BG_GREEN, 224); store.setDefault(PREFS_READONLY_BG_BLUE, 224); store.setDefault(PREFS_EMBEDDED_EDITOR_FOR_EXCEL, !MdwPlugin.isRcp()); store.setDefault(PREFS_INFER_SMART_SUBPROC_VERSION_SPEC, true); store.setDefault(PREFS_COMPARE_CONFLICTING_ASSETS, true); store.setDefault(PREFS_WARN_OVERRIDE_ATTRS_NOT_CARRIED_FORWARD, true); }
From source file:com.centurylink.mdw.plugin.preferences.model.ServerConsoleSettings.java
License:Apache License
/** * Specifies the default values for server console prefs. Will only be * active before the user has configured anything. *//*ww w . ja va2 s. co m*/ public static void setDefaultValues() { IPreferenceStore store = MdwPlugin.getDefault().getPreferenceStore(); store.setDefault(PREFS_SERVER_CONSOLE_BUFFER_SIZE, PREFS_DEFAULT_SERVER_CONSOLE_BUFFER_SIZE); FontData fd = new FontData("Courier New", 10, SWT.NORMAL); store.setDefault(PREFS_SERVER_CONSOLE_FONT, fd.toString()); store.setDefault(PREFS_SERVER_CONSOLE_FONT_RED, 0); store.setDefault(PREFS_SERVER_CONSOLE_FONT_GREEN, 0); store.setDefault(PREFS_SERVER_CONSOLE_FONT_BLUE, 0); store.setDefault(PREFS_SERVER_CONSOLE_BG_RED, 255); store.setDefault(PREFS_SERVER_CONSOLE_BG_GREEN, 255); store.setDefault(PREFS_SERVER_CONSOLE_BG_BLUE, 255); store.setDefault(PREFS_SERVER_CLIENT_SHELL, ClientShell.Karaf.toString()); }
From source file:com.chookapp.org.bracketeer.preferences.PreferencesInitializer.java
License:Open Source License
@Override public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); IConfigurationElement[] config = Platform.getExtensionRegistry() .getConfigurationElementsFor(ProcessorsRegistry.PROC_FACTORY_ID); for (IConfigurationElement element : config) { String pluginName = element.getAttribute("name"); //$NON-NLS-1$ defualtHighlights(store, element, pluginName); defualtHints(store, element, pluginName); }//from w ww . ja v a 2s. co m IPreferenceStore editorsStore = EditorsUI.getPreferenceStore(); store.setDefault(PreferencesConstants.General.HYPERLINK_MODIFIERS, editorsStore .getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER_MASK)); }
From source file:com.chookapp.org.bracketeer.preferences.PreferencesInitializer.java
License:Open Source License
private void defualtHints(IPreferenceStore store, IConfigurationElement element, String pluginName) { String prefBase = PreferencesConstants.preferencePath(pluginName); store.setDefault(prefBase + PreferencesConstants.Hints.Globals.SHOW_IN_EDITOR, true); store.setDefault(prefBase + PreferencesConstants.Hints.Hover.ENABLE, true); store.setDefault(prefBase + PreferencesConstants.Hints.Hover.MAX_LEN, 80); String hintType = PreferencesConstants.Hints.DEFAULT_TYPE; prefBase = PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hints.preferencePath(hintType); store.setDefault(prefBase + PreferencesConstants.Hints.WhenToShow.SHOW_IN_EDITOR, true); store.setDefault(prefBase + PreferencesConstants.Hints.WhenToShow.MIN_LINES_DISTANCE, 15); store.setDefault(prefBase + PreferencesConstants.Hints.Font.FG_DEFAULT, false); PreferenceConverter.setDefault(store, prefBase + PreferencesConstants.Hints.Font.FG_COLOR, new RGB(160, 160, 160)); store.setDefault(prefBase + PreferencesConstants.Hints.Font.BG_DEFAULT, true); store.setDefault(prefBase + PreferencesConstants.Hints.Display.Ellipsis.ATTR, PreferencesConstants.Hints.Display.Ellipsis.VAL_MID); store.setDefault(prefBase + PreferencesConstants.Hints.Display.MAX_LENGTH, 30); store.setDefault(prefBase + PreferencesConstants.Hints.Display.STRIP_WHITESPACE, false); String[] prefsToCopyFromDef = { PreferencesConstants.Hints.WhenToShow.SHOW_IN_EDITOR, PreferencesConstants.Hints.WhenToShow.MIN_LINES_DISTANCE, PreferencesConstants.Hints.Font.FG_DEFAULT, PreferencesConstants.Hints.Font.FG_COLOR, PreferencesConstants.Hints.Font.BG_DEFAULT, PreferencesConstants.Hints.Display.Ellipsis.ATTR, PreferencesConstants.Hints.Display.MAX_LENGTH, PreferencesConstants.Hints.Display.STRIP_WHITESPACE }; IConfigurationElement[] hints = element.getChildren("Hint"); //$NON-NLS-1$ for (IConfigurationElement hint : hints) { hintType = hint.getAttribute("type"); //$NON-NLS-1$ prefBase = PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hints.preferencePath(hintType); String defBase = PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hints.preferencePath(PreferencesConstants.Hints.DEFAULT_TYPE); store.setDefault(prefBase + PreferencesConstants.Hints.WhenToShow.USE_DEFAULT, true); store.setDefault(prefBase + PreferencesConstants.Hints.Font.USE_DEFAULT, true); store.setDefault(prefBase + PreferencesConstants.Hints.Display.USE_DEFAULT, true); for (String pref : prefsToCopyFromDef) { store.setDefault(prefBase + pref, store.getDefaultString(defBase + pref)); }// w w w . j av a 2 s . c o m } }
From source file:com.chookapp.org.bracketeer.preferences.PreferencesInitializer.java
License:Open Source License
private void defualtHighlights(IPreferenceStore store, IConfigurationElement element, String pluginName) { /* the default */ store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(0, true) + PreferencesConstants.Highlights.UseDefault, false);/* ww w .ja v a 2 s .c o m*/ PreferenceConverter.setDefault(store, PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(0, true) + PreferencesConstants.Highlights.Color, new RGB(255, 255, 255)); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(0, false) + PreferencesConstants.Highlights.UseDefault, true); /* the brackets... */ for (int i = 1; i < PreferencesConstants.MAX_PAIRS + 2; i++) { store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, true) + PreferencesConstants.Highlights.UseDefault, true); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.UseDefault, false); if (i == PreferencesConstants.MAX_PAIRS + 1) { PreferenceConverter.setDefault(store, PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.Color, new RGB(250, 0, 0)); } else { int max = PreferencesConstants.MAX_PAIRS; //int val = (((max-i)+1)*255)/(max+1); int val = (i * 255) / (max + 1); PreferenceConverter.setDefault(store, PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.Color, new RGB(val, val, val)); } store.setDefault( PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.HighlightTypeAttr, PreferencesConstants.Highlights.HighlightTypeValSolid); // TODO: get the real editor background default /* Color def = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); PreferenceConverter.setDefault(store, PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.Color, def.getRGB()); */ // TODO: get the real editor background default /* def = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND); PreferenceConverter.setDefault(store, PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Highlights.getAttrPath(i, false) + PreferencesConstants.Highlights.Color, def.getRGB()); */ } store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Annotations.Enable, true); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.Enable, true); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.NumBracketsToShow, PreferencesConstants.MAX_PAIRS); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.MinDistanceBetweenBrackets, 1); store.setDefault( PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Surrounding.ShowBrackets, element.getAttribute(ProcessorsRegistry.SUPPORTED_BRACKETS_ATTR)); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hovering.Enable, true); store.setDefault( PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hovering.PopupEnable, true); store.setDefault(PreferencesConstants.preferencePath(pluginName) + PreferencesConstants.Hovering.PopupOnlyWithoutHint, true); }
From source file:com.cisco.yangide.editor.editors.SemanticHighlightings.java
License:Open Source License
/** * Initialize default preferences in the given preference store. * * @param store The preference store TODO refactor and call from PreferenceInitializer *//*from w ww. jav a 2 s . c o m*/ public static void initDefaults(IPreferenceStore store) { SemanticHighlighting[] semanticHighlightings = getSemanticHighlightings(); for (int i = 0, n = semanticHighlightings.length; i < n; i++) { SemanticHighlighting semanticHighlighting = semanticHighlightings[i]; setDefaultAndFireEvent(store, SemanticHighlightings.getColorPreferenceKey(semanticHighlighting), semanticHighlighting.getDefaultTextColor()); store.setDefault(SemanticHighlightings.getBoldPreferenceKey(semanticHighlighting), semanticHighlighting.isBoldByDefault()); store.setDefault(SemanticHighlightings.getItalicPreferenceKey(semanticHighlighting), semanticHighlighting.isItalicByDefault()); store.setDefault(SemanticHighlightings.getStrikethroughPreferenceKey(semanticHighlighting), semanticHighlighting.isStrikethroughByDefault()); store.setDefault(SemanticHighlightings.getUnderlinePreferenceKey(semanticHighlighting), semanticHighlighting.isUnderlineByDefault()); store.setDefault(SemanticHighlightings.getEnabledPreferenceKey(semanticHighlighting), semanticHighlighting.isEnabledByDefault()); } }