svn commit: r1169891 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1169891 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

jleroux@apache.org
Author: jleroux
Date: Mon Sep 12 19:35:20 2011
New Revision: 1169891

URL: http://svn.apache.org/viewvc?rev=1169891&view=rev
Log:
Related to the recent UtilValidate.is(Not)Empty() effort. This part is OK and I prefer this style, easier to read and check (sorry not for the 1st review). I will continue on the rest, if I don't read myself blind on it...

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1169891&r1=1169890&r2=1169891&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Mon Sep 12 19:35:20 2011
@@ -264,65 +264,32 @@ public class ModelFormField {
         if (overrideFormField == null)
             return;
         // incorporate updates for values that are not empty in the overrideFormField
-        if (UtilValidate.isNotEmpty(overrideFormField.name))
-            this.name = overrideFormField.name;
-        if (overrideFormField.mapAcsr != null && !overrideFormField.mapAcsr.isEmpty()) {
-            //Debug.logInfo("overriding mapAcsr, old=" + (this.mapAcsr==null?"null":this.mapAcsr.getOriginalName()) + ", new=" + overrideFormField.mapAcsr.getOriginalName(), module);
-            this.mapAcsr = overrideFormField.mapAcsr;
-        }
-        if (UtilValidate.isNotEmpty(overrideFormField.entityName))
-            this.entityName = overrideFormField.entityName;
-        if (UtilValidate.isNotEmpty(overrideFormField.serviceName))
-            this.serviceName = overrideFormField.serviceName;
-        if (overrideFormField.entryAcsr != null && !overrideFormField.entryAcsr.isEmpty())
-            this.entryAcsr = overrideFormField.entryAcsr;
-        if (UtilValidate.isNotEmpty(overrideFormField.parameterName))
-            this.parameterName = overrideFormField.parameterName;
-        if (UtilValidate.isNotEmpty(overrideFormField.fieldName))
-            this.fieldName = overrideFormField.fieldName;
-        if (UtilValidate.isNotEmpty(overrideFormField.attributeName))
-            this.attributeName = overrideFormField.attributeName;
-        if (overrideFormField.title != null && !overrideFormField.title.isEmpty()) // title="" can be used to override the original value
-            this.title = overrideFormField.title;
-        if (overrideFormField.tooltip != null && !overrideFormField.tooltip.isEmpty())
-            this.tooltip = overrideFormField.tooltip;
-        if (overrideFormField.requiredField != null)
-            this.requiredField = overrideFormField.requiredField;
-        if (overrideFormField.sortField != null)
-            this.sortField = overrideFormField.sortField;
-        if (UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle))
-            this.titleAreaStyle = overrideFormField.titleAreaStyle;
-        if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle))
-            this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
-        if (UtilValidate.isNotEmpty(overrideFormField.titleStyle))
-            this.titleStyle = overrideFormField.titleStyle;
-        if (UtilValidate.isNotEmpty(overrideFormField.widgetStyle))
-            this.widgetStyle = overrideFormField.widgetStyle;
-        if (overrideFormField.position != null)
-            this.position = overrideFormField.position;
-        if (UtilValidate.isNotEmpty(overrideFormField.redWhen))
-            this.redWhen = overrideFormField.redWhen;
-        if (UtilValidate.isNotEmpty(overrideFormField.event))
-            this.event = overrideFormField.event;
-        if (overrideFormField.action != null && !overrideFormField.action.isEmpty())
-            this.action = overrideFormField.action;
-        if (overrideFormField.useWhen != null && !overrideFormField.useWhen.isEmpty())
-            this.useWhen = overrideFormField.useWhen;
-        if (overrideFormField.fieldInfo != null) {
-            this.setFieldInfo(overrideFormField.fieldInfo);
-        }
-        if (overrideFormField.fieldInfo != null) {
-            this.setHeaderLink(overrideFormField.headerLink);
-        }
-        if (UtilValidate.isNotEmpty(overrideFormField.idName)) {
-            this.idName = overrideFormField.idName;
-        }
-        if (overrideFormField.onChangeUpdateAreas != null) {
-            this.onChangeUpdateAreas = overrideFormField.onChangeUpdateAreas;
-        }
-        if (overrideFormField.onClickUpdateAreas != null) {
-            this.onClickUpdateAreas = overrideFormField.onClickUpdateAreas;
-        }
+        if (UtilValidate.isNotEmpty(overrideFormField.name)) this.name = overrideFormField.name;
+        if (UtilValidate.isNotEmpty(overrideFormField.mapAcsr)) this.mapAcsr = overrideFormField.mapAcsr; //Debug.logInfo("overriding mapAcsr, old=" + (this.mapAcsr==null?"null":this.mapAcsr.getOriginalName()) + ", new=" + overrideFormField.mapAcsr.getOriginalName(), module);
+        if (UtilValidate.isNotEmpty(overrideFormField.entityName)) this.entityName = overrideFormField.entityName;
+        if (UtilValidate.isNotEmpty(overrideFormField.serviceName)) this.serviceName = overrideFormField.serviceName;
+        if (UtilValidate.isNotEmpty(overrideFormField.entryAcsr)) this.entryAcsr = overrideFormField.entryAcsr;
+        if (UtilValidate.isNotEmpty(overrideFormField.parameterName)) this.parameterName = overrideFormField.parameterName;
+        if (UtilValidate.isNotEmpty(overrideFormField.fieldName)) this.fieldName = overrideFormField.fieldName;
+        if (UtilValidate.isNotEmpty(overrideFormField.attributeName)) this.attributeName = overrideFormField.attributeName;
+        if (UtilValidate.isNotEmpty(overrideFormField.title)) this.title = overrideFormField.title; // title="" can be used to override the original value
+        if (UtilValidate.isNotEmpty(overrideFormField.tooltip)) this.tooltip = overrideFormField.tooltip;
+        if (overrideFormField.requiredField != null) this.requiredField = overrideFormField.requiredField;
+        if (overrideFormField.sortField != null) this.sortField = overrideFormField.sortField;
+        if (UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle)) this.titleAreaStyle = overrideFormField.titleAreaStyle;
+        if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle)) this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
+        if (UtilValidate.isNotEmpty(overrideFormField.titleStyle)) this.titleStyle = overrideFormField.titleStyle;
+        if (UtilValidate.isNotEmpty(overrideFormField.widgetStyle)) this.widgetStyle = overrideFormField.widgetStyle;
+        if (overrideFormField.position != null) this.position = overrideFormField.position;
+        if (UtilValidate.isNotEmpty(overrideFormField.redWhen)) this.redWhen = overrideFormField.redWhen;
+        if (UtilValidate.isNotEmpty(overrideFormField.event)) this.event = overrideFormField.event;
+        if (UtilValidate.isNotEmpty(overrideFormField.action)) this.action = overrideFormField.action;
+        if (UtilValidate.isNotEmpty(overrideFormField.useWhen))this.useWhen = overrideFormField.useWhen;
+        if (overrideFormField.fieldInfo != null) this.setFieldInfo(overrideFormField.fieldInfo);
+        if (overrideFormField.headerLink != null) this.setHeaderLink(overrideFormField.headerLink);
+        if (UtilValidate.isNotEmpty(overrideFormField.idName)) this.idName = overrideFormField.idName;
+        if (overrideFormField.onChangeUpdateAreas != null) this.onChangeUpdateAreas = overrideFormField.onChangeUpdateAreas;
+        if (overrideFormField.onClickUpdateAreas != null) this.onClickUpdateAreas = overrideFormField.onClickUpdateAreas;
         this.encodeOutput = overrideFormField.encodeOutput;
     }