Java Code Examples for org.eclipse.jface.resource.FontRegistry#put()

The following examples show how to use org.eclipse.jface.resource.FontRegistry#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WidgetMessageDecorator.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private Font getMessageFont() {
    final FontRegistry fontRegistry = JFaceResources.getFontRegistry();
    if (fontRegistry.hasValueFor(WidgetMessageDecorator.class.getName())) {
        return fontRegistry.get(WidgetMessageDecorator.class.getName());
    }
    fontRegistry.put(WidgetMessageDecorator.class.getName(),
            new FontData[] { new FontData(WidgetMessageDecorator.class.getName(), 10, SWT.NORMAL) });
    return fontRegistry.get(WidgetMessageDecorator.class.getName());
}
 
Example 2
Source File: UiDesk.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public static void updateFont(String cfgName){
	FontRegistry fr = JFaceResources.getFontRegistry();
	FontData[] fd =
		PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(CoreHub.userCfg),
			cfgName);
	fr.put(cfgName, fd);
}
 
Example 3
Source File: UiDesk.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public static Font getFont(String cfgName){
	FontRegistry fr = JFaceResources.getFontRegistry();
	if (!fr.hasValueFor(cfgName)) {
		FontData[] fd =
			PreferenceConverter.getFontDataArray(new SettingsPreferenceStore(CoreHub.userCfg),
				cfgName);
		fr.put(cfgName, fd);
	}
	return fr.get(cfgName);
}
 
Example 4
Source File: UiDesk.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public static Font getFont(String name, int height, int style){
	String key = name + ":" + Integer.toString(height) + ":" + Integer.toString(style); //$NON-NLS-1$ //$NON-NLS-2$
	FontRegistry fr = JFaceResources.getFontRegistry();
	if (!fr.hasValueFor(key)) {
		FontData[] fd = new FontData[] {
			new FontData(name, height, style)
		};
		fr.put(key, fd);
	}
	return fr.get(key);
}