/** * Returns the current value of the first entry of the * font-valued preference with the * given name in the given preference store. * Returns the default-default value (<code>FONTDATA_ARRAY_DEFAULT_DEFAULT</code>) * if there is no preference with the given name, or if the current value * cannot be treated as font data. * This API is provided for backwards compatibility. It is * recommended that <code>getFontDataArray</code> is used instead. * * @param store the preference store * @param name the name of the preference * @return the font-valued preference */ public static FontData getFontData(IPreferenceStore store, String name) { return getFontDataArray(store, name)[0]; }
String key = createPreferenceKey(theme, id); FontData[] prefFont = store != null ? PreferenceConverter .getFontDataArray(store, key) : null; FontData[] defaultFont = null; if (definition.getValue() != null) {
/** * Returns the current value of the first entry of the * font-valued preference with the * given name in the given preference store. * Returns the default-default value (<code>FONTDATA_ARRAY_DEFAULT_DEFAULT</code>) * if there is no preference with the given name, or if the current value * cannot be treated as font data. * This API is provided for backwards compatibility. It is * recommended that <code>getFontDataArray</code> is used instead. * * @param store the preference store * @param name the name of the preference * @return the font-valued preference */ public static FontData getFontData(IPreferenceStore store, String name) { return getFontDataArray(store, name)[0]; }
/** * Returns the current value of the first entry of the * font-valued preference with the * given name in the given preference store. * Returns the default-default value (<code>FONTDATA_ARRAY_DEFAULT_DEFAULT</code>) * if there is no preference with the given name, or if the current value * cannot be treated as font data. * This API is provided for backwards compatibility. It is * recommended that <code>getFontDataArray</code> is used instead. * * @param store the preference store * @param name the name of the preference * @return the font-valued preference */ public static FontData getFontData(IPreferenceStore store, String name) { return getFontDataArray(store, name)[0]; }
/** * Sets the current value of the preference with the given name * in the given preference store. This method does not update * the font registry or fire a property change event. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see PreferenceConverter#setValue(IPreferenceStore, String, FontData[]) */ public static void putValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); } }
/** * Sets the current value of the preference with the given name * in the given preference store. This method does not update * the font registry or fire a property change event. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see PreferenceConverter#setValue(IPreferenceStore, String, FontData[]) */ public static void putValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); } }
/** * Sets the current value of the preference with the given name * in the given preference store. This method does not update * the font registry or fire a property change event. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see PreferenceConverter#setValue(IPreferenceStore, String, FontData[]) */ public static void putValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); } }
@Override protected void doLoad() { if (changeFontButton == null) { return; } updateFont(PreferenceConverter.getFontDataArray(getPreferenceStore(), getPreferenceName())); }
@Override protected void doLoad() { if (changeFontButton == null) { return; } updateFont(PreferenceConverter.getFontDataArray(getPreferenceStore(), getPreferenceName())); }
protected void doLoad() { if (changeFontButton == null) { return; } updateFont(PreferenceConverter.getFontDataArray(getPreferenceStore(), getPreferenceName())); }
/** * Sets the current value of the preference with the given name * in the given preference store. This method also sets the corresponding * key in the JFace font registry to the value and fires a * property change event to listeners on the preference store. * * <p> * Note that this API does not update any other settings that may * be dependant upon it. Only the value in the preference store * and in the font registry is updated. * </p> * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see #putValue(IPreferenceStore, String, FontData[]) */ public static void setValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); JFaceResources.getFontRegistry().put(name, value); store.firePropertyChangeEvent(name, oldValue, value); } }
/** * Sets the current value of the preference with the given name * in the given preference store. This method also sets the corresponding * key in the JFace font registry to the value and fires a * property change event to listeners on the preference store. * * <p> * Note that this API does not update any other settings that may * be dependant upon it. Only the value in the preference store * and in the font registry is updated. * </p> * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see #putValue(IPreferenceStore, String, FontData[]) */ public static void setValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); JFaceResources.getFontRegistry().put(name, value); store.firePropertyChangeEvent(name, oldValue, value); } }
/** * Sets the current value of the preference with the given name * in the given preference store. This method also sets the corresponding * key in the JFace font registry to the value and fires a * property change event to listeners on the preference store. * * <p> * Note that this API does not update any other settings that may * be dependant upon it. Only the value in the preference store * and in the font registry is updated. * </p> * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference * * @see #putValue(IPreferenceStore, String, FontData[]) */ public static void setValue(IPreferenceStore store, String name, FontData[] value) { FontData[] oldValue = getFontDataArray(store, name); // see if the font has changed if (!Arrays.equals(oldValue, value)) { store.putValue(name, getStoredRepresentation(value)); JFaceResources.getFontRegistry().put(name, value); store.firePropertyChangeEvent(name, oldValue, value); } }
public void propertyChange(PropertyChangeEvent event) { if(event.getProperty().equals(ILogViewerConstants.PREF_CURSORLINE_COLOR)) { Color color = new Color(Display.getCurrent(),PreferenceConverter.getColor(store,ILogViewerConstants.PREF_CURSORLINE_COLOR)); cursorLinePainter.setHighlightColor(color); } if(event.getProperty().equals(ILogViewerConstants.PREF_EDITOR_FONT_STYLE)) { FontData[] fontData = PreferenceConverter.getFontDataArray(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE); txtViewer.getTextWidget().setFont(new Font(Display.getCurrent(),fontData)); } if(event.getProperty().equals(ILogViewerConstants.PREF_WORD_WRAP)) { boolean wordWrap = store.getBoolean(ILogViewerConstants.PREF_WORD_WRAP); txtViewer.getTextWidget().setWordWrap(wordWrap); } if(event.getProperty().equals(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED)) { showWhenUpdated = store.getBoolean(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED); } if(event.getProperty().equals(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE)) { showTopOfFile = store.getBoolean(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE); } } }
.getString( "AttributesPreferencePage.Italic" ), 1 ); //$NON-NLS-1$ FontData[] fontDatas = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), ATTRIBUTE_FONT_CONSTANTS[i] ); RGB rgb = PreferenceConverter.getColor( BrowserCommonActivator.getDefault().getPreferenceStore(),
/** * {@inheritDoc} */ public boolean performOk() { // Show Decorated Values getPreferenceStore().setValue( BrowserCommonConstants.PREFERENCE_SHOW_RAW_VALUES, !showDecoratedValuesButton.getSelection() ); // Attributes Colors And Fonts for ( int i = 0; i < ATTRIBUTE_TYPES.length; i++ ) { FontData[] fontDatas = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), ATTRIBUTE_FONT_CONSTANTS[i] ); setFontData( fontDatas, attributeBoldButtons[i], attributeItalicButtons[i] ); RGB rgb = attributeColorSelectors[i].getColorValue(); PreferenceConverter.setValue( BrowserCommonActivator.getDefault().getPreferenceStore(), ATTRIBUTE_FONT_CONSTANTS[i], fontDatas ); PreferenceConverter.setValue( BrowserCommonActivator.getDefault().getPreferenceStore(), ATTRIBUTE_COLOR_CONSTANTS[i], rgb ); } return true; }
FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OBJECTCLASS_FONT ); return BrowserCommonActivator.getDefault().getFont( fontData ); FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_MUSTATTRIBUTE_FONT ); return BrowserCommonActivator.getDefault().getFont( fontData ); FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OPERATIONALATTRIBUTE_FONT ); return BrowserCommonActivator.getDefault().getFont( fontData ); FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault() .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_MAYATTRIBUTE_FONT ); return BrowserCommonActivator.getDefault().getFont( fontData );
public LogFileViewer(Composite parent, int style) { store = LogViewerPlugin.getDefault().getPreferenceStore(); if (store.getBoolean(ILogViewerConstants.PREF_WORD_WRAP)) style |= SWT.WRAP; showWhenUpdated = store.getBoolean(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED); showTopOfFile = store.getBoolean(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE); txtViewer = new SourceViewer(parent,null,style); FontData[] fontData = PreferenceConverter.getFontDataArray(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE); if(fontData == null) { fontData = JFaceResources.getDefaultFont().getFontData(); } txtViewer.getTextWidget().setFont(new Font(Display.getCurrent(),fontData)); propertyChangeListener = new PropertyChangeListener(); store.addPropertyChangeListener(propertyChangeListener); createCursorLinePainter(); createAndInstallPresentationReconciler(); }
if (!background.equals(backgrounColorDefaultDefault)) style.setBackgroundColor(background); FontData[] fontDataArray = PreferenceConverter.getFontDataArray(preferenceStore, fontKey); if (!Arrays.equals(fontDataArray, fontDataDefaultDefault)) { style.setFontData(fontDataArray);
if (!store.getBoolean(fontPropagatedKey)) PreferenceConverter.setValue( getDeprecatedWorkbenchPreferenceStore(), PreferenceConstants.EDITOR_TEXT_FONT, PreferenceConverter.getFontDataArray(store, JFaceResources.TEXT_FONT));