blob: c23ca34373bf6309b5994438079466bf40d68215 (
plain)
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
|
/*
@ITMillApache2LicenseForJavaFiles@
*/
package com.itmill.toolkit.tests;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.DateField;
import com.itmill.toolkit.ui.ExpandLayout;
/**
*
* @author IT Mill Ltd.
*/
public class TestForExpandLayout3 extends CustomComponent {
ExpandLayout main = new ExpandLayout();
DateField df;
public TestForExpandLayout3() {
setCompositionRoot(main);
createNewView();
}
public void createNewView() {
main.removeAllComponents();
ExpandLayout el;
Button b;
Button b2;
el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL);
b = new Button("SDFS");
b2 = new Button("DSFSDFDFSSDF");
el.addComponent(b);
el.addComponent(b2);
el.expand(b);
el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT,
ExpandLayout.ALIGNMENT_VERTICAL_CENTER);
main.addComponent(el);
el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL);
b = new Button("SDFS");
b2 = new Button("DSFSDFDFSSDF");
el.addComponent(b);
el.addComponent(b2);
el.expand(b);
el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_HORIZONTAL_CENTER,
ExpandLayout.ALIGNMENT_VERTICAL_CENTER);
el.setHeight(60, ExpandLayout.UNITS_PIXELS);
el.setMargin(true);
main.addComponent(el);
el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL);
b = new Button("SDFS");
b2 = new Button("DSFSDFDFSSDF");
el.addComponent(b);
el.addComponent(b2);
el.expand(b);
el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT,
ExpandLayout.ALIGNMENT_BOTTOM);
el.setHeight(100, ExpandLayout.UNITS_PIXELS);
el.setSpacing(true);
main.addComponent(el);
}
}
|