diff options
author | Automerge <automerge@vaadin.com> | 2012-04-13 09:13:36 +0000 |
---|---|---|
committer | Automerge <automerge@vaadin.com> | 2012-04-13 09:13:36 +0000 |
commit | 847d5e29ba258c89fbe869f6e6ce8aaf7c571c1e (patch) | |
tree | b492330d9b5785a10ea4c03df3b7c509742411c1 | |
parent | ed20ba59aa3adb63118a3d6cd6ae986c4902793c (diff) | |
download | vaadin-framework-847d5e29ba258c89fbe869f6e6ce8aaf7c571c1e.tar.gz vaadin-framework-847d5e29ba258c89fbe869f6e6ce8aaf7c571c1e.zip |
[merge from 6.7] test case for #8639
svn changeset:23526/svn branch:6.8
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java new file mode 100644 index 0000000000..20e198a138 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.event.Action; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Table; + +public class TableContextMenu extends TestBase { + + private static final Action ACTION_MYACTION = new Action("Action!!"); + + @Override + protected void setup() { + Table table = new Table(); + table.setSelectable(true); + table.setMultiSelect(true); + + table.addActionHandler(new Action.Handler() { + public void handleAction(Action action, Object sender, Object target) { + getLayout().getWindow().showNotification("Done that :-)"); + } + + public Action[] getActions(Object target, Object sender) { + return new Action[] { ACTION_MYACTION }; + } + }); + + // TODO should work with all combinations + table.setImmediate(true); + table.setSelectable(true); + table.setMultiSelect(true); + + table.addContainerProperty("Foo", String.class, "BAR1"); + table.addContainerProperty("Bar", String.class, "FOO2"); + + // FIXME works with lots of rows (more than pagelength), don't work with + // none + for (int i = 0; i < 3; i++) { + table.addItem(); + } + + addComponent(table); + } + + @Override + protected String getDescription() { + return "Right clicking on an item without a context menu should bring" + + "up the Tables context menu. With touch devices context menu must popup with long touch."; + } + + @Override + protected Integer getTicketNumber() { + return 8639; + } + +} |