diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-30 17:24:36 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-08-30 17:24:36 +0300 |
commit | 7b25b3886ea95bc6495506fbe9472e45fcbde684 (patch) | |
tree | 0b93cb65dab437feb46720659a63b8f1ef48f7f4 /uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java | |
parent | 8941056349e302e687e40e94c13709e75f256d73 (diff) | |
download | vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.tar.gz vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.zip |
Renamed tests -> uitest and tests/testbench -> uitest/src (#9299)
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java b/uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java new file mode 100644 index 0000000000..98cd4e0aaa --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java @@ -0,0 +1,58 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Table; + +public class TableVisibleColumnsUpdate extends TestBase { + + private String[] cols1 = new String[] { "p1", "p2", "p3" }; + private String[] cols2 = new String[] { "p1", "p4", "p3" }; + private Table table; + + @Override + protected String getDescription() { + return "Columns should change between p1,p2,p3 and p1,p4,p3"; + } + + @Override + protected Integer getTicketNumber() { + return 3139; + } + + @Override + protected void setup() { + table = new Table(); + table.setWidth("400px"); + table.setHeight("100px"); + table.setPageLength(100); + table.addContainerProperty("p1", String.class, null); + table.addContainerProperty("p2", String.class, null); + table.addContainerProperty("p3", String.class, null); + table.addContainerProperty("p4", String.class, null); + + for (int i = 0; i < 10; i++) { + table.addItem(new Object[] { "a" + i, "b" + i, "c" + i, "X" + i }, + "" + i); + } + + addComponent(table); + + table.setVisibleColumns(cols1); + // table.setColumnHeaders(headers1); + + Button updateButton = new Button("Change columns", new ClickListener() { + private boolean one = true; + + @Override + public void buttonClick(ClickEvent event) { + table.setVisibleColumns((one ? cols2 : cols1)); + one = !one; + } + }); + addComponent(updateButton); + } + +} |