summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-08-16 02:00:24 (EDT)
committerSteffen Kriese2011-08-16 02:00:24 (EDT)
commiteb82c0d7b848dfbbcd6acd9824ea74c9301d1215 (patch)
tree8f1cfa3e383ead84ba7564ae722acf620459d71d
parent015432e8c80fda69d21901dddab3488f45f74f4c (diff)
downloadorg.eclipse.riena-eb82c0d7b848dfbbcd6acd9824ea74c9301d1215.zip
org.eclipse.riena-eb82c0d7b848dfbbcd6acd9824ea74c9301d1215.tar.gz
org.eclipse.riena-eb82c0d7b848dfbbcd6acd9824ea74c9301d1215.tar.bz2
Added constructor with message to NotEmptyValidator
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/validation/NotEmpty.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/validation/NotEmpty.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/validation/NotEmpty.java
index 2b78f5b..3219c6e 100644
--- a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/validation/NotEmpty.java
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/validation/NotEmpty.java
@@ -21,11 +21,21 @@ import org.eclipse.riena.ui.ridgets.nls.Messages;
*/
public class NotEmpty implements IValidator {
+ private String message;
+
+ public NotEmpty() {
+ // default constructor
+ }
+
+ public NotEmpty(final String message) {
+ this.message = message;
+ }
+
public IStatus validate(final Object value) {
if (value instanceof String && !Utils.isEmpty((String) value)) {
return ValidationRuleStatus.ok();
}
- return ValidationRuleStatus.error(false, Messages.NotEmpty_error_empty);
+ return ValidationRuleStatus.error(false, null != message ? message : Messages.NotEmpty_error_empty);
}
}