summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetMinimalClosableTabs.java
blob: ebfee0adb0dda869a6a91336bdb229bd920005d8 (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
package com.vaadin.tests.components.tabsheet;

import com.vaadin.server.ExternalResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.themes.Reindeer;

public class TabsheetMinimalClosableTabs extends TestBase {

    @Override
    protected void setup() {
        TabSheet ts = new TabSheet();
        for (int tab = 0; tab < 5; tab++) {
            String tabCaption = "Tab";
            for (int c = 0; c < tab; c++) {
                tabCaption += tabCaption;
            }
            tabCaption += " " + tab;

            Tab t = ts.addTab(new Label("Content " + tab), tabCaption);
            t.setClosable(true);

            if (tab % 2 == 0) {
                t.setIcon(new ExternalResource(
                        "/VAADIN/themes/tests-tickets/icons/fi.gif"));
            }
        }

        ts.addStyleName(Reindeer.TABSHEET_MINIMAL);
        addComponent(ts);
    }

    @Override
    protected String getDescription() {
        return "Minimal theme should also show the close button in all browsers";
    }

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