import org.argeo.api.NodeConstants;
import org.argeo.api.NodeUtils;
-import org.argeo.cms.CmsException;
import org.argeo.cms.ui.CmsConstants;
import org.argeo.cms.ui.CmsView;
import org.argeo.eclipse.ui.Selected;
+import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
import org.argeo.jcr.JcrUtils;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.service.ResourceManager;
buf.append(':').append(url.getPort());
return buf;
} catch (MalformedURLException e) {
- throw new CmsException("Cannot extract server base URL from " + request.getRequestURL(), e);
+ throw new IllegalArgumentException("Cannot extract server base URL from " + request.getRequestURL(), e);
}
}
buf.append(getDataPath(node));
return new URL(buf.toString()).toString();
} catch (MalformedURLException e) {
- throw new CmsException("Cannot build data URL for " + node, e);
+ throw new IllegalArgumentException("Cannot build data URL for " + node, e);
}
}
return layout;
}
- public static GridLayout standardSpaceGridLayout(GridLayout layout) {
- layout.horizontalSpacing = 16;
- layout.verticalSpacing = 16;
- layout.marginWidth = 16;
- layout.marginHeight = 16;
- return layout;
- }
-
-
public static GridData fillAll() {
return new GridData(SWT.FILL, SWT.FILL, true, true);
}
* FORM LAYOUT
*/
- public static FormData coversAll() {
+ public static FormData coverAll() {
FormData fdLabel = new FormData();
fdLabel.top = new FormAttachment(0, 0);
fdLabel.left = new FormAttachment(0, 0);
/** Style widget */
public static <T extends Widget> T style(T widget, String style) {
- widget.setData(CmsConstants.STYLE, style);
+ if (style == null)
+ return widget;// does nothing
+ EclipseUiSpecificUtils.setStyleData(widget, style);
+ if (widget instanceof Control) {
+ CmsView.getCmsView((Control) widget).applyStyles(widget);
+ }
return widget;
}
/** Style widget */
public static <T extends Widget> T style(T widget, CmsStyle style) {
- widget.setData(CmsConstants.STYLE, style.toStyleClass());
- return widget;
+ return style(widget, style.toStyleClass());
}
/** Enable markups on widget */
public static <T extends Widget> T markup(T widget) {
- widget.setData(CmsConstants.MARKUP, true);
+ EclipseUiSpecificUtils.setMarkupData(widget);
return widget;
}
return text(new Text(parent, SWT.NONE), txt);
}
+ @Deprecated
public static void setItemHeight(Table table, int height) {
table.setData(CmsConstants.ITEM_HEIGHT, height);
}