diff options
author | Henri Sara <hesara@vaadin.com> | 2012-04-12 11:43:34 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2012-04-12 11:43:34 +0300 |
commit | b96bdd865ba2010840ae2d08bbcd7369ca13f815 (patch) | |
tree | 182b2602010137640fe54515aaa93e9398765e0b | |
parent | b65f72265230869b03a09c4e8c353f39b8cc1ecf (diff) | |
download | vaadin-framework-b96bdd865ba2010840ae2d08bbcd7369ca13f815.tar.gz vaadin-framework-b96bdd865ba2010840ae2d08bbcd7369ca13f815.zip |
Fix ShortCutListenerModification test
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java index f338b1ac90..295c04fc0c 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java +++ b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java @@ -6,6 +6,7 @@ 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.Component; import com.vaadin.ui.Notification; import com.vaadin.ui.Window; @@ -36,9 +37,6 @@ public class ShortCutListenerModification extends TestBase implements Button button1 = new Button("b1 (CTRL-C)"); Button button2 = new Button("b2 (CTRL-V)"); - button1.setData(window); - button2.setData(window); - button1.addListener(this); button2.addListener(this); @@ -63,8 +61,12 @@ public class ShortCutListenerModification extends TestBase implements } public void buttonClick(ClickEvent event) { - Window window2 = (Window) event.getButton().getData(); - window2.close(); + Component c = event.getButton(); + while (!(c instanceof Window)) { + c = c.getParent(); + } + ((Window) c).close(); + Button prev = (Button) event.getButton().getData(); if (prev != null) { prev.focus(); |