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 |
|
import org.kuali.student.common.ui.client.widgets.KSButton; |
19 |
|
import org.kuali.student.common.ui.client.widgets.KSButtonAbstract.ButtonStyle; |
20 |
|
|
21 |
|
import com.google.gwt.event.dom.client.ClickEvent; |
22 |
|
import com.google.gwt.event.dom.client.ClickHandler; |
23 |
|
import com.google.gwt.user.client.ui.Widget; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
@author |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@deprecated |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 11 |
Complexity Density: 0.58 |
|
35 |
|
public abstract class UpdatableMultiplicityComposite extends MultiplicityComposite { |
36 |
|
protected String addItemLabel; |
37 |
|
protected String itemLabel; |
38 |
|
protected boolean readOnly = false; |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
0
|
public UpdatableMultiplicityComposite(StyleType style){... |
41 |
0
|
super(style); |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
44 |
0
|
public UpdatableMultiplicityComposite(StyleType style, boolean readOnly){... |
45 |
0
|
super(style); |
46 |
0
|
this.readOnly=readOnly; |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
@see |
51 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
52 |
0
|
@Override... |
53 |
|
public MultiplicityItem getItemDecorator(StyleType style) { |
54 |
0
|
org.kuali.student.common.ui.client.configurable.mvc.sections.RemovableItemWithHeader item = new org.kuali.student.common.ui.client.configurable.mvc.sections.RemovableItemWithHeader(style, readOnly); |
55 |
0
|
item.setItemLabel(itemLabel + " " + itemCount); |
56 |
0
|
return item; |
57 |
|
} |
58 |
|
|
59 |
|
|
60 |
|
@see |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
62 |
0
|
public Widget generateAddWidget() {... |
63 |
|
|
64 |
0
|
if(readOnly){ |
65 |
0
|
return null; |
66 |
|
} |
67 |
|
|
68 |
0
|
KSButton addWidget; |
69 |
0
|
if(style == StyleType.TOP_LEVEL){ |
70 |
0
|
addWidget = new KSButton(addItemLabel, ButtonStyle.FORM_LARGE); |
71 |
|
} |
72 |
|
else{ |
73 |
0
|
addWidget = new KSButton(addItemLabel, ButtonStyle.FORM_SMALL); |
74 |
|
} |
75 |
0
|
addWidget.addClickHandler(new ClickHandler(){ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
0
|
public void onClick(ClickEvent event) {... |
77 |
0
|
addItem(); |
78 |
|
} |
79 |
|
}); |
80 |
0
|
return addWidget; |
81 |
|
} |
82 |
|
|
83 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
0
|
public String getAddItemLabel() {... |
85 |
0
|
return addItemLabel; |
86 |
|
} |
87 |
|
|
88 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
0
|
public void setAddItemLabel(String addItemLabel) {... |
90 |
0
|
this.addItemLabel = addItemLabel; |
91 |
|
} |
92 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
0
|
public String getItemLabel() {... |
94 |
0
|
return itemLabel; |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
97 |
0
|
public void setItemLabel(String itemLabel) {... |
98 |
0
|
this.itemLabel = itemLabel; |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
} |