+
+ /** Dispose all children of a Composite */
+ public static void clear(Composite composite) {
+ for (Control child : composite.getChildren())
+ child.dispose();
+ }
+
+ /**
+ * Enables efficient call to the layout method of a composite, refreshing only
+ * some of the children controls.
+ */
+ public static void layout(Composite parent, Control... toUpdateControls) {
+ parent.layout(toUpdateControls);
+ }
+
+ //
+ // FONTS
+ //
+ /** Shortcut to retrieve default italic font from display */
+ public static Font getItalicFont(Composite parent) {
+ return JFaceResources.getFontRegistry().defaultFontDescriptor().setStyle(SWT.ITALIC)
+ .createFont(parent.getDisplay());
+ }
+
+ /** Shortcut to retrieve default bold font from display */
+ public static Font getBoldFont(Composite parent) {
+ return JFaceResources.getFontRegistry().defaultFontDescriptor().setStyle(SWT.BOLD)
+ .createFont(parent.getDisplay());
+ }
+
+ /** Shortcut to retrieve default bold italic font from display */
+ public static Font getBoldItalicFont(Composite parent) {
+ return JFaceResources.getFontRegistry().defaultFontDescriptor().setStyle(SWT.BOLD | SWT.ITALIC)
+ .createFont(parent.getDisplay());
+ }
+