summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/tests/tickets/Ticket2303.java
blob: 927358723db3c08b387ca7ff1d4479c8821fbca5 (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
package com.vaadin.tests.tickets;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.OrderedLayout;
import com.vaadin.ui.Window;

public class Ticket2303 extends Application {

    @Override
    public void init() {
        Window w = new Window("main window");

        String customlayout = "<div location=\"test\"></div>";
        CustomLayout cl = null;
        try {
            cl = new CustomLayout(new ByteArrayInputStream(customlayout
                    .getBytes()));
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        cl.setWidth("100%");
        w.setLayout(cl);

        // VerticalLayout ol = new VerticalLayout();
        // w.setLayout(ol);
        OrderedLayout hugeLayout = new OrderedLayout();
        hugeLayout.setMargin(true);
        hugeLayout.setSpacing(true);
        for (int i = 0; i < 30; i++) {
            hugeLayout.addComponent(new Label("huge " + i));
        }
        cl.addComponent(hugeLayout, "test");
        // ol.addComponent(hugeLayout);
        setMainWindow(w);
    }

}