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