diff options
author | elmot <elmot@vaadin.com> | 2016-04-26 15:22:23 +0300 |
---|---|---|
committer | elmot <elmot@vaadin.com> | 2016-04-26 15:22:23 +0300 |
commit | 7dee9e4726dcf05bf316c54f1059add697d521f1 (patch) | |
tree | 5ea3389015304a0675286507508f1eb63ffb0c8a /uitest/src/com | |
parent | 6a89c2fae342401f99c591cfc2b2549f4e675e81 (diff) | |
download | vaadin-framework-7dee9e4726dcf05bf316c54f1059add697d521f1.tar.gz vaadin-framework-7dee9e4726dcf05bf316c54f1059add697d521f1.zip |
Moving WindowAndUIShortcuts to the correct place
Change-Id: If2e7c44e1497f600cf050c8430dafa62de1bd0a5
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java | 76 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java | 43 |
2 files changed, 0 insertions, 119 deletions
diff --git a/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java b/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java deleted file mode 100644 index c5c9c16e2d..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.vaadin.tests.components.ui; - -import com.vaadin.annotations.Theme; -import com.vaadin.event.ShortcutAction; -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Notification; -import com.vaadin.ui.TextField; -import com.vaadin.ui.UI; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.themes.ValoTheme; - -@Theme(ValoTheme.THEME_NAME) -public class WindowAndUIShortcuts extends UI { - - @Override - protected void init(VaadinRequest request) { - VerticalLayout layout = new VerticalLayout(); - layout.setSizeFull(); - layout.setMargin(true); - - final VerticalLayout mainLayout = new VerticalLayout(); - - mainLayout.addComponent(new Button("Show page", - new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent clickEvent) { - final VerticalLayout pageLayout = new VerticalLayout(); - pageLayout.setSpacing(true); - - pageLayout.addComponent(new Label("Page")); - pageLayout.addComponent(new Button( - "Open dialog window", - new Button.ClickListener() { - @Override - public void buttonClick( - Button.ClickEvent clickEvent) { - Window dialog = new Window(); - dialog.setModal(true); - dialog.setCaption("Press ESC shortcut"); - dialog.setWidth("300px"); - dialog.setHeight("100px"); - - dialog.setContent(new TextField( - "TextField in window")); - addWindow(dialog); - } - })); - Button closeButton = new Button("Close page", - new Button.ClickListener() { - @Override - public void buttonClick( - Button.ClickEvent clickEvent) { - mainLayout.removeComponent(pageLayout); - - Notification - .show("OMG! Page is also closed!"); - } - }); - closeButton - .setClickShortcut(ShortcutAction.KeyCode.ESCAPE); - pageLayout.addComponent(closeButton); - - mainLayout.addComponent(pageLayout); - mainLayout.setExpandRatio(pageLayout, 1); - } - })); - - layout.addComponent(mainLayout); - layout.setExpandRatio(mainLayout, 1); - - setContent(layout); - } -} diff --git a/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java b/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java deleted file mode 100644 index 93324f0792..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/WindowAndUIShortcutsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2014 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.tests.components.ui; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.Keys; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.testbench.elements.WindowElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class WindowAndUIShortcutsTest extends SingleBrowserTest { - - @Test - public void windowShortcutShouldNotReachUI() { - openTestURL(); - $(ButtonElement.class).caption("Show page").first().click(); - $(ButtonElement.class).caption("Open dialog window").first().click(); - - WindowElement window = $(WindowElement.class).first(); - window.$(TextFieldElement.class).first().sendKeys(Keys.ESCAPE); - - // Window should have been closed - Assert.assertTrue($(WindowElement.class).all().isEmpty()); - // "Close page" should not have been clicked - Assert.assertTrue($(ButtonElement.class).caption("Close page").exists()); - } -} |