summaryrefslogtreecommitdiffstats
path: root/tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java
blob: 86895033329704a7c4ae11cfc1b0feffa84de7c4 (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
package com.vaadin.tests.layouts;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;

/**
 * Tests removing rows from a GridLayout
 */
@SuppressWarnings("serial")
public class GridLayoutRemoveFinalRow extends TestBase {

    @Override
    protected void setup() {
        getLayout().setSpacing(true);

        final GridLayout layout = new GridLayout(2, 2);
        layout.setSpacing(true);
        layout.addComponent(new Label("Label1"));
        layout.addComponent(new Label("Label2"));
        layout.addComponent(new Label("Label3"));
        layout.addComponent(new Label("Label4"));
        addComponent(layout);

        Button removeRowBtn = new Button("Remove row",
                new Button.ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        layout.removeRow(0);
                    }
                });
        addComponent(removeRowBtn);
    }

    @Override
    protected String getDescription() {
        return "Removing last row of a GridLayout throws a IllegalArgumentException";
    }

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

}