X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2FEclipseUiUtils.java;h=fad0e0df9910208a0ad1599a85e6459c6334a3bd;hb=61780b581925666edd4bd7743a00dca7170f1d35;hp=36b8e345976c703297c4ed3984c511e590ff231a;hpb=a1d862e4ef6221ebc91fcccea688d66504020365;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/EclipseUiUtils.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/EclipseUiUtils.java index 36b8e3459..fad0e0df9 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/EclipseUiUtils.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/EclipseUiUtils.java @@ -66,7 +66,7 @@ public class EclipseUiUtils { .setStyle(SWT.BOLD | SWT.ITALIC) .createFont(parent.getDisplay()); } - + // // Simplify grid layouts management // @@ -176,6 +176,15 @@ public class EclipseUiUtils { * Create a label and a text field with password display for a grid layout, * the text field grabbing excess horizontal */ + public static Text createGridLP(Composite parent, String label) { + return createGridLP(parent, label, null); + } + + /** + * Create a label and a text field with password display for a grid layout, + * the text field grabbing excess horizontal. The given modify listener will + * be added to the newly created text field if not null. + */ public static Text createGridLP(Composite parent, String label, ModifyListener modifyListener) { Label lbl = new Label(parent, SWT.LEAD); @@ -188,4 +197,15 @@ public class EclipseUiUtils { return txt; } + // MISCELLANEOUS + + /** Simply checks if a string is not null nor empty */ + public static boolean notEmpty(String stringToTest) { + return !(stringToTest == null || "".equals(stringToTest.trim())); + } + + /** Simply checks if a string is null or empty */ + public static boolean isEmpty(String stringToTest) { + return stringToTest == null || "".equals(stringToTest.trim()); + } } \ No newline at end of file