1 | |
package org.kuali.student.common.ui.client.widgets.table.summary; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.Iterator; |
5 | |
import java.util.List; |
6 | |
import java.util.Map; |
7 | |
|
8 | |
import org.kuali.student.common.assembly.data.Data; |
9 | |
import org.kuali.student.common.assembly.data.MetadataInterrogator; |
10 | |
import org.kuali.student.common.assembly.data.QueryPath; |
11 | |
import org.kuali.student.common.assembly.data.Data.Property; |
12 | |
import org.kuali.student.common.ui.client.application.Application; |
13 | |
import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor; |
14 | |
import org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptorReadOnly; |
15 | |
import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; |
16 | |
import org.kuali.student.common.ui.client.configurable.mvc.binding.ModelWidgetBinding; |
17 | |
import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityConfiguration; |
18 | |
import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityFieldConfiguration; |
19 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.Section; |
20 | |
import org.kuali.student.common.ui.client.configurable.mvc.sections.VerticalSection; |
21 | |
import org.kuali.student.common.ui.client.mvc.Controller; |
22 | |
import org.kuali.student.common.ui.client.mvc.DataModel; |
23 | |
import org.kuali.student.common.ui.client.mvc.ModelRequestCallback; |
24 | |
import org.kuali.student.common.validation.dto.ValidationResultInfo; |
25 | |
import org.kuali.student.common.validation.dto.ValidationResultInfo.ErrorLevel; |
26 | |
|
27 | |
import com.google.gwt.core.client.GWT; |
28 | |
import com.google.gwt.user.client.ui.Widget; |
29 | |
|
30 | 0 | public class SummaryTableSection extends VerticalSection { |
31 | 0 | SummaryTable summaryTable = new SummaryTable(); |
32 | 0 | SummaryTableModel summaryTableModel = new SummaryTableModel(); |
33 | |
Controller controller; |
34 | 0 | DataModel comparisonModel = null; |
35 | 0 | List<ShowRowConditionCallback> showRowCallbacks = new ArrayList<ShowRowConditionCallback>(); |
36 | 0 | boolean isMissingFields= false; |
37 | 0 | boolean hasWarnings= false; |
38 | |
|
39 | |
public boolean getIsMissingFields() { |
40 | 0 | return isMissingFields; |
41 | |
} |
42 | |
|
43 | |
public boolean getHasWarnings(){ |
44 | 0 | return hasWarnings; |
45 | |
} |
46 | |
|
47 | |
public SummaryTableSection(Controller controller) { |
48 | 0 | super(); |
49 | 0 | this.controller = controller; |
50 | 0 | this.addWidget(summaryTable); |
51 | 0 | summaryTable.setModel(summaryTableModel); |
52 | 0 | } |
53 | |
|
54 | |
public SummaryTableSection(Controller controller, SectionTitle title) { |
55 | 0 | super(title); |
56 | 0 | this.controller = controller; |
57 | 0 | this.addWidget(summaryTable); |
58 | 0 | summaryTable.setModel(summaryTableModel); |
59 | 0 | } |
60 | |
|
61 | |
public void setContentColumnHeader1(String title) { |
62 | 0 | summaryTableModel.setContentColumnHeader1(title); |
63 | 0 | } |
64 | |
|
65 | |
public void setContentColumnHeader2(String title) { |
66 | 0 | summaryTableModel.setContentColumnHeader2(title); |
67 | 0 | } |
68 | |
|
69 | |
public String getContentColumnHeader1() { |
70 | 0 | return summaryTableModel.getContentColumnHeader1(); |
71 | |
} |
72 | |
|
73 | |
public String getContentColumnHeader2() { |
74 | 0 | return summaryTableModel.getContentColumnHeader2(); |
75 | |
} |
76 | |
|
77 | |
public void setEditable(boolean bool) { |
78 | 0 | summaryTableModel.setEditable(bool); |
79 | 0 | summaryTable.doLayout(); |
80 | 0 | summaryTable.markDiffs("rowDiffHighlight"); |
81 | 0 | } |
82 | |
|
83 | |
public void addShowRowCallback(ShowRowConditionCallback callback){ |
84 | 0 | this.showRowCallbacks.add(callback); |
85 | 0 | } |
86 | |
|
87 | |
private void processShowConditions(SummaryTableFieldRow row, DataModel model, DataModel comparisonModel){ |
88 | 0 | for(int i =0; i < showRowCallbacks.size(); i++){ |
89 | 0 | showRowCallbacks.get(i).processShowConditions(row, model, comparisonModel); |
90 | |
} |
91 | 0 | } |
92 | |
|
93 | |
public void addSummaryTableFieldBlock(SummaryTableFieldBlock section) { |
94 | 0 | summaryTableModel.addSection(section); |
95 | 0 | } |
96 | |
|
97 | |
@Override |
98 | |
public ErrorLevel processValidationResults(List<ValidationResultInfo> results) { |
99 | |
|
100 | |
|
101 | 0 | ErrorLevel status= ErrorLevel.OK; |
102 | 0 | isMissingFields= false; |
103 | 0 | hasWarnings= false; |
104 | |
|
105 | 0 | for(int i = 0; i < results.size(); i++){ |
106 | |
|
107 | 0 | if(summaryTable.containsKey(results.get(i).getElement())){ |
108 | |
|
109 | 0 | System.out.println(results.get(i).getElement() + " *** " + results.get(i).getErrorLevel() + " *** " + results.get(i).getMessage()); |
110 | 0 | if(results.get(i).getLevel().getLevel() > status.getLevel()){ |
111 | |
|
112 | 0 | status= results.get(i).getLevel(); |
113 | |
|
114 | 0 | if(results.get(i).getMessage().equals("Required")){ |
115 | 0 | isMissingFields= true; |
116 | |
} |
117 | |
} |
118 | |
|
119 | 0 | if(this.isValidationEnabled){ |
120 | 0 | summaryTable.highlightRow(results.get(i).getElement(), "rowHighlight"); |
121 | |
} |
122 | |
} |
123 | |
} |
124 | |
|
125 | 0 | List<ValidationResultInfo> warnings= Application.getApplicationContext().getValidationWarnings(); |
126 | 0 | ValidationResultInfo tempVr= new ValidationResultInfo(); |
127 | |
|
128 | 0 | tempVr.setElement(""); |
129 | 0 | for(int i = 0; i < warnings.size(); i++){ |
130 | |
|
131 | |
|
132 | 0 | String element= warnings.get(i).getElement(); |
133 | 0 | if (element.startsWith("/")){ |
134 | |
|
135 | 0 | element= element.substring(1); |
136 | |
|
137 | 0 | } else if (element.matches(".*/[0-9]+")){ |
138 | |
|
139 | |
|
140 | 0 | element= element.substring(0, element.lastIndexOf("/")); |
141 | |
} |
142 | |
|
143 | 0 | if(summaryTable.containsKey(element)){ |
144 | |
|
145 | 0 | hasWarnings= true; |
146 | 0 | if(warnings.get(i).getLevel().getLevel() > status.getLevel()){ |
147 | 0 | status= warnings.get(i).getLevel(); |
148 | |
} |
149 | |
|
150 | 0 | summaryTable.highlightRow(element, "warning"); |
151 | |
} |
152 | |
} |
153 | |
|
154 | 0 | return status; |
155 | |
} |
156 | |
|
157 | |
@Override |
158 | |
public ErrorLevel processValidationResults(List<ValidationResultInfo> results, boolean clearErrors) { |
159 | 0 | if(clearErrors){ |
160 | 0 | this.removeValidationHighlighting(); |
161 | |
} |
162 | 0 | return this.processValidationResults(results); |
163 | |
} |
164 | |
|
165 | |
public void removeValidationHighlighting(){ |
166 | 0 | summaryTable.clearHighlightedRows("rowHighlight"); |
167 | 0 | } |
168 | |
|
169 | |
private int buildMultiplicityRows(DataModel model, DataModel compModel, SummaryTableMultiplicityFieldRow parentRow, |
170 | |
List<SummaryTableRow> rowList, int styleLevel, Integer parentNum){ |
171 | 0 | MultiplicityConfiguration config = parentRow.getConfig(); |
172 | 0 | int index = rowList.indexOf(parentRow) + 1; |
173 | 0 | int fieldRowsCreated = 0; |
174 | 0 | int number = 0; |
175 | 0 | String path = parentRow.getConfig().getParentFd().getFieldKey(); |
176 | 0 | if(parentNum != null){ |
177 | 0 | path = path.replace("*", "" + parentNum); |
178 | |
} |
179 | 0 | Data data = null; |
180 | 0 | if(model != null && model.isValidPath(path)){ |
181 | 0 | data = model.get(QueryPath.parse(path)); |
182 | |
} |
183 | 0 | Data compData = null; |
184 | 0 | if(compModel != null && compModel.isValidPath(path)){ |
185 | 0 | compData = compModel.get(QueryPath.parse(path)); |
186 | |
} |
187 | 0 | if((data != null && data.size() > 0) || (compData != null && compData.size() > 0)){ |
188 | 0 | Iterator<Property> itr = null; |
189 | 0 | if(data != null && compData != null){ |
190 | 0 | if(data.size() >= compData.size()){ |
191 | 0 | itr = data.iterator(); |
192 | |
} else{ |
193 | 0 | itr = compData.iterator(); |
194 | |
} |
195 | 0 | } else if(data != null){ |
196 | 0 | itr = data.iterator(); |
197 | |
} else{ |
198 | 0 | itr = compData.iterator(); |
199 | |
} |
200 | 0 | SummaryTableMultiplicityFieldRow currentMultiplicityRow = parentRow; |
201 | 0 | while (itr.hasNext()) { |
202 | 0 | Property p = (Property) itr.next(); |
203 | 0 | if (p.getKey() instanceof Integer){ |
204 | 0 | number = (Integer)p.getKey(); |
205 | |
} |
206 | 0 | if(config.getItemLabel() != null && !config.getItemLabel().isEmpty()){ |
207 | 0 | currentMultiplicityRow.setTitle(config.getItemLabel() + " "+ (number + 1)); |
208 | 0 | currentMultiplicityRow.setKey(path); |
209 | 0 | if(MetadataInterrogator.isRequired(config.getMetaData()) || |
210 | |
MetadataInterrogator.isRequiredForNextState(config.getMetaData())){ |
211 | 0 | currentMultiplicityRow.setRequired(true); |
212 | |
} |
213 | 0 | currentMultiplicityRow.addTitleCellStyleName("summary-table-multiplicity-level-" + styleLevel); |
214 | |
} |
215 | |
else{ |
216 | 0 | currentMultiplicityRow.setShown(false); |
217 | |
} |
218 | |
|
219 | 0 | Map<Integer, List<MultiplicityFieldConfiguration>> fieldsCopy = config.getFields(); |
220 | 0 | for(int i = 0; i < config.getFields().size(); i++){ |
221 | 0 | for(int j = 0; j < config.getFields().get(i).size(); j++){ |
222 | |
|
223 | 0 | MultiplicityFieldConfiguration field = fieldsCopy.get(i).get(j); |
224 | 0 | String fieldKey = translatePath(field.getFieldPath(), path, number); |
225 | 0 | FieldDescriptorReadOnly fd1 = new FieldDescriptorReadOnly(fieldKey, field.getMessageKeyInfo(), field.getMetadata()); |
226 | 0 | fd1.setOptional(field.isOptional()); |
227 | 0 | if(field.getModelWidgetBinding() != null){ |
228 | 0 | fd1.setWidgetBinding(field.getModelWidgetBinding()); |
229 | |
} |
230 | 0 | FieldDescriptorReadOnly fd2 = new FieldDescriptorReadOnly(fieldKey, field.getMessageKeyInfo(), field.getMetadata()); |
231 | 0 | fd2.setOptional(field.isOptional()); |
232 | 0 | if(field.getModelWidgetBinding() != null){ |
233 | 0 | fd2.setWidgetBinding(field.getModelWidgetBinding()); |
234 | |
} |
235 | 0 | SummaryTableFieldRow row = new SummaryTableFieldRow(fd1, fd2); |
236 | 0 | row.setTemporaryRowFlag(true); |
237 | 0 | rowList.add(index, row); |
238 | 0 | index++; |
239 | 0 | fieldRowsCreated++; |
240 | |
} |
241 | |
} |
242 | 0 | if(config.getNestedConfig() != null){ |
243 | 0 | MultiplicityConfiguration nestedConfig = config.getNestedConfig(); |
244 | 0 | nestedConfig.getParentFd().getFieldKey().replace(config.getParentFd().getFieldKey(), path); |
245 | 0 | SummaryTableMultiplicityFieldRow mRow = new SummaryTableMultiplicityFieldRow(nestedConfig); |
246 | 0 | mRow.setTemporaryRowFlag(true); |
247 | 0 | rowList.add(index, mRow); |
248 | 0 | index++; |
249 | 0 | fieldRowsCreated++; |
250 | 0 | int result = buildMultiplicityRows(model, compModel, mRow, rowList, styleLevel + 1, number); |
251 | 0 | index = index + result; |
252 | |
} |
253 | 0 | if(itr.hasNext()){ |
254 | 0 | SummaryTableMultiplicityFieldRow mRow = new SummaryTableMultiplicityFieldRow(config); |
255 | 0 | mRow.setTemporaryRowFlag(true); |
256 | 0 | rowList.add(index, mRow); |
257 | 0 | index++; |
258 | 0 | fieldRowsCreated++; |
259 | 0 | currentMultiplicityRow = mRow; |
260 | |
} |
261 | 0 | } |
262 | 0 | } |
263 | |
else{ |
264 | 0 | if(MetadataInterrogator.isRequired(config.getMetaData()) || |
265 | |
MetadataInterrogator.isRequiredForNextState(config.getMetaData())){ |
266 | 0 | if(config.getItemLabel() != null && !config.getItemLabel().isEmpty()){ |
267 | 0 | parentRow.setTitle(config.getItemLabel() + " "+ (number + 1)); |
268 | 0 | parentRow.setKey(path); |
269 | 0 | parentRow.setRequired(true); |
270 | 0 | parentRow.addTitleCellStyleName("summary-table-multiplicity-level-" + styleLevel); |
271 | |
} |
272 | |
else{ |
273 | 0 | parentRow.setShown(false); |
274 | |
} |
275 | |
|
276 | 0 | Map<Integer, List<MultiplicityFieldConfiguration>> fields = config.getFields(); |
277 | 0 | for(int i = 0; i < fields.size(); i++){ |
278 | 0 | for(int j = 0; j < fields.get(i).size(); j++){ |
279 | |
|
280 | 0 | MultiplicityFieldConfiguration field = fields.get(i).get(j); |
281 | 0 | String fieldKey = translatePath(field.getFieldPath(), path, number); |
282 | 0 | FieldDescriptorReadOnly fd1 = new FieldDescriptorReadOnly(fieldKey, field.getMessageKeyInfo(), field.getMetadata()); |
283 | 0 | fd1.setOptional(field.isOptional()); |
284 | 0 | if(field.getModelWidgetBinding() != null){ |
285 | 0 | fd1.setWidgetBinding(field.getModelWidgetBinding()); |
286 | |
} |
287 | 0 | FieldDescriptorReadOnly fd2 = new FieldDescriptorReadOnly(fieldKey, field.getMessageKeyInfo(), field.getMetadata()); |
288 | 0 | fd2.setOptional(field.isOptional()); |
289 | 0 | if(field.getModelWidgetBinding() != null){ |
290 | 0 | fd2.setWidgetBinding(field.getModelWidgetBinding()); |
291 | |
} |
292 | 0 | SummaryTableFieldRow row = new SummaryTableFieldRow(fd1, fd2); |
293 | 0 | row.setTemporaryRowFlag(true); |
294 | 0 | rowList.add(index, row); |
295 | 0 | index++; |
296 | 0 | fieldRowsCreated++; |
297 | |
} |
298 | |
} |
299 | 0 | if(config.getNestedConfig() != null){ |
300 | 0 | MultiplicityConfiguration nestedConfig = config.getNestedConfig(); |
301 | 0 | nestedConfig.getParentFd().getFieldKey().replace(config.getParentFd().getFieldKey(), path); |
302 | 0 | SummaryTableMultiplicityFieldRow mRow = new SummaryTableMultiplicityFieldRow(nestedConfig); |
303 | 0 | mRow.setTemporaryRowFlag(true); |
304 | 0 | rowList.add(index, mRow); |
305 | 0 | index++; |
306 | 0 | fieldRowsCreated++; |
307 | 0 | buildMultiplicityRows(null, null, mRow, rowList, styleLevel + 1, number); |
308 | |
} |
309 | 0 | } |
310 | |
else{ |
311 | |
|
312 | 0 | parentRow.setTitle(config.getItemLabel()); |
313 | 0 | parentRow.setRequired(false); |
314 | 0 | parentRow.setKey(config.getParentFd().getFieldKey()); |
315 | |
|
316 | |
} |
317 | |
} |
318 | 0 | return fieldRowsCreated; |
319 | |
} |
320 | |
|
321 | |
public String translatePath(String path, String parentPath, int num) { |
322 | |
String fieldPath; |
323 | 0 | if (parentPath != null) { |
324 | 0 | QueryPath parent = QueryPath.concat(parentPath); |
325 | 0 | int i = parent.size(); |
326 | |
|
327 | 0 | QueryPath subPath = QueryPath.concat(path); |
328 | 0 | String itemPath = subPath.subPath(i, subPath.size()).toString(); |
329 | |
|
330 | 0 | QueryPath qp = QueryPath.concat(parentPath, itemPath); |
331 | 0 | fieldPath = qp.toString(); |
332 | 0 | } |
333 | |
else { |
334 | 0 | fieldPath = path; |
335 | |
} |
336 | |
|
337 | 0 | fieldPath = fieldPath.replace("*", "" + num); |
338 | 0 | return fieldPath; |
339 | |
} |
340 | |
|
341 | |
@Override |
342 | |
public void updateWidgetData(final DataModel model) { |
343 | |
|
344 | 0 | controller.requestModel("ComparisonModel", new ModelRequestCallback<DataModel>() { |
345 | |
@Override |
346 | |
public void onModelReady(DataModel otherModel) { |
347 | 0 | comparisonModel = otherModel; |
348 | 0 | updateTableData(model); |
349 | 0 | } |
350 | |
|
351 | |
@Override |
352 | |
public void onRequestFail(Throwable cause) { |
353 | 0 | comparisonModel = null; |
354 | 0 | updateTableData(model); |
355 | |
|
356 | 0 | } |
357 | |
}); |
358 | 0 | } |
359 | |
|
360 | |
private void resetSummaryTableRows(SummaryTableFieldBlock fieldBlock){ |
361 | 0 | List<SummaryTableRow> rowList = fieldBlock.getSectionRowList(); |
362 | 0 | List<SummaryTableRow> removeList = new ArrayList<SummaryTableRow>(); |
363 | 0 | for (int j = 0; j < rowList.size(); j++) { |
364 | 0 | SummaryTableFieldRow fieldRow = (SummaryTableFieldRow) rowList.get(j); |
365 | 0 | if(fieldRow.isTemporaryRow()){ |
366 | 0 | removeList.add(fieldRow); |
367 | |
} |
368 | 0 | if(!fieldRow.isShown()){ |
369 | 0 | fieldRow.setShown(true); |
370 | |
} |
371 | |
} |
372 | 0 | rowList.removeAll(removeList); |
373 | 0 | } |
374 | |
|
375 | |
private void buildSummaryTableMultiplicity(DataModel model, DataModel compModel, SummaryTableFieldBlock fieldBlock){ |
376 | 0 | List<SummaryTableMultiplicityFieldRow> mRows = fieldBlock.getMultiplicityList(); |
377 | 0 | for(int i = 0; i < mRows.size(); i++){ |
378 | 0 | SummaryTableMultiplicityFieldRow mRow = mRows.get(i); |
379 | |
|
380 | 0 | buildMultiplicityRows(model, compModel, mRow, fieldBlock.getSectionRowList(), 1, null); |
381 | |
} |
382 | 0 | } |
383 | |
|
384 | |
@SuppressWarnings("unchecked") |
385 | |
private void updateTableData(DataModel model){ |
386 | 0 | List<SummaryTableBlock> sectionList = summaryTableModel.getSectionList(); |
387 | 0 | for (int i = 0; i < sectionList.size(); i++) { |
388 | 0 | SummaryTableFieldBlock fieldBlock = (SummaryTableFieldBlock) sectionList.get(i); |
389 | 0 | resetSummaryTableRows(fieldBlock); |
390 | 0 | if(!fieldBlock.getMultiplicityList().isEmpty()){ |
391 | 0 | buildSummaryTableMultiplicity(model, comparisonModel, fieldBlock); |
392 | |
} |
393 | 0 | List<SummaryTableRow> rowList = fieldBlock.getSectionRowList(); |
394 | |
|
395 | 0 | for (int j = 0; j < rowList.size(); j++) { |
396 | 0 | SummaryTableFieldRow fieldRow = (SummaryTableFieldRow) rowList.get(j); |
397 | 0 | FieldDescriptor field = fieldRow.getFieldDescriptor1(); |
398 | 0 | final FieldDescriptor field2 = fieldRow.getFieldDescriptor2(); |
399 | 0 | boolean optional = false; |
400 | 0 | boolean firstValueEmpty = true; |
401 | 0 | boolean secondValueEmpty = true; |
402 | |
|
403 | 0 | if(field != null){ |
404 | |
|
405 | 0 | if(field instanceof FieldDescriptorReadOnly){ |
406 | 0 | optional = ((FieldDescriptorReadOnly)field).isOptional(); |
407 | |
} |
408 | 0 | String fieldPath = QueryPath.getPathSeparator() + field.getFieldKey(); |
409 | 0 | if(model.isValidPath(fieldPath)){ |
410 | |
|
411 | 0 | Object value = model.get(QueryPath.parse(fieldPath)); |
412 | 0 | if(value != null){ |
413 | 0 | if(value instanceof String && ((String)value).isEmpty()){ |
414 | 0 | firstValueEmpty = true; |
415 | |
} |
416 | 0 | else if(value instanceof Data && ((Data) value).size() == 0){ |
417 | 0 | firstValueEmpty = true; |
418 | |
} |
419 | |
else{ |
420 | 0 | firstValueEmpty = false; |
421 | |
} |
422 | |
} |
423 | |
} |
424 | |
|
425 | 0 | ModelWidgetBinding binding = field.getModelWidgetBinding(); |
426 | |
|
427 | 0 | if (binding != null) { |
428 | 0 | Widget w = field.getFieldWidget(); |
429 | 0 | binding.setWidgetValue(w, model, fieldPath); |
430 | 0 | } else { |
431 | 0 | GWT.log(field.getFieldKey() + " has no widget binding.", null); |
432 | |
} |
433 | |
|
434 | |
} |
435 | |
|
436 | |
|
437 | 0 | if (comparisonModel == null) { |
438 | 0 | if(fieldRow.getContentCellCount() == 2){ |
439 | 0 | fieldRow.setContentCellCount(1); |
440 | |
} |
441 | |
}else{ |
442 | 0 | summaryTableModel.setContentColumnHeader1(model.getModelName()); |
443 | 0 | summaryTableModel.setContentColumnHeader2(comparisonModel.getModelName()); |
444 | 0 | if(fieldRow.getContentCellCount() == 1){ |
445 | 0 | fieldRow.setContentCellCount(2); |
446 | |
} |
447 | 0 | if(field2 != null){ |
448 | |
|
449 | 0 | String fieldPath2 = QueryPath.getPathSeparator() + field2.getFieldKey(); |
450 | 0 | if(comparisonModel.isValidPath(fieldPath2)){ |
451 | |
|
452 | 0 | Object value = model.get(QueryPath.parse(fieldPath2)); |
453 | 0 | if(value != null){ |
454 | 0 | if(value instanceof String && ((String)value).isEmpty()){ |
455 | 0 | secondValueEmpty = true; |
456 | |
} |
457 | 0 | else if(value instanceof Data && ((Data) value).size() == 0){ |
458 | 0 | secondValueEmpty = true; |
459 | |
} |
460 | |
else{ |
461 | 0 | secondValueEmpty = false; |
462 | |
} |
463 | |
} |
464 | |
|
465 | 0 | ModelWidgetBinding binding2 = field2.getModelWidgetBinding(); |
466 | |
|
467 | 0 | if (binding2 != null) { |
468 | 0 | Widget w = field2.getFieldWidget(); |
469 | 0 | binding2.setWidgetValue(w, comparisonModel, fieldPath2); |
470 | 0 | } else { |
471 | 0 | GWT.log(field2.getFieldKey() + " has no widget binding for the ComparisonModel.", null); |
472 | |
} |
473 | |
} |
474 | |
} |
475 | |
} |
476 | |
|
477 | 0 | if(firstValueEmpty && secondValueEmpty && optional){ |
478 | 0 | fieldRow.setShown(false); |
479 | |
} |
480 | 0 | processShowConditions(fieldRow, model, comparisonModel); |
481 | |
} |
482 | |
|
483 | |
} |
484 | |
|
485 | 0 | summaryTable.doLayout(); |
486 | 0 | summaryTable.markDiffs("rowDiffHighlight"); |
487 | 0 | } |
488 | |
|
489 | |
@Override |
490 | |
public String addField(FieldDescriptor fieldDescriptor) { |
491 | 0 | GWT.log("addField(FieldDescriptor fieldDescriptor) method not supported"); |
492 | 0 | throw new UnsupportedOperationException("SummaryTableSection.addField(FieldDescriptor fieldDescriptor) method not supported"); |
493 | |
} |
494 | |
|
495 | |
@Override |
496 | |
public String addSection(Section section) { |
497 | 0 | GWT.log("addSection(Section section) method not supported"); |
498 | 0 | throw new UnsupportedOperationException("SummaryTableSection.addSection(Section section) method not supported"); |
499 | |
} |
500 | |
|
501 | |
@Override |
502 | |
public String addSection(String key, Section section) { |
503 | 0 | GWT.log("addSection(String key, Section section) method not supported"); |
504 | 0 | throw new UnsupportedOperationException("SummaryTableSection.addSection(String key, Section section) method not supported"); |
505 | |
} |
506 | |
|
507 | |
public SummaryTable getSummaryTable() { |
508 | 0 | return summaryTable; |
509 | |
} |
510 | |
|
511 | |
} |