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

import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.NativeButton;
import com.vaadin.v7.data.Item;
import com.vaadin.v7.ui.Table;

/**
 * Test UI for buttons with undefined width.
 *
 * @since 7.2
 * @author Vaadin Ltd
 */
public class ButtonUndefinedWidth extends AbstractReindeerTestUI {

    @Override
    protected String getTestDescription() {
        return "Both the button outside the table and inside the table should be only as wide as necessary. There should be empty space in the table to the right of the button.";
    }

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

    @SuppressWarnings("unchecked")
    @Override
    protected void setup(VaadinRequest request) {
        Button b = new Button("Undefined wide");
        addComponent(b);
        NativeButton b2 = new NativeButton("Undefined wide");
        addComponent(b2);

        Table t = new Table();
        t.addContainerProperty("A", Button.class, null);
        t.setWidth("500px");

        Item i = t.addItem("1");
        i.getItemProperty("A").setValue(new Button("Undef wide"));
        Item i2 = t.addItem("2");
        i2.getItemProperty("A").setValue(new NativeButton("Undef wide"));

        addComponent(t);
    }
}