summaryrefslogtreecommitdiffstats
path: root/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
blob: 741adecae489bcfcd70ce6a741ebbfb288dbd5af (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
package com.vaadin.tests.tickets;

import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;

public class Ticket1869 extends com.vaadin.Application.LegacyApplication {

    @Override
    public void init() {

        GridLayout lo = new GridLayout(2, 1);
        setMainWindow(new LegacyWindow("#1869", lo));
        lo.setMargin(true);
        lo.setSpacing(true);

        VerticalLayout el = new VerticalLayout();
        Panel elp = new Panel(
                "Vertical ExpandLayout /w first component expanded", el);
        el.setHeight("1000px");
        for (int i = 0; i < 3; i++) {
            Button b = new Button("x");
            el.addComponent(b);
            if (i == 0) {
                b.setSizeFull();
                el.setExpandRatio(b, 1);
            }
        }
        lo.addComponent(elp);
        elp.setWidth("300px");
        elp.setHeight("300px");

        HorizontalLayout elh = new HorizontalLayout();
        Panel elph = new Panel(
                "Horizontal ExpandLayout /w first component expanded", elh);
        elh.setWidth("1000px");
        for (int i = 0; i < 3; i++) {
            Button b = new Button("x");
            elh.addComponent(b);
            if (i == 0) {
                b.setSizeFull();
                elh.setExpandRatio(b, 1);
            }
        }
        lo.addComponent(elph);
        elph.setWidth("300px");
        elph.setHeight("300px");

    }
}