@@ -43,9 +43,11 @@ public class ComputedDecimal
4343 private int precision ;
4444 private int scale ;
4545 private String fieldlabel ;
46+ private int priority ;
4647
48+
4749 /**
48- * creates a computed decimal field with a formatter
50+ * creates a computed decimal field with a formatter with default priority for display
4951 *
5052 * @param name name of the field (should be valid java attribute
5153 * name)
@@ -66,12 +68,40 @@ public ComputedDecimal(
6668 int scale ,
6769 FormulaDefinitionElement formula ,
6870 DecimalFormatter decimalformatter ) {
71+ this (name ,fieldlabel ,precision ,scale ,formula ,decimalformatter ,100 );
72+ }
73+
74+ /**
75+ * creates a computed decimal field with a formatter
76+ *
77+ * @param name name of the field (should be valid java attribute
78+ * name)
79+ * @param fieldlabel label in default language
80+ *
81+ * @param precision (digits to the right of decimal point (e.g. 533.33
82+ * has precision on 2)
83+ * @param scale total number of digits of the number (e.g. 533.33 is
84+ * 5 digits)
85+ * @param formula formula to calculate the field value
86+ * @param decimalformatter formatter for the field (if graphical display is
87+ * expected)
88+ * @param priority priority for the field display
89+ */
90+ public ComputedDecimal (
91+ String name ,
92+ String fieldlabel ,
93+ int precision ,
94+ int scale ,
95+ FormulaDefinitionElement formula ,
96+ DecimalFormatter decimalformatter ,
97+ int priority ) {
6998 super (name , "COMPUTEDDECIMAL" );
7099 this .formula = formula ;
71100 this .decimalformatter = decimalformatter ;
72101 this .precision = precision ;
73102 this .scale = scale ;
74103 this .fieldlabel = fieldlabel ;
104+ this .priority = priority ;
75105 }
76106
77107 @ Override
@@ -88,7 +118,7 @@ public void controlAfterParentDefinition() {
88118 this .setExtraAttributes (",\" " + fieldlabel .replace ("\" " , "\\ \" " ) + "\" ," + precision + "," + scale
89119 + ",new Formula(" + StringFormatter .formatForJavaClass (parent .getName ()) + ".getComputeddecimalfor"
90120 + this .getInstancename ().toLowerCase () + "Extractor()," + formula .generateFormulaElement () + "),"
91- + (decimalformatter != null ? decimalformatter .generateDefinition () : "null" ));
121+ + (decimalformatter != null ? decimalformatter .generateDefinition () : "null" )+ "," + priority );
92122 alltriggers = new ArrayList <CalculatedFieldTriggerPath >();
93123 formula .setTriggersOnSourceFields (new CalculatedFieldTriggerPath (this ));
94124
@@ -97,15 +127,14 @@ public void controlAfterParentDefinition() {
97127 /**
98128 * creates a computed decimal field without a formatter
99129 *
100- * @param name name of the field (should be valid java attribute
101- * name)
102- * @param fieldlabel label in default language
130+ * @param name name of the field (should be valid java attribute name)
131+ * @param fieldlabel label in default language
103132 *
104- * @param precision (digits to the right of decimal point (e.g. 533.33
105- * has precision on 2)
106- * @param scale total number of digits of the number (e.g. 533.33 is
107- * 5 digits)
108- * @param formula formula to calculate the field value
133+ * @param precision (digits to the right of decimal point (e.g. 533.33 has
134+ * precision on 2)
135+ * @param scale total number of digits of the number (e.g. 533.33 is 5
136+ * digits)
137+ * @param formula formula to calculate the field value
109138 */
110139 public ComputedDecimal (String name , String fieldlabel , int precision , int scale , FormulaDefinitionElement formula ) {
111140 this (name , fieldlabel , precision , scale , formula , null );
0 commit comments