aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
blob: f343344397f852da97f10e02627cd91aa1039743 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package com.vaadin.tests.themes.valo;

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

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

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

        HorizontalLayout split = new HorizontalLayout();
        split.setWidth("100%");
        split.setSpacing(false);
        addComponent(split);

        VerticalLayout left = new VerticalLayout();
        left.setSpacing(false);
        left.setMargin(new MarginInfo(false, true, false, false));
        split.addComponent(left);

        Label huge = new Label("Huge type for display text.");
        huge.setWidth("100%");
        huge.addStyleName(ValoTheme.LABEL_HUGE);
        left.addComponent(huge);

        Label large = new Label(
                "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        large.setWidth("100%");
        large.addStyleName(ValoTheme.LABEL_LARGE);
        left.addComponent(large);

        Label h2 = new Label("Subtitle");
        h2.addStyleName(ValoTheme.LABEL_H2);
        left.addComponent(h2);

        Label normal = new Label(
                "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
                ContentMode.HTML);
        normal.setWidth("100%");
        left.addComponent(normal);

        Label h3 = new Label("Small Title");
        h3.addStyleName(ValoTheme.LABEL_H3);
        left.addComponent(h3);

        Label small = new Label(
                "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        small.setWidth("100%");
        small.addStyleName(ValoTheme.LABEL_SMALL);
        left.addComponent(small);

        Label tiny = new Label("Tiny type for minor text.");
        tiny.setWidth("100%");
        tiny.addStyleName(ValoTheme.LABEL_TINY);
        left.addComponent(tiny);

        Label h4 = new Label("Section Title");
        h4.addStyleName(ValoTheme.LABEL_H4);
        left.addComponent(h4);

        normal = new Label(
                "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        normal.setWidth("100%");
        left.addComponent(normal);

        Panel p = new Panel("Additional Label Styles");
        split.addComponent(p);

        VerticalLayout right = new VerticalLayout();
        p.setContent(right);

        Label label = new Label(
                "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.setWidth("100%");
        label.addStyleName(ValoTheme.LABEL_BOLD);
        right.addComponent(label);

        label = new Label(
                "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.setWidth("100%");
        label.addStyleName(ValoTheme.LABEL_LIGHT);
        right.addComponent(label);

        label = new Label(
                "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
        label.setWidth("100%");
        label.addStyleName(ValoTheme.LABEL_COLORED);
        right.addComponent(label);

        label = new Label("A label for success");
        label.setWidth("100%");
        label.addStyleName(ValoTheme.LABEL_SUCCESS);
        right.addComponent(label);

        label = new Label("A label for failure");
        label.setWidth("100%");
        label.addStyleName(ValoTheme.LABEL_FAILURE);
        right.addComponent(label);

    }

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

    }
}