Introduce CMS App concept.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / util / CmsUiUtils.java
index c96e77b62649ce74b76f1e0e7c7a0f80b580af1a..3669db3fdb35ad9061f7ef993a5cf3415dae2fb5 100644 (file)
@@ -102,18 +102,26 @@ public class CmsUiUtils implements CmsConstants {
        //
        // GRID DATA
        //
-       public static GridData fillWidth() {
-               return grabWidth(SWT.FILL, SWT.FILL);
-       }
-
        public static GridData fillAll() {
                return new GridData(SWT.FILL, SWT.FILL, true, true);
        }
 
+       public static GridData fillWidth() {
+               return grabWidth(SWT.FILL, SWT.FILL);
+       }
+
        public static GridData grabWidth(int horizontalAlignment, int verticalAlignment) {
                return new GridData(horizontalAlignment, horizontalAlignment, true, false);
        }
 
+       public static GridData fillHeight() {
+               return grabHeight(SWT.FILL, SWT.FILL);
+       }
+
+       public static GridData grabHeight(int horizontalAlignment, int verticalAlignment) {
+               return new GridData(horizontalAlignment, horizontalAlignment, false, true);
+       }
+
        public static RowData rowData16px() {
                return new RowData(16, 16);
        }
@@ -124,6 +132,12 @@ public class CmsUiUtils implements CmsConstants {
                return widget;
        }
 
+       /** Style widget */
+       public static <T extends Widget> T style(T widget, CmsStyle style) {
+               widget.setData(CmsConstants.STYLE, style.toStyleClass());
+               return widget;
+       }
+
        /** Enable markups on widget */
        public static <T extends Widget> T markup(T widget) {
                widget.setData(CmsConstants.MARKUP, true);