List of usage examples for org.eclipse.jface.resource JFaceResources VIEWER_FONT
String VIEWER_FONT
To view the source code for org.eclipse.jface.resource JFaceResources VIEWER_FONT.
Click Source Link
"org.eclipse.jface.viewerfont"
). From source file:com.github.sdbg.debug.ui.internal.util.SWTUtil.java
License:Open Source License
/** * Sets size of the font in the given {@link Control} to the size specified in * {@link JFaceResources}.//from w w w . j a v a 2s.c o m */ private static void updateFontSizeFromJFaceResources(Control control) { Font newFont = JFaceResources .getFont(JFaceResources.VIEWER_FONT/* &&&FontPreferencePage.VIEW_BASE_FONT_KEY*/); Font oldFont = control.getFont(); Font font = SWTUtil.changeFontSize(oldFont, newFont); control.setFont(font); // set Table/Tree item height if (control instanceof Table || control instanceof Tree) { setItemHeightForFont(control); } // process Composite children if (control instanceof Composite) { Composite composite = (Composite) control; Control[] children = composite.getChildren(); if (children != null) { for (Control child : children) { updateFontSizeFromJFaceResources(child); } } composite.layout(); } }