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

package com.itmill.toolkit.tests;

import com.itmill.toolkit.ui.CustomComponent;
import com.itmill.toolkit.ui.DateField;
import com.itmill.toolkit.ui.ExpandLayout;
import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.OrderedLayout;

/**
 * 
 * @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 < 10; i++) {
            final ExpandLayout el = new ExpandLayout(
                    OrderedLayout.ORIENTATION_HORIZONTAL);
            for (int j = 0; j < 10; j++) {
                final Label l = new Label("label" + i + ":" + j);
                el.addComponent(l);
            }
            if (i > 0) {
                el.setHeight(1, ExpandLayout.UNITS_EM);
            }
            main.addComponent(el);
        }

    }
}