diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-10-20 05:24:49 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-10-20 05:24:49 +0000 |
commit | 612095ded1cfe588c1bcd85be77b43e144f60608 (patch) | |
tree | e45bf073f27f637e8b78df118fc231ae5a7e1563 /src/com | |
parent | 1225d83fb3f0aaecf542a72fb5c1b77246e4a1ad (diff) | |
download | vaadin-framework-612095ded1cfe588c1bcd85be77b43e144f60608.tar.gz vaadin-framework-612095ded1cfe588c1bcd85be77b43e144f60608.zip |
Enhanced test case
svn changeset:9248/svn branch:6.2
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java b/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java index 16a9d41b75..11a111acf8 100644 --- a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java +++ b/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java @@ -1,5 +1,7 @@ package com.vaadin.tests.components.table;
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
@@ -23,6 +25,27 @@ public class ColumnCollapsingAndColumnExpansion extends TestBase { table.addContainerProperty("Col3", String.class, null);
table.setColumnCollapsingAllowed(true);
+ table.addActionHandler(new Handler() {
+
+ final Action H = new Action("Toggle Col2");
+ final Action[] actions = new Action[] { H };
+
+ public Action[] getActions(Object target, Object sender) {
+ return actions;
+ }
+
+ public void handleAction(Action action, Object sender, Object target) {
+ try {
+ table.setColumnCollapsed("Col2", !table
+ .isColumnCollapsed("Col2"));
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+
table.setSizeFull();
for (int y = 1; y < 5; y++) {
@@ -34,7 +57,7 @@ public class ColumnCollapsingAndColumnExpansion extends TestBase { addComponent(table);
HorizontalLayout hl = new HorizontalLayout();
- final TextField tf = new TextField("Column name");
+ final TextField tf = new TextField("Column name (ColX)");
Button hide = new Button("Collapse", new ClickListener() {
public void buttonClick(ClickEvent event) {
|