From 8aae764b1f048e0d571855aa3b2d67877033b714 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 27 Apr 2016 11:26:25 +0300 Subject: Move test UI to correct source folder Change-Id: Iadb594d23632b71ca75eab36939cee422dda61cb --- .../tests/components/ui/WindowAndUIShortcuts.java | 76 ++++++++++++++++++++++ .../tests/components/ui/WindowAndUIShortcuts.java | 76 ---------------------- 2 files changed, 76 insertions(+), 76 deletions(-) create mode 100644 uitest/src/main/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java delete mode 100644 uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java b/uitest/src/main/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java new file mode 100644 index 0000000000..c5c9c16e2d --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java @@ -0,0 +1,76 @@ +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/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java b/uitest/src/test/java/com/vaadin/tests/components/ui/WindowAndUIShortcuts.java deleted file mode 100644 index c5c9c16e2d..0000000000 --- a/uitest/src/test/java/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); - } -} -- cgit v1.2.3