import org.argeo.cms.CmsException;
import org.argeo.cms.ui.CmsConstants;
import org.argeo.cms.ui.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;
/**
* The CMS view related to this display, or null if none is available from this
* call.
+ *
+ * @deprecated Use {@link CmsView#getCmsView(Composite)} instead.
*/
+ @Deprecated
public static CmsView getCmsView() {
- return UiContext.getData(CmsView.KEY);
+// return UiContext.getData(CmsView.class.getName());
+ return CmsView.getCmsView(Display.getCurrent().getActiveShell());
}
public static StringBuilder getServerBaseUrl(HttpServletRequest request) {
}
public static GridData fillHeight() {
- return grabWidth(SWT.FILL, SWT.FILL);
+ return grabHeight(SWT.FILL, SWT.FILL);
}
public static GridData grabHeight(int horizontalAlignment, int verticalAlignment) {
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);