.setStyle(SWT.BOLD | SWT.ITALIC)
.createFont(parent.getDisplay());
}
-
+
//
// Simplify grid layouts management
//
* 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);
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