X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Futil%2FCmsUiUtils.java;h=6b411cc302eb994676423a873003e22141dc3dce;hb=fb3182380d9688998a81d853a4eebcf87b6a48c7;hp=4e5572dbde6f19cf9bb9e84f683b45bd9100ac73;hpb=b94bc29e6cb5aa29283a380fdc775ecded7f5734;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/util/CmsUiUtils.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/util/CmsUiUtils.java index 4e5572dbd..6b411cc30 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/util/CmsUiUtils.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/util/CmsUiUtils.java @@ -16,6 +16,7 @@ import org.argeo.api.NodeUtils; 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; @@ -163,7 +164,7 @@ public class CmsUiUtils implements CmsConstants { * 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); @@ -180,9 +181,10 @@ public class CmsUiUtils implements CmsConstants { public static T style(T widget, String style) { if (style == null) return widget;// does nothing - widget.setData(CmsConstants.STYLE, style); - if (widget instanceof Control) - CmsView.getCmsView(((Control) widget).getParent()).applyStyles(widget); + EclipseUiSpecificUtils.setStyleData(widget, style); + if (widget instanceof Control) { + CmsView.getCmsView((Control) widget).applyStyles(widget); + } return widget; } @@ -193,8 +195,7 @@ public class CmsUiUtils implements CmsConstants { /** Enable markups on widget */ public static T markup(T widget) { - if (CmsConstants.MARKUP != null) - widget.setData(CmsConstants.MARKUP, true); + EclipseUiSpecificUtils.setMarkupData(widget); return widget; } @@ -276,6 +277,11 @@ public class CmsUiUtils implements CmsConstants { } // IMAGES + public static String img(Node fileNode, String width, String height) { + String src = NodeUtils.getDataPath(fileNode); + return imgBuilder(src, width, height).append("/>").toString(); + } + public static String img(String src, String width, String height) { return imgBuilder(src, width, height).append("/>").toString(); }