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; |
17 |
|
|
18 |
|
import com.google.gwt.dom.client.Element; |
19 |
|
import com.google.gwt.user.client.DOM; |
20 |
|
import com.google.gwt.user.client.ui.ComplexPanel; |
21 |
|
import com.google.gwt.user.client.ui.Widget; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
@author |
27 |
|
|
28 |
|
|
|
|
| 0% |
Uncovered Elements: 50 (50) |
Complexity: 16 |
Complexity Density: 0.48 |
|
29 |
|
public class SectionTitle extends ComplexPanel { |
30 |
|
|
31 |
|
private String reportText; |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
33 |
0
|
private SectionTitle(Element e) {... |
34 |
0
|
this.setElement(e); |
35 |
|
} |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0
|
public static SectionTitle generateEmptyTitle() {... |
38 |
0
|
return generateTitle(DOM.createSpan(), null); |
39 |
|
} |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
41 |
0
|
public static SectionTitle generateH1Title(String titletext) {... |
42 |
|
|
43 |
0
|
Element headerElement = DOM.createElement("H1"); |
44 |
0
|
headerElement.setInnerText(titletext); |
45 |
0
|
return generateTitle(headerElement, "KS-H1-Section-Title"); |
46 |
|
} |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
48 |
0
|
public static SectionTitle generateH2Title(String titletext) {... |
49 |
|
|
50 |
0
|
Element headerElement = DOM.createElement("H2"); |
51 |
0
|
headerElement.setInnerText(titletext); |
52 |
0
|
return generateTitle(headerElement, "KS-H2-Section-Title"); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
55 |
0
|
public static SectionTitle generateH3Title(String titletext) {... |
56 |
|
|
57 |
0
|
Element headerElement = DOM.createElement("H3"); |
58 |
0
|
headerElement.setInnerText(titletext); |
59 |
0
|
return generateTitle(headerElement, "KS-H3-Section-Title"); |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
62 |
0
|
public static SectionTitle generateH4Title(String titletext) {... |
63 |
|
|
64 |
0
|
Element headerElement = DOM.createElement("H4"); |
65 |
0
|
headerElement.setInnerText(titletext); |
66 |
0
|
return generateTitle(headerElement, "KS-H4-Section-Title"); |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
69 |
0
|
public static SectionTitle generateH5Title(String titletext) {... |
70 |
|
|
71 |
0
|
Element headerElement = DOM.createElement("H5"); |
72 |
0
|
headerElement.setInnerText(titletext); |
73 |
0
|
return generateTitle(headerElement, "KS-H5-Section-Title"); |
74 |
|
} |
75 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
76 |
0
|
public static SectionTitle generateH6Title(String titletext) {... |
77 |
|
|
78 |
0
|
Element headerElement = DOM.createElement("H6"); |
79 |
0
|
headerElement.setInnerText(titletext); |
80 |
0
|
return generateTitle(headerElement, "KS-H6-Section-Title"); |
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
83 |
0
|
private static SectionTitle generateTitle(Element header, String styleName) {... |
84 |
0
|
SectionTitle thisTitle = new SectionTitle(header); |
85 |
0
|
thisTitle.addStyleName("KS-Section-Title"); |
86 |
0
|
if(styleName != null){ |
87 |
0
|
thisTitle.addStyleName(styleName); |
88 |
|
} |
89 |
0
|
return thisTitle; |
90 |
|
} |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
92 |
0
|
public void setText(String text){... |
93 |
0
|
this.getElement().setInnerText(text); |
94 |
0
|
this.reportText = text; |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
97 |
0
|
public void setHTML(String html){... |
98 |
0
|
this.getElement().setInnerHTML(html); |
99 |
0
|
this.reportText = html; |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
@param |
106 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0
|
@Override... |
108 |
|
public void add(Widget w) { |
109 |
0
|
add(w, getElement()); |
110 |
|
} |
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
@return |
116 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
117 |
0
|
public String getExportFieldValue() {... |
118 |
0
|
if ((this.reportText != null) && (this.reportText.length() > 0)){ |
119 |
0
|
return this.reportText; |
120 |
|
} |
121 |
0
|
return this.getElement().getInnerText(); |
122 |
|
} |
123 |
|
} |
124 |
|
|
125 |
|
|