aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/elements/CompatibilityElementComponentGetCaptionBase.java
blob: 09daa2e344d980c64ca08d59e70a2e6d174484a4 (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
package com.vaadin.tests.elements;

import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.AbstractLayout;
import com.vaadin.ui.Component;
import com.vaadin.v7.ui.CheckBox;
import com.vaadin.v7.ui.ColorPicker;
import com.vaadin.v7.ui.ComboBox;
import com.vaadin.v7.ui.DateField;
import com.vaadin.v7.ui.ListSelect;
import com.vaadin.v7.ui.OptionGroup;
import com.vaadin.v7.ui.Table;
import com.vaadin.v7.ui.TextArea;
import com.vaadin.v7.ui.TextField;
import com.vaadin.v7.ui.Tree;
import com.vaadin.v7.ui.TreeTable;
import com.vaadin.v7.ui.TwinColSelect;

/**
 *
 * Base testUI class for testing getCaption method. Captions of elements
 * implemented differently in different layouts (FormLayout) This class adds all
 * elements to the layout. The exact layout is created in a child class.
 */
@Widgetset("com.vaadin.v7.Vaadin7WidgetSet")
public abstract class CompatibilityElementComponentGetCaptionBase
        extends AbstractTestUI {
    // Specify exact type of Layout in a child class
    AbstractLayout mainLayout = null;
    // default captions for all elements
    public static final String[] DEFAULT_CAPTIONS = { "Combobox", "table",
            "treeTable", "tree", "TwinColSelect", "optionGroup", "ListSelect",
            "ColorPicker", "CheckBox", "TextField", "TextArea", "DateField", };

    @Override
    protected void setup(VaadinRequest request) {
        Component[] comps = { new ComboBox(), new Table(), new TreeTable(),
                new Tree(), new TwinColSelect(), new OptionGroup(),
                new ListSelect(), new ColorPicker(), new CheckBox(),
                new TextField(), new TextArea(), new DateField(), };
        addComponent(mainLayout);
        for (int i = 0; i < comps.length; i++) {
            Component component = comps[i];
            component.setCaption(DEFAULT_CAPTIONS[i]);
            mainLayout.addComponent(component);
        }
    }

    @Override
    protected String getTestDescription() {
        return "Test getCaption method for vaadin compatibility components";
    }

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