aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/gridlayout/ComponentAlignments.java
blob: a42e0fb648ae4cb68019d0aeb4464a38add1aca7 (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
package com.vaadin.tests.components.gridlayout;

import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.VerticalLayout;

/**
 * Test UI for TOP_CENTER and TOP_RIGHT alignments in VerticalLayout.
 *
 * @author Vaadin Ltd
 */
public class ComponentAlignments extends AbstractReindeerTestUI {

    @Override
    protected void setup(VaadinRequest request) {

        CheckBox topcenter = new CheckBox("Top Center");
        topcenter.setSizeUndefined();
        VerticalLayout verticalLayout1 = new VerticalLayout(topcenter);
        verticalLayout1.setHeight("40px");
        verticalLayout1.setWidth("140px");
        verticalLayout1.setComponentAlignment(topcenter, Alignment.TOP_CENTER);
        addComponent(verticalLayout1);

        CheckBox topright = new CheckBox("Top Right");
        topright.setSizeUndefined();
        VerticalLayout verticalLayout2 = new VerticalLayout(topright);
        verticalLayout2.setHeight("40px");
        verticalLayout2.setWidth("140px");
        verticalLayout2.setComponentAlignment(topright, Alignment.TOP_RIGHT);
        addComponent(verticalLayout2);

    }

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

    @Override
    protected String getTestDescription() {
        return "TOP_CENTER and TOP_RIGHT alignments should work in VerticalLayout";
    }
}