aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/VerticalRelativeChildren.java
blob: b972edeb07de70e40a9e295c73bc8c91b8016d7f (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
56
57
58
59
package com.vaadin.tests.components.orderedlayout;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.v7.ui.TextArea;

public class VerticalRelativeChildren extends TestBase {

    @Override
    protected void setup() {

        VerticalLayout vl = new VerticalLayout();
        vl.setWidth("300px");

        TextArea areaUndefined = new TextArea();
        areaUndefined.setSizeUndefined();
        areaUndefined.setValue("Undefined height");
        vl.addComponent(areaUndefined);

        TextArea areaDefined = new TextArea();
        areaDefined.setWidth("200px");
        areaDefined.setValue("200px width");
        vl.addComponent(areaDefined);

        TextArea areaRelativeBottom = new TextArea();
        areaRelativeBottom.setWidth("50%");
        areaRelativeBottom.setValue("50% width, right align");
        vl.addComponent(areaRelativeBottom);
        vl.setComponentAlignment(areaRelativeBottom, Alignment.TOP_RIGHT);

        TextArea areaRelativeCenter = new TextArea();
        areaRelativeCenter.setWidth("50%");
        areaRelativeCenter.setValue("50% width, center align");
        vl.addComponent(areaRelativeCenter);
        vl.setComponentAlignment(areaRelativeCenter, Alignment.TOP_CENTER);

        TextArea areaRelativeTop = new TextArea();
        areaRelativeTop.setWidth("50%");
        areaRelativeTop.setValue("50% width, left align");
        vl.addComponent(areaRelativeTop);
        vl.setComponentAlignment(areaRelativeTop, Alignment.TOP_LEFT);

        addComponent(vl);
    }

    @Override
    protected String getDescription() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    protected Integer getTicketNumber() {
        // TODO Auto-generated method stub
        return null;
    }

}