1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ui.client.widgets.buttonlayout; |
17 |
|
|
18 |
|
import org.kuali.student.common.ui.client.widgets.KSButton; |
19 |
|
|
20 |
|
import com.google.gwt.user.client.ui.DockPanel; |
21 |
|
import com.google.gwt.user.client.ui.HasAlignment; |
22 |
|
import com.google.gwt.user.client.ui.HorizontalPanel; |
23 |
|
import com.google.gwt.user.client.ui.SimplePanel; |
24 |
|
import com.google.gwt.user.client.ui.Widget; |
25 |
|
|
|
|
| 0% |
Uncovered Elements: 38 (38) |
Complexity: 10 |
Complexity Density: 0.38 |
|
26 |
|
public class ButtonRow extends ButtonLayoutTwoGroups{ |
27 |
|
private HorizontalPanel leftPanel = new HorizontalPanel(); |
28 |
|
private HorizontalPanel rightPanel = new HorizontalPanel(); |
29 |
|
private SimplePanel contentPanel = new SimplePanel(); |
30 |
|
private DockPanel mainPanel = new DockPanel(); |
31 |
|
private Widget content = null; |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
33 |
0
|
public ButtonRow(){... |
34 |
0
|
setupDefaultStyles(); |
35 |
0
|
mainPanel.add(contentPanel, DockPanel.NORTH); |
36 |
0
|
mainPanel.add(leftPanel, DockPanel.WEST); |
37 |
0
|
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); |
38 |
0
|
mainPanel.add(rightPanel, DockPanel.EAST); |
39 |
0
|
this.initWidget(mainPanel); |
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
42 |
0
|
public ButtonRow(boolean contentBottom){... |
43 |
0
|
setupDefaultStyles(); |
44 |
0
|
if(contentBottom){ |
45 |
0
|
mainPanel.add(contentPanel, DockPanel.SOUTH); |
46 |
|
} |
47 |
|
else{ |
48 |
0
|
mainPanel.add(contentPanel, DockPanel.NORTH); |
49 |
|
} |
50 |
0
|
mainPanel.add(leftPanel, DockPanel.WEST); |
51 |
0
|
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); |
52 |
0
|
mainPanel.add(rightPanel, DockPanel.EAST); |
53 |
0
|
this.initWidget(mainPanel); |
54 |
|
} |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
56 |
0
|
@Override... |
57 |
|
protected void onLoad() { |
58 |
0
|
super.onLoad(); |
59 |
0
|
if(content != null){ |
60 |
0
|
mainPanel.setWidth(content.getOffsetWidth() + "px"); |
61 |
|
} |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
64 |
0
|
private void setupDefaultStyles(){... |
65 |
0
|
mainPanel.addStyleName("KS-Button-Row-MainPanel"); |
66 |
0
|
contentPanel.addStyleName("KS-Button-Row-ContentPanel"); |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
69 |
0
|
@Override... |
70 |
|
public void setContent(Widget w) { |
71 |
0
|
contentPanel.setWidget(w); |
72 |
0
|
content = w; |
73 |
|
|
74 |
|
} |
75 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
76 |
0
|
@Override... |
77 |
|
public void addButtonToPrimaryGroup(KSButton button) { |
78 |
0
|
leftPanel.add(button); |
79 |
0
|
buttons.add(button); |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
82 |
0
|
@Override... |
83 |
|
public void addButtonToSecondaryGroup(KSButton button) { |
84 |
0
|
rightPanel.add(button); |
85 |
0
|
buttons.add(button); |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0
|
@Override... |
89 |
|
public void addButton(KSButton button) { |
90 |
0
|
this.addButtonToPrimaryGroup(button); |
91 |
|
} |
92 |
|
|
93 |
|
} |