1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.ui.client.configurable.mvc.multiplicity;
17
18
19 import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityComposite.StyleType;
20 import org.kuali.student.common.ui.client.widgets.KSLabel;
21
22 import com.google.gwt.user.client.ui.FlowPanel;
23 import com.google.gwt.user.client.ui.Widget;
24
25
26
27
28
29
30
31
32
33
34
35 public class DisplayItem extends MultiplicityItem {
36 private boolean loaded = false;
37 private KSLabel itemLabel;
38
39 protected FlowPanel itemPanel = new FlowPanel();
40
41 public DisplayItem(){
42 initWidget(itemPanel);
43 }
44
45 public DisplayItem(StyleType style){
46 this.initWidget(itemPanel);
47
48 }
49 public void onLoad(){
50 }
51
52
53
54
55 @Override
56 public void clear() {
57 loaded = false;
58 }
59
60
61
62
63 @Override
64 public void redraw() {
65 Widget item = getItemWidget();
66 if (!loaded){
67
68 if (itemLabel != null) {
69 itemPanel.add(itemLabel);
70 itemLabel.addStyleName("KS-Multiplicity-Item-Header");
71 }
72 itemPanel.add(item);
73 itemPanel.addStyleName("KS-Multiplicity-Display-Item");
74 loaded = true;
75 }
76
77
78
79
80 }
81
82
83 public void setItemLabel(String itemLabel) {
84 this.itemLabel = new KSLabel(itemLabel);
85 }
86
87 }