X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Futil%2FCmsUiUtils.java;h=e42894db74ac6aad259d621e6e013e139501a81d;hb=74f72bbc096ebb431686d1e93dd864dd00ab5ca5;hp=8b10ef123a3bb9a62122496bfb848e94bf3ee790;hpb=ecf8ab7382eadecab5a93261f261d0fd2168ffa8;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 8b10ef123..e42894db7 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 @@ -33,6 +33,7 @@ import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.RowData; +import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -150,6 +151,7 @@ public class CmsUiUtils implements CmsConstants { return noSpaceGridLayout(new GridLayout(columns, false)); } + /** @return the same layout, with spaces removed. */ public static GridLayout noSpaceGridLayout(GridLayout layout) { layout.horizontalSpacing = 0; layout.verticalSpacing = 0; @@ -181,6 +183,19 @@ public class CmsUiUtils implements CmsConstants { /* * ROW LAYOUT */ + /** @return the same layout, with margins removed. */ + public static RowLayout noMarginsRowLayout(RowLayout rowLayout) { + rowLayout.marginTop = 0; + rowLayout.marginBottom = 0; + rowLayout.marginLeft = 0; + rowLayout.marginRight = 0; + return rowLayout; + } + + public static RowLayout noMarginsRowLayout(int type) { + return noMarginsRowLayout(new RowLayout(type)); + } + public static RowData rowData16px() { return new RowData(16, 16); } @@ -224,6 +239,12 @@ public class CmsUiUtils implements CmsConstants { return widget; } + /** Disable markup validation. */ + public static T disableMarkupValidation(T widget) { + EclipseUiSpecificUtils.setMarkupValidationDisabledData(widget); + return widget; + } + /** * Apply markup and set text on {@link Label}, {@link Button}, {@link Text}. *