List of usage examples for org.eclipse.jface.preference PreferenceConverter getFontDataArray
public static FontData[] getFontDataArray(IPreferenceStore store, String name)
From source file:ch.elexis.core.ui.UiDesk.java
License:Open Source License
public static void updateFont(String cfgName) { FontRegistry fr = JFaceResources.getFontRegistry(); FontData[] fd = PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(CoreHub.userCfg), cfgName); fr.put(cfgName, fd);// w w w . j a v a 2 s . c o m }
From source file:ch.elexis.core.ui.UiDesk.java
License:Open Source License
public static Font getFont(String cfgName) { FontRegistry fr = JFaceResources.getFontRegistry(); if (!fr.hasValueFor(cfgName)) { FontData[] fd = PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(CoreHub.userCfg), cfgName);// w w w.j av a2s .co m fr.put(cfgName, fd); } return fr.get(cfgName); }
From source file:ch.elexis.Desk.java
License:Open Source License
public static void updateFont(String cfgName) { FontRegistry fr = JFaceResources.getFontRegistry(); FontData[] fd = PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(Hub.userCfg), cfgName); fr.put(cfgName, fd);//from www . jav a2 s.c o m }
From source file:ch.elexis.Desk.java
License:Open Source License
public static Font getFont(String cfgName) { FontRegistry fr = JFaceResources.getFontRegistry(); if (!fr.hasValueFor(cfgName)) { FontData[] fd = PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(Hub.userCfg), cfgName); fr.put(cfgName, fd);/*from w ww . ja v a 2 s.com*/ } return fr.get(cfgName); }
From source file:com.aptana.ide.logging.LoggingPreferences.java
License:Open Source License
/** * Loads main font./*from ww w.j ava 2 s . co m*/ */ private void loadMainFont() { if (!mainFontLoaded) { FontData[] data = PreferenceConverter.getFontDataArray(getPreferenceStore(), MAIN_TEXT_FONT_KEY); fontRegistry.put(MAIN_TEXT_FONT_KEY, data); mainFontLoaded = true; } }
From source file:com.ibm.research.tours.fx.FontFx.java
License:Open Source License
/** * get font setting via preferences//from w w w.jav a 2 s . c om * @param prefId */ public static FontData getFont(String prefId) { IPreferenceStore workbenchStore = WorkbenchPlugin.getDefault().getPreferenceStore(); FontData[] fontData = PreferenceConverter.getFontDataArray(workbenchStore, prefId); if (fCachedJavaEditorFont == null) fCachedJavaEditorFont = fontData; return fontData[0]; // assume 1st element in the area is what we care about }
From source file:com.safi.workshop.sqlexplorer.plugin.editors.SQLTextEditor.java
License:Open Source License
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(), SQLExplorerPlugin.PLUGIN_ID + ".SQLEditor"); Object adapter = getAdapter(org.eclipse.swt.widgets.Control.class); if (adapter instanceof StyledText) { StyledText text = (StyledText) adapter; text.setWordWrap(AsteriskDiagramEditorPlugin.getDefault().getPluginPreferences() .getBoolean(IConstants.WORD_WRAP)); FontData[] fData = PreferenceConverter.getFontDataArray(store, IConstants.FONT); if (fData.length > 0) { JFaceResources.getFontRegistry().put(fData[0].toString(), fData); text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString())); }// ww w.ja va2 s. c o m } }
From source file:com.safi.workshop.sqlexplorer.sqleditor.SQLTextViewer.java
License:Open Source License
void adaptToPreferenceChange(PropertyChangeEvent event) { if (event.getProperty().equals(IConstants.FONT)) { FontData[] fData = PreferenceConverter.getFontDataArray(store, IConstants.FONT); String des = store.getString(IConstants.FONT); JFaceResources.getFontRegistry().put(des, fData); Control ctrl = this.getControl(); if (ctrl != null) { getTextWidget().setFont(JFaceResources.getFontRegistry().get(des)); }//from w w w. j av a 2 s. c o m } }
From source file:de.anbos.eclipse.logviewer.plugin.viewer.LogFileViewer.java
License:Apache License
public LogFileViewer(Composite parent, int style) { store = LogViewerPlugin.getDefault().getPreferenceStore(); if (store.getBoolean(ILogViewerConstants.PREF_WORD_WRAP)) style |= SWT.WRAP;//from w w w . j av a2s. c om 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(); }
From source file:net.certiv.certivtools.prefs.Prefs.java
License:Open Source License
public static FontData[] getFontData(String key) { return PreferenceConverter.getFontDataArray(getStore(), key); }