-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPanelComposite.java
98 lines (71 loc) · 1.97 KB
/
PanelComposite.java
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
public class PanelComposite extends CustomComponent {
private HorizontalLayout header ;
private VerticalLayout body;
private HorizontalLayout footer ;
private HorizontalLayout headerLayout;
private HorizontalLayout footerLayout;
private Label tituloLbl;
public PanelComposite(String titulo)
{
tituloLbl = new Label(titulo);
init();
}
public PanelComposite()
{
tituloLbl = new Label();
init();
}
public void setTitulo(String titulo)
{
tituloLbl.setValue(titulo);
}
private void init() {
VerticalLayout root = new VerticalLayout();
header = new HorizontalLayout();
tituloLbl.setStyleName("titlePanel");
header.addComponent(tituloLbl);
headerLayout= new HorizontalLayout();
header.addComponent(headerLayout);
header.setComponentAlignment(headerLayout, Alignment.MIDDLE_RIGHT);
header.setStyleName("headerPanel");
header.setWidth("100%");
header.setHeight("50px");
body = new VerticalLayout();
body.setStyleName("bodyPanel");
body.setWidth("100%");
footer = new HorizontalLayout();
footer.setStyleName("footerPanel");
footerLayout= new HorizontalLayout();
footer.addComponent(footerLayout);
footer.setComponentAlignment(footerLayout, Alignment.MIDDLE_CENTER);
footer.setWidth("100%");
footer.setHeight("60px");
root.addComponent(header);
root.addComponent(body);
root.addComponent(footer);
root.setWidth("100%");
setCompositionRoot(root);
}
public void addComponentHeader(AbstractComponent component)
{
headerLayout.addComponent(UIUtils.generateH10Space());
headerLayout.addComponent(component);
}
public void addContent(AbstractComponent component)
{
body.addComponent(component);
}
public void addComponentFooter(AbstractComponent component)
{
footerLayout.addComponent(component);
footerLayout.addComponent(UIUtils.generateH10Space());
}
public void hideFooter()
{
footer.setVisible(false);
}
public void showFooter()
{
footer.setVisible(true);
}
}