summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java
blob: e200c40744b8788bff7877c6860a846cef2247d8 (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
package com.vaadin.tests.layouts;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout.MarginHandler;
import com.vaadin.ui.Panel;

public class GridLayoutInsidePanel extends TestBase {

    @Override
    protected String getDescription() {
        return "The first Panel contains a VerticalLayout, which contains a GridLayout, which contains a Label. The second panel directly contains a GridLayout, which contains a Label. Both should be rendered in the same way.";
    }

    @Override
    protected Integer getTicketNumber() {
        return 2652;
    }

    @Override
    protected void setup() {
        {
            GridLayout gl = new GridLayout(1, 1);
            gl.setSizeUndefined();
            gl.addComponent(new Label(
                    "A label which defines the size of the GL"));

            Panel p = new Panel("Panel 1");
            ((MarginHandler) p.getContent()).setMargin(false);
            p.setSizeUndefined();
            p.getContent().setSizeUndefined();

            p.addComponent(gl);
            addComponent(p);
        }
        {
            GridLayout gl = new GridLayout(1, 1);
            gl.setSizeUndefined();
            gl.addComponent(new Label(
                    "A label which defines the size of the GL"));

            Panel p = new Panel("Panel 2", gl);
            ((MarginHandler) p.getContent()).setMargin(false);
            p.setSizeUndefined();
            p.getContent().setSizeUndefined();

            addComponent(p);
        }
    }

}