summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/tests/tickets/Ticket2344.java
blob: 892ece1a788854937115d77ee8f0bedd2bef505f (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
package com.itmill.toolkit.tests.tickets;

import java.util.Random;

import com.itmill.toolkit.Application;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.Panel;
import com.itmill.toolkit.ui.Table;
import com.itmill.toolkit.ui.VerticalLayout;
import com.itmill.toolkit.ui.Window;

public class Ticket2344 extends Application {

    private Panel p;

    public void init() {
        Window main = new Window("Quick test");

        setMainWindow(main);

        // setTheme("quicktest");

        VerticalLayout hl = new VerticalLayout();
        hl.setWidth("400px");
        main.setLayout(hl);

        Table t = new Table();
        t.setWidth("100%");

        t.addContainerProperty("Prop 1", VerticalLayout.class, "");
        t.addContainerProperty("Prop 2", String.class, "");
        t.addContainerProperty("Prop 3", String.class, "");
        t.addContainerProperty("Prop 4", String.class, "");
        t.addContainerProperty("Prop 5", Button.class, "");

        t.setPageLength(3);

        for (int i = 0; i < 10; i++) {

            VerticalLayout vl = new VerticalLayout();
            // vl.setWidth(null);
            Button b = new Button("String 1 2 3");
            b.setStyleName(Button.STYLE_LINK);
            vl.addComponent(b);
            t.addItem(new Object[] { vl, "String 2", "String 3", "String 4",

            new Button("String 5") }, new Integer(new Random().nextInt()));

        }

        hl.addComponent(t);

    }

}