/** * Sets the default value of the preference with the given name * in the given preference store. As FontDatas are stored as * arrays this method is only provided for backwards compatibility. * Use <code>setDefault(IPreferenceStore, String, FontData[])</code> * instead. * * @param store the preference store * @param name the name of the preference * @param value the new default value of the preference */ public static void setDefault(IPreferenceStore store, String name, FontData value) { FontData[] fontDatas = new FontData[1]; fontDatas[0] = value; setDefault(store, name, fontDatas); }
/** * Sets the default value of the preference with the given name * in the given preference store. As FontDatas are stored as * arrays this method is only provided for backwards compatibility. * Use <code>setDefault(IPreferenceStore, String, FontData[])</code> * instead. * * @param store the preference store * @param name the name of the preference * @param value the new default value of the preference */ public static void setDefault(IPreferenceStore store, String name, FontData value) { FontData[] fontDatas = new FontData[1]; fontDatas[0] = value; setDefault(store, name, fontDatas); }
/** * Sets the default value of the preference with the given name * in the given preference store. As FontDatas are stored as * arrays this method is only provided for backwards compatibility. * Use <code>setDefault(IPreferenceStore, String, FontData[])</code> * instead. * * @param store the preference store * @param name the name of the preference * @param value the new default value of the preference */ public static void setDefault(IPreferenceStore store, String name, FontData value) { FontData[] fontDatas = new FontData[1]; fontDatas[0] = value; setDefault(store, name, fontDatas); }
public static void initializeDefaults(IPreferenceStore store) { boolean highContrast = false; try { highContrast = Display.getDefault().getHighContrast(); } catch (SWTException e) { // keep highContrast = false } PreferenceConverter.setDefault(store, P_DEFAULT, highContrast ? DEFAULT_HIGH_CONTRAST : DEFAULT); PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR); PreferenceConverter.setDefault(store, P_STRING, STRING); PreferenceConverter.setDefault(store, P_EXTERNALIZED_STRING, EXTERNALIZED_STRING); PreferenceConverter.setDefault(store, P_TAG, TAG); PreferenceConverter.setDefault(store, P_XML_COMMENT, XML_COMMENT); PreferenceConverter.setDefault(store, P_HEADER_KEY, HEADER_KEY); PreferenceConverter.setDefault(store, P_HEADER_OSGI, HEADER_OSGI); store.setDefault(P_HEADER_OSGI + IPDEColorConstants.P_BOLD_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_VALUE, highContrast ? HEADER_VALUE_HIGH_CONTRAST : HEADER_VALUE); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, highContrast ? HEADER_ASSIGNMENT_HIGH_CONTRAST : HEADER_ATTRIBUTES); store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT); }
public static void setDefaultPreferences(IPreferenceStore pStore) { pStore.setDefault(PREF_WORD_WRAP, false); pStore.setDefault(PREF_FOLDING, true); pStore.setDefault(PREF_TASK_TAGS, true); pStore.setDefault(PREF_TASK_TAGS_DEFINED, "TODO,FIXME,??"); pStore.setDefault(PREF_MARKDOWN_COMMAND, MARKDOWNJ); pStore.setDefault(PREF_SECTION_NUMBERS, true); pStore.setDefault(PREF_GITHUB_SYNTAX, true); pStore.setDefault(PREF_MULTIMARKDOWN_METADATA, false); PreferenceConverter.setDefault(pStore, PREF_DEFUALT, DEF_DEFAULT); PreferenceConverter.setDefault(pStore, PREF_COMMENT, DEF_COMMENT); PreferenceConverter.setDefault(pStore, PREF_HEADER, DEF_HEADER); PreferenceConverter.setDefault(pStore, PREF_LINK, DEF_LINK); PreferenceConverter.setDefault(pStore, PREF_CODE, DEF_CODE); PreferenceConverter.setDefault(pStore, PREF_CODE_BG, DEF_CODE_BG); }
/** * This stores the given RGB value without firing * a property changed event. * * @param store the preference store * @param key the key * @param rgb the RGB value * @since 3.4 */ private static void setRGBValue(IPreferenceStore store, String key, RGB rgb) { PreferenceConverter.setDefault(store, key, rgb); String value= store.getString(key); store.putValue(key, value); }
/** * This stores the given RGB value without firing * a property changed event. * * @param store the preference store * @param key the key * @param rgb the RGB value * @since 3.4 */ private static void setRGBValue(IPreferenceStore store, String key, RGB rgb) { PreferenceConverter.setDefault(store, key, rgb); String value= store.getString(key); store.putValue(key, value); }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @param fireEvent <code>false</code> if no event should be fired * @since 3.4 */ private static void setDefault(IPreferenceStore store, String key, RGB newValue, boolean fireEvent) { if (!fireEvent) { PreferenceConverter.setDefault(store, key, newValue); return; } RGB oldValue= null; if (store.isDefault(key)) oldValue= PreferenceConverter.getDefaultColor(store, key); PreferenceConverter.setDefault(store, key, newValue); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
/** * Propagates the font set in the source store to the * target store using the given keys. * * @param source the store from which to read the text font * @param sourceKey the key under which the font can be found * @param target the store to which to propagate the font * @param targetKey the key under which to store the font */ private static void propagateFont(IPreferenceStore source, String sourceKey, IPreferenceStore target, String targetKey) { FontData fd= PreferenceConverter.getFontData(source, sourceKey); if (fd != null) { boolean isDefault= target.isDefault(targetKey); // save old state! PreferenceConverter.setDefault(target, targetKey, fd); if (isDefault) { // restore old state target.setToDefault(targetKey); } } }
/** * Propagates the font set in the source store to the * target store using the given keys. * * @param source the store from which to read the text font * @param sourceKey the key under which the font can be found * @param target the store to which to propagate the font * @param targetKey the key under which to store the font */ private static void propagateFont(IPreferenceStore source, String sourceKey, IPreferenceStore target, String targetKey) { FontData fd= PreferenceConverter.getFontData(source, sourceKey); if (fd != null) { boolean isDefault= target.isDefault(targetKey); // save old state! PreferenceConverter.setDefault(target, targetKey, fd); if (isDefault) { // restore old state target.setToDefault(targetKey); } } }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @since 3.3 */ 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); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
private void initializeDefaultColors() { if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb); } if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb); } if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb); } if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb); } }
private void initializeDefaultColors() { if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb); } if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb); } if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, rgb); } if (!getPreferenceStore().contains(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)) { RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(); PreferenceConverter.setDefault(fOverlayStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb); PreferenceConverter.setDefault(getPreferenceStore(), AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb); } }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @since 3.3 */ 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); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
private void loadDefaultPluginPreferences(IPreferenceStore store) { store.setDefault(ILogViewerConstants.PREF_BACKLOG,ILogViewerConstants.DEFAULT_BACKLOG); store.setDefault(ILogViewerConstants.PREF_BUFFER,ILogViewerConstants.DEFAULT_BUFFER_CAPACITY); store.setDefault(ILogViewerConstants.PREF_READWAIT,ILogViewerConstants.DEFAULT_READWAIT_SIZE); store.setDefault(ILogViewerConstants.PREF_ENCODING,System.getProperty("file.encoding")); store.setDefault(ILogViewerConstants.PREF_WORD_WRAP,ILogViewerConstants.DEAFULT_WORD_WRAP); store.setDefault(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED,ILogViewerConstants.DEAFULT_SHOW_WHEN_UPDATED); store.setDefault(ILogViewerConstants.PREF_FILTER_EXTENSIONS,ILogViewerConstants.DEFAULT_FILTER_EXTENSIONS); store.setDefault(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE,ILogViewerConstants.DEAFULT_SHOW_TOP_OF_FILE); PreferenceConverter.setDefault(store,ILogViewerConstants.PREF_CURSORLINE_COLOR,new RGB(192,192,192)); PreferenceConverter.setDefault(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE,JFaceResources.getDefaultFont().getFontData()); } }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @since 3.3 */ 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); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @since 3.3 */ 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); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
/** * Sets the default value and fires a property * change event if necessary. * * @param store the preference store * @param key the preference key * @param newValue the new value * @since 3.3 */ 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); if (oldValue != null && !oldValue.equals(newValue)) store.firePropertyChangeEvent(key, oldValue, newValue); }
public static void initDefaults(IPreferenceStore store) { RGB gray= new RGB(85, 85, 85); store.setDefault(EMPHASIZE_POTENTIAL_MATCHES, true); store.setDefault(IGNORE_POTENTIAL_MATCHES, false); PreferenceConverter.setDefault(store, POTENTIAL_MATCH_FG_COLOR, gray); store.setDefault(REUSE_EDITOR, true); store.setDefault(BRING_VIEW_TO_FRONT, true); store.setDefault(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE); store.setDefault(TEXT_SEARCH_ENGINE, ""); //default search engine is empty string //$NON-NLS-1$ store.setDefault(TEXT_SEARCH_QUERY_PROVIDER, ""); // default query provider is empty string //$NON-NLS-1$ store.setDefault(LIMIT_HISTORY, 10); }
public static void initDefaults(IPreferenceStore store) { RGB gray= new RGB(85, 85, 85); store.setDefault(EMPHASIZE_POTENTIAL_MATCHES, true); store.setDefault(IGNORE_POTENTIAL_MATCHES, false); PreferenceConverter.setDefault(store, POTENTIAL_MATCH_FG_COLOR, gray); store.setDefault(REUSE_EDITOR, true); store.setDefault(BRING_VIEW_TO_FRONT, true); store.setDefault(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE); store.setDefault(TEXT_SEARCH_ENGINE, ""); //default search engine is empty string //$NON-NLS-1$ store.setDefault(TEXT_SEARCH_QUERY_PROVIDER, ""); // default query provider is empty string //$NON-NLS-1$ store.setDefault(LIMIT_HISTORY, 10); }