aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/table/CollapseIndicatorOverlapsColumn.java
blob: a168707e20670b56c0cec5d38bc15ad315a1c73f (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
package com.vaadin.tests.components.table;

import com.vaadin.tests.components.TestBase;
import com.vaadin.v7.data.Item;
import com.vaadin.v7.ui.Table;

@SuppressWarnings("deprecation")
public class CollapseIndicatorOverlapsColumn extends TestBase {

    @Override
    protected void setup() {
        Table tbl = createTable();
        tbl.setWidth("400px");
        addComponent(tbl);
    }

    @SuppressWarnings("unchecked")
    private Table createTable() {
        Table tbl = new Table();
        tbl.addContainerProperty("COL1", String.class, "Column 1");
        tbl.addContainerProperty("COL2", String.class, "Column 2");

        // Right align last column
        tbl.setColumnAlignment("COL2", Table.ALIGN_RIGHT);

        // Allow collapsing
        tbl.setColumnCollapsingAllowed(true);

        for (int i = 0; i < 5; i++) {
            Item item = tbl.addItem("Item " + i);
            for (int j = 1; j <= 2; j++) {
                item.getItemProperty("COL" + j).setValue("Item " + i + "/" + j);
            }
        }
        return tbl;
    }

    @Override
    protected String getDescription() {
        return "The rightmost column should not be covered by the collapse indicator";
    }

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

}