1 |
|
package org.kuali.student.lum.program.client.widgets; |
2 |
|
|
3 |
|
import com.google.gwt.event.dom.client.ClickEvent; |
4 |
|
import com.google.gwt.event.dom.client.ClickHandler; |
5 |
|
import com.google.gwt.event.shared.HandlerManager; |
6 |
|
import com.google.gwt.user.client.ui.Composite; |
7 |
|
import com.google.gwt.user.client.ui.FlowPanel; |
8 |
|
import org.kuali.student.common.ui.client.widgets.KSButton; |
9 |
|
import org.kuali.student.common.ui.client.widgets.KSButtonAbstract; |
10 |
|
import org.kuali.student.common.ui.client.widgets.KSLabel; |
11 |
|
import org.kuali.student.lum.program.client.events.ChangeViewEvent; |
12 |
|
import org.kuali.student.lum.program.client.properties.ProgramProperties; |
13 |
|
|
14 |
|
|
15 |
|
@author |
16 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 5 |
Complexity Density: 0.36 |
|
17 |
|
public class EditableHeader extends Composite { |
18 |
|
|
19 |
|
private FlowPanel content = new FlowPanel(); |
20 |
|
|
21 |
|
private KSLabel sectionTitle; |
22 |
|
|
23 |
|
private KSButton editButton = new KSButton(ProgramProperties.get().common_edit(), KSButtonAbstract.ButtonStyle.DEFAULT_ANCHOR); |
24 |
|
|
25 |
|
private Enum<?> viewToken; |
26 |
|
|
27 |
|
private HandlerManager eventBus; |
28 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
29 |
0
|
public EditableHeader(String title, Enum<?> viewToken, HandlerManager eventBus) {... |
30 |
0
|
initWidget(content); |
31 |
0
|
this.eventBus = eventBus; |
32 |
0
|
this.viewToken = viewToken; |
33 |
0
|
sectionTitle = new KSLabel(title); |
34 |
0
|
buildLayout(); |
35 |
0
|
setStyles(); |
36 |
0
|
bind(); |
37 |
|
} |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
0
|
private void bind() {... |
40 |
0
|
editButton.addClickHandler(new ClickHandler() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
0
|
@Override... |
42 |
|
public void onClick(ClickEvent event) { |
43 |
0
|
eventBus.fireEvent(new ChangeViewEvent(viewToken)); |
44 |
|
} |
45 |
|
}); |
46 |
|
} |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
48 |
0
|
private void setStyles() {... |
49 |
0
|
sectionTitle.addStyleName("sectionTitle"); |
50 |
0
|
content.addStyleName("editableHeader"); |
51 |
0
|
editButton.addStyleName("sectionEditLink"); |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
54 |
0
|
private void buildLayout() {... |
55 |
0
|
content.add(sectionTitle); |
56 |
0
|
content.add(editButton); |
57 |
|
} |
58 |
|
} |