@Override public void run() { // Ensure that the deprecated FONTDATA_DEFAULT_DEFAULT and // FONTDATA_ARRAY_DEFAULT values // are initialized as soon as possible FONTDATA_ARRAY_DEFAULT_DEFAULT = getFontDataArrayDefaultDefault(); FONTDATA_DEFAULT_DEFAULT = getFontDataArrayDefaultDefault()[0]; } });
/** * Helper method to construct a <code>FontData</code> from the given string. * String is in the form FontData;FontData; in order that * multiple FontDatas can be defined. * @param value the identifier for the font * @return FontData[] * * @since 3.0 */ public static FontData[] basicGetFontData(String value) { FontData[] defaultResult = getFontDataArrayDefaultDefault(); if (IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value)) { return defaultResult; } //Read in all of them to get the value StringTokenizer tokenizer = new StringTokenizer(value, ENTRY_SEPARATOR); int numTokens = tokenizer.countTokens(); FontData[] fontData = new FontData[numTokens]; for (int i = 0; i < numTokens; i++) { try { fontData[i] = new FontData(tokenizer.nextToken()); } catch (SWTException error) { return defaultResult; } catch (IllegalArgumentException error) { return defaultResult; } } return fontData; }
/** * Helper method to construct a <code>FontData</code> from the given string. * String is in the form FontData;FontData; in order that * multiple FontDatas can be defined. * @param value the identifier for the font * @return FontData[] * * @since 3.0 */ public static FontData[] basicGetFontData(String value) { FontData[] defaultResult = getFontDataArrayDefaultDefault(); if (IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value)) { return defaultResult; } //Read in all of them to get the value StringTokenizer tokenizer = new StringTokenizer(value, ENTRY_SEPARATOR); int numTokens = tokenizer.countTokens(); FontData[] fontData = new FontData[numTokens]; for (int i = 0; i < numTokens; i++) { try { fontData[i] = new FontData(tokenizer.nextToken()); } catch (SWTException error) { return defaultResult; } catch (IllegalArgumentException error) { return defaultResult; } } return fontData; }
protected void resetThemeRegistries(ThemeRegistry themeRegistry, FontRegistry fontRegistry, ColorRegistry colorRegistry) { for (FontDefinition def : themeRegistry.getFonts()) { if (def.isOverridden()) { def.resetToDefaultValue(); fontRegistry.put(def.getId(), def.getValue() != null ? def.getValue() : PreferenceConverter.getFontDataArrayDefaultDefault()); } } for (ColorDefinition def : themeRegistry.getColors()) { if (def.isOverridden()) { def.resetToDefaultValue(); colorRegistry.put(def.getId(), def.getValue() != null ? def.getValue() : EMPTY_COLOR_VALUE); } } }
if (prefFont == null || prefFont == PreferenceConverter.getFontDataArrayDefaultDefault()) { if (definition.getValue() != null) { prefFont = definition.getValue();