aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/themes/valo/SplitPanels.java
blob: 1ca0f9b913a46a93ef5a3aaef8b3b72a4d3618d5 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.vaadin.tests.themes.valo;

import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.themes.ValoTheme;

public class SplitPanels extends VerticalLayout implements View {
    public SplitPanels() {
        setSpacing(false);

        Label h1 = new Label("Split Panels");
        h1.addStyleName(ValoTheme.LABEL_H1);
        addComponent(h1);

        Label label = new Label(
                "Outlines are just to show the areas of the SplitPanels. They are not part of the actual component style.");
        label.setWidth("100%");
        addComponent(label);

        HorizontalLayout row = new HorizontalLayout();
        row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
        row.setMargin(new MarginInfo(true, false, false, false));
        addComponent(row);

        HorizontalSplitPanel sp = new HorizontalSplitPanel();
        sp.setCaption("Default style");
        sp.setWidth("400px");
        sp.setHeight(null);
        sp.setFirstComponent(getContent());
        sp.setSecondComponent(getContent());
        row.addComponent(sp);

        VerticalSplitPanel sp2 = new VerticalSplitPanel();
        sp2.setCaption("Default style");
        sp2.setWidth("300px");
        sp2.setHeight("200px");
        sp2.setFirstComponent(getContent());
        sp2.setSecondComponent(getContent());
        row.addComponent(sp2);

        sp = new HorizontalSplitPanel();
        sp.setCaption("Large style");
        sp.setWidth("300px");
        sp.setHeight("200px");
        sp.addStyleName(ValoTheme.SPLITPANEL_LARGE);
        sp.setFirstComponent(getContent());
        sp.setSecondComponent(getContent());
        row.addComponent(sp);

        sp2 = new VerticalSplitPanel();
        sp2.setCaption("Large style");
        sp2.setWidth("300px");
        sp2.setHeight("200px");
        sp2.addStyleName(ValoTheme.SPLITPANEL_LARGE);
        sp2.setFirstComponent(getContent());
        sp2.setSecondComponent(getContent());
        row.addComponent(sp2);
    }

    VerticalLayout getContent() {
        return new VerticalLayout() {
            {
                setSpacing(false);
                Label label = new Label(
                        "Fictum,  deserunt mollit anim laborum astutumque!");
                label.setWidth("100%");
                addComponent(label);
            }
        };
    }

    @Override
    public void enter(ViewChangeEvent event) {
        // TODO Auto-generated method stub

    }

}