summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/tests/TestForExpandLayout.java
blob: e58ec241617c9f3d19fedc6bf3c2047786ae3d5e (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
/* 
@ITMillApache2LicenseForJavaFiles@
 */

package com.vaadin.tests;

import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DateField;
import com.vaadin.ui.ExpandLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.OrderedLayout;
import com.vaadin.ui.Panel;

/**
 * 
 * @author IT Mill Ltd.
 */
public class TestForExpandLayout extends CustomComponent {

    ExpandLayout main = new ExpandLayout();

    DateField df;

    public TestForExpandLayout() {
        setCompositionRoot(main);
        createNewView();
    }

    public void createNewView() {
        main.removeAllComponents();
        for (int i = 0; i < 6; i++) {
            final ExpandLayout el = new ExpandLayout(
                    OrderedLayout.ORIENTATION_HORIZONTAL);
            for (int j = 0; j < i + 3; j++) {
                final Label l = new Label("label" + i + ":" + j);
                el.addComponent(l);
            }
            if (i > 0) {
                // el.setMargin(true);
                el.setSizeUndefined();
                el.setWidth("100%");
                if (i % 2 == 0) {
                    el.setHeight("8em");
                    Panel p = new Panel("tp");
                    p.addComponent(new Label("panelc"));
                    p.setHeight("100%");
                    p.setWidth("100px");
                    el.addComponent(p);
                }
            }
            main.addComponent(el);
        }

    }
}