summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket2222.java
blob: c0b56f14c285d18318d9874e968bcdd8a54284f9 (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
60
61
62
63
64
package com.vaadin.tests.tickets;

import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI.LegacyWindow;
import com.vaadin.ui.VerticalLayout;

public class Ticket2222 extends Application {

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        setTheme("tests-tickets");
        createUI((AbstractOrderedLayout) w.getContent());
    }

    private void createUI(AbstractOrderedLayout layout) {
        HorizontalLayout horiz = new HorizontalLayout();
        horiz.setSpacing(true);
        horiz.setMargin(true);
        horiz.setStyleName("ticket2222");

        horiz.addComponent(new Label("Horiz spacing: 60px;"));
        horiz.addComponent(new Label("Margin-left: 40px"));
        horiz.addComponent(new Label("Margin-top: 100px;"));
        horiz.addComponent(new Label("Margin-right: 20px;"));
        horiz.addComponent(new Label("Margin-bottom: 30px;"));
        horiz.addStyleName("borders");

        VerticalLayout vert = new VerticalLayout();
        vert.setSizeUndefined();
        vert.setSpacing(true);
        vert.setMargin(false);
        vert.setStyleName("ticket2222");
        vert.addComponent(new Label("Vert spacing: 50px;"));
        vert.addComponent(new Label("No margins"));
        vert.addComponent(new Label("label 3"));
        vert.addStyleName("borders");

        GridLayout gl = new GridLayout(3, 2);
        gl.setStyleName("borders");
        gl.setSpacing(true);
        gl.setMargin(true);
        gl.setStyleName("ticket2222");
        gl.addComponent(new Label("Vert spacing: 50px; horiz 20px;"));
        gl.addComponent(new Label("Margin-left: 40px"));
        gl.addComponent(new Label("Margin-top: 100px;"));
        gl.addComponent(new Label("Margin-right: 20px;"));
        gl.addComponent(new Label("Margin-bottom: 30px;"));
        gl.addComponent(new Label("label 3"));
        gl.addStyleName("borders");

        layout.addComponent(horiz);
        layout.addComponent(new Label(" "));
        layout.addComponent(vert);
        layout.addComponent(new Label(" "));
        layout.addComponent(gl);
    }

}