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;
/** Static utilities for the CMS framework. */
public class CmsUtils implements CmsConstants {
- /** The CMS view related to this display. */
+ /**
+ * The CMS view related to this display, or null if none is available from
+ * this call.
+ */
public static CmsView getCmsView() {
- Display display = Display.getCurrent();
- if (display == null)
- throw new CmsException("No display available");
- CmsView cmsView = (CmsView) display.getData(CmsView.KEY);
- if (cmsView == null)
- throw new CmsException("No CMS view available");
- return cmsView;
+ return UiContext.getData(CmsView.KEY);
}
/** @deprecated Use rowData16px() instead. GridData should not be reused. */