+ /*
+ * ICONS
+ */
+ /** Get a small icon from this theme. */
+ public static Image getSmallIcon(CmsTheme theme, CmsIcon icon) {
+ return ((CmsSwtTheme) theme).getSmallIcon(icon);
+ }
+
+ /** Get a big icon from this theme. */
+ public static Image getBigIcon(CmsTheme theme, CmsIcon icon) {
+ return ((CmsSwtTheme) theme).getBigIcon(icon);
+ }
+
+ /*
+ * LAYOUT INDEPENDENT
+ */
+ /** Takes the most space possible, depending on parent layout. */
+ public static void fill(Control control) {
+ Layout parentLayout = control.getParent().getLayout();
+ if (parentLayout == null)
+ throw new IllegalStateException("Parent layout is not set");
+ if (parentLayout instanceof GridLayout) {
+ control.setLayoutData(fillAll());
+ } else if (parentLayout instanceof FormLayout) {
+ control.setLayoutData(coverAll());
+ } else {
+ throw new IllegalArgumentException("Unsupported parent layout " + parentLayout.getClass().getName());
+ }
+ }
+