X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.akb.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fakb%2Fui%2FAkbUiUtils.java;h=38ddcbffebbfa9d1a639e57f0b420c042393379c;hb=2f7f9c1e6e66f7cd13f25057e13b47d469f608e6;hp=c79b9378d128da8704865bef9929e35d9d27bc66;hpb=cce1ca8a555b41f6ca0a77ab549a5e1461f2bb15;p=gpl%2Fargeo-slc.git
diff --git a/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/AkbUiUtils.java b/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/AkbUiUtils.java
index c79b9378d..38ddcbffe 100644
--- a/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/AkbUiUtils.java
+++ b/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/AkbUiUtils.java
@@ -51,6 +51,19 @@ public class AkbUiUtils {
text.setEnabled(AkbJcrUtils.isNodeCheckedOutByMe(entity));
return tmpStr;
}
+
+
+ /**
+ * Shortcut to refresh a Text
widget given a Node in a form and
+ * a property Name. Also manages its enable state and set a default message if corresponding Text value is empty
+ */
+ public static String refreshFormTextWidget(Text text, Node entity,
+ String propName, String defaultMsg) {
+ String tmpStr = refreshFormTextWidget(text, entity, propName);
+ if (AkbJcrUtils.isEmptyString(tmpStr) && AkbJcrUtils.checkNotEmptyString(defaultMsg))
+ text.setMessage(defaultMsg);
+ return tmpStr;
+ }
/**
* Shortcut to refresh a Check box Button
widget given a Node