import org.apache.commons.io.IOUtils;
import org.argeo.cms.CmsConstants;
import org.argeo.cms.CmsException;
+import org.argeo.cms.CmsView;
+import org.argeo.eclipse.ui.specific.UiContext;
import org.argeo.jcr.JcrUtils;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.service.ResourceManager;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Widget;
/** Static utilities for the CMS framework. */
public class CmsUtils implements CmsConstants {
+ /**
+ * The CMS view related to this display, or null if none is available from
+ * this call.
+ */
+ public static CmsView getCmsView() {
+ return UiContext.getData(CmsView.KEY);
+ }
+
/** @deprecated Use rowData16px() instead. GridData should not be reused. */
@Deprecated
public static RowData ROW_DATA_16px = new RowData(16, 16);
return new RowData(16, 16);
}
+ /** Style widget */
public static void style(Widget widget, String style) {
widget.setData(CmsConstants.STYLE, style);
}
+ /** Enable markups on widget */
public static void markup(Widget widget) {
widget.setData(CmsConstants.MARKUP, true);
}
+ public static void setItemHeight(Table table, int height) {
+ table.setData(CmsConstants.ITEM_HEIGHT, height);
+ }
+
/** @return the path or null if not instrumented */
public static String getDataPath(Widget widget) {
// JCR item