aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/button/ButtonsAndIcons.java
blob: 64f690dbf5e2c97de9715135d262d138b70431de (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
package com.vaadin.tests.components.button;

import com.vaadin.server.ThemeResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.NativeButton;

public class ButtonsAndIcons extends TestBase {

    @Override
    protected String getDescription() {
        return "The first button has text and an icon, the second only text and the third only an icon.";
    }

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

    @Override
    protected void setup() {
        Button b = new Button("Text and icon");
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);

        b = new Button("Only text");

        addComponent(b);
        b = new Button((String) null);
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);

        b = new NativeButton("Text and icon");
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);

        b = new NativeButton("Only text");

        addComponent(b);
        b = new NativeButton(null);
        b.setIcon(new ThemeResource("../runo/icons/16/ok.png"));

        addComponent(b);
    }

}