forked from pquiring/javaforce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInnerPanel.java
More file actions
executable file
·45 lines (43 loc) · 1.09 KB
/
Copy pathInnerPanel.java
File metadata and controls
executable file
·45 lines (43 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package javaforce.webui;
/** Inner Panel to display components with a border.
*
* @author pquiring
*/
public class InnerPanel extends Panel {
private static class Legend extends Component {
private String text;
public Legend(String text) {
this.text = text;
}
public String html() {
StringBuilder sb = new StringBuilder();
sb.append("<legend");
sb.append(getAttrs());
sb.append(">");
sb.append(text);
sb.append("</legend>");
return sb.toString();
}
}
private Legend legend;
public InnerPanel(String text) {
legend = new Legend(text);
removeClass("panel");
addClass("innerpanel");
}
public String html() {
StringBuilder sb = new StringBuilder();
sb.append("<fieldset" + getAttrs() + "'>");
sb.append(legend.html());
int cnt = count();
for(int a=0;a<cnt;a++) {
sb.append(get(a).html());
}
sb.append("</fieldset>");
return sb.toString();
}
public void setAlign(int value) {
super.setAlign(value);
legend.setAlign(value);
}
}