diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-09-05 12:27:06 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-09-05 12:27:06 +0000 |
commit | 97b7f1244d75e42c14ac034de6712a4d42de3c22 (patch) | |
tree | 81dab014a9aa0d3ba477fddcf181a6344c87432c /tests | |
parent | a3675f0689c77bcdd433b324c5177bb1957a5457 (diff) | |
download | vaadin-framework-97b7f1244d75e42c14ac034de6712a4d42de3c22.tar.gz vaadin-framework-97b7f1244d75e42c14ac034de6712a4d42de3c22.zip |
Test application for #7539
svn changeset:20846/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/FocusFromShortcutAction.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/FocusFromShortcutAction.java b/tests/src/com/vaadin/tests/components/FocusFromShortcutAction.java new file mode 100644 index 0000000000..124f2b9cdf --- /dev/null +++ b/tests/src/com/vaadin/tests/components/FocusFromShortcutAction.java @@ -0,0 +1,50 @@ +package com.vaadin.tests.components; + +import java.util.Arrays; + +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.event.ShortcutAction.ModifierKey; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Select; +import com.vaadin.ui.TextField; + +public class FocusFromShortcutAction extends TestBase { + + @Override + protected void setup() { + final Select select = new Select("Select", Arrays.asList("Option 1", + "Option 2")); + final TextField text = new TextField("Text"); + + addComponent(select); + addComponent(text); + Button focusText = new Button("Focus text", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + text.focus(); + } + }); + focusText.setClickShortcut(KeyCode.T, ModifierKey.ALT); + + addComponent(focusText); + Button focusSelect = new Button("Focus select", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + select.focus(); + } + }); + focusSelect.setClickShortcut(KeyCode.S, ModifierKey.ALT); + addComponent(focusSelect); + } + + @Override + protected String getDescription() { + return "The option drop down of the Focus select should not be opened when the \"Focus select\" button is triggered by clicking it with the mouse or with the associated shortcut key Alt + S"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(7539); + } + +} |