diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 11:06:18 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 14:00:58 +0300 |
commit | 6b8412033e680ce6e5c7827ac504adf132305726 (patch) | |
tree | 0df05d16c324b285610af8910c126b58f4c490c5 /uitest/src/com/vaadin/tests/layouts | |
parent | 9192b0bb5e5e699b506b3d3e7df4cf295fbea44a (diff) | |
download | vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.tar.gz vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.zip |
Build uitest war with maven
Change-Id: I32625901ca27a282253df44c6e776cf9632bacda
Diffstat (limited to 'uitest/src/com/vaadin/tests/layouts')
126 files changed, 0 insertions, 8890 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java b/uitest/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java deleted file mode 100644 index b2cadebd02..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; - -public class AbsoluteLayoutAddRemove extends TestBase { - - @Override - protected String getDescription() { - return "Tests that addComponent() and removeComponent() works"; - } - - @Override - protected Integer getTicketNumber() { - return 2915; - } - - @Override - protected void setup() { - Layout main = getLayout(); - - final Label l = new Label("A Label"); - final AbsoluteLayout al = new AbsoluteLayout(); - al.setWidth("300px"); - al.setHeight("200px"); - main.addComponent(al); - - final Button b = new Button("Add", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (l.getParent() == null) { - al.addComponent(l); - event.getButton().setCaption("Remove"); - } else { - al.removeComponent(l); - event.getButton().setCaption("Add"); - } - - } - - }); - main.addComponent(b); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayouts.java b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayouts.java deleted file mode 100644 index 74cfe12ad7..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayouts.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class CaptionsInLayouts extends AbstractTestUI { - - private static final Object CAPTION = "CAPTION"; - private static final Object CLASS = "C"; - private static final Object WIDTH = "W"; - - private NativeSelect layoutSelect; - private Layout layout; - private VerticalLayout verticalLayout; - private HorizontalLayout horizontalLayout; - private GridLayout gridLayout; - private FormLayout formLayout; - private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>(); - private CssLayout cssLayout; - private HorizontalLayout layoutParent = new HorizontalLayout(); - - @Override - protected void setup(VaadinRequest request) { - // setTheme("tests-tickets"); - addComponent(createLayoutSelect()); - addComponent(toggleRequired()); - // addComponent(toggleCaptions()); - addComponent(toggleError()); - addComponent(toggleIcon()); - addComponent(addCaptionText()); - layoutParent.addComponent(new NativeButton("Button right of layout")); - addComponent(layoutParent); - addComponent(new NativeButton("Button below layout")); - createComponents(); - layoutSelect.setValue(layoutSelect.getItemIds().iterator().next()); - } - - private Component addCaptionText() { - Button b = new Button("Add caption text"); - b.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - prependCaptions("a"); - } - }); - return b; - } - - protected void prependCaptions(String prepend) { - for (AbstractField<?> c : components) { - c.setCaption(prepend + c.getCaption()); - } - - } - - private Component toggleRequired() { - CheckBox requiredToggle = new CheckBox(); - requiredToggle.setImmediate(true); - requiredToggle.setCaption("Required"); - requiredToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setRequired((Boolean) event.getProperty().getValue()); - } - }); - return requiredToggle; - } - - private Component toggleIcon() { - CheckBox iconToggle = new CheckBox(); - iconToggle.setImmediate(true); - iconToggle.setCaption("Icons"); - iconToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setIcon((Boolean) event.getProperty().getValue()); - } - }); - return iconToggle; - } - - protected void setRequired(boolean value) { - for (AbstractField<?> c : components) { - c.setRequired(value); - } - - } - - protected void setIcon(boolean value) { - for (AbstractField<?> c : components) { - if (!value) { - c.setIcon(null); - } else { - c.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - } - } - - } - - private Component toggleError() { - CheckBox errorToggle = new CheckBox(); - errorToggle.setImmediate(true); - errorToggle.setCaption("Error"); - errorToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setError((Boolean) event.getProperty().getValue()); - } - }); - return errorToggle; - } - - protected void setError(boolean value) { - for (AbstractField<?> c : components) { - if (value) { - c.setComponentError(new UserError("error")); - } else { - c.setComponentError(null); - - } - } - - } - - private void createComponents() { - TextField tfUndefWide = new TextField( - "Undefined wide text field with a very long caption, longer than the field and the layout. Lorem ipsum dolor sit amet."); - TextField tf100pxWide = new TextField( - "100 px wide text field with a very long caption, longer than 100px."); - tf100pxWide.setWidth("100px"); - - TextField tf500pxWide = new TextField( - "500 px wide text field with a very long caption, longer than 500px. Lorem ipsum dolor sit amet, consectetur adipiscing elit."); - tf500pxWide.setWidth("500px"); - - components.add(tfUndefWide); - components.add(tf100pxWide); - components.add(tf500pxWide); - - } - - private void setLayout(Layout newLayout) { - if (layout == null) { - layoutParent.addComponent(newLayout, 0); - } else { - layoutParent.replaceComponent(layout, newLayout); - } - layout = newLayout; - - for (Component c : components) { - if (c.getParent() != layout) { - layout.addComponent(c); - } - } - - } - - private Layout getLayout(String caption, - Class<? extends Layout> layoutClass, String width) { - Layout l; - if (layoutClass == VerticalLayout.class) { - if (verticalLayout == null) { - verticalLayout = new VerticalLayout(); - verticalLayout.setStyleName("borders"); - } - l = verticalLayout; - } else if (layoutClass == HorizontalLayout.class) { - if (horizontalLayout == null) { - horizontalLayout = new HorizontalLayout(); - horizontalLayout.setStyleName("borders"); - } - l = horizontalLayout; - } else if (layoutClass == GridLayout.class) { - if (gridLayout == null) { - gridLayout = new GridLayout(); - gridLayout.setStyleName("borders"); - } - l = gridLayout; - } else if (layoutClass == CssLayout.class) { - if (cssLayout == null) { - cssLayout = new CssLayout(); - cssLayout.setStyleName("borders"); - } - l = cssLayout; - } else if (layoutClass == FormLayout.class) { - if (formLayout == null) { - formLayout = new FormLayout(); - formLayout.setStyleName("borders"); - } - l = formLayout; - } else { - return null; - } - - l.setCaption(caption); - if (width.equals("auto")) { - width = null; - } - - l.setWidth(width); - - // addComponent(l); - - return l; - } - - private Component createLayoutSelect() { - layoutSelect = new NativeSelect("Layout"); - layoutSelect.addContainerProperty(CAPTION, String.class, ""); - layoutSelect.addContainerProperty(CLASS, Class.class, ""); - layoutSelect.addContainerProperty(WIDTH, String.class, ""); - layoutSelect.setItemCaptionPropertyId(CAPTION); - layoutSelect.setNullSelectionAllowed(false); - - for (Class<?> cls : new Class[] { HorizontalLayout.class, - VerticalLayout.class, GridLayout.class, CssLayout.class, - FormLayout.class }) { - for (String width : new String[] { "400px", "auto" }) { - Object id = layoutSelect.addItem(); - Item i = layoutSelect.getItem(id); - i.getItemProperty(CAPTION).setValue( - cls.getSimpleName() + ", " + width); - i.getItemProperty(CLASS).setValue(cls); - i.getItemProperty(WIDTH).setValue(width); - } - - } - layoutSelect.setImmediate(true); - layoutSelect.addListener(new ValueChangeListener() { - - @Override - @SuppressWarnings("unchecked") - public void valueChange(ValueChangeEvent event) { - Item i = layoutSelect.getItem(event.getProperty().getValue()); - - setLayout(getLayout((String) i.getItemProperty(CAPTION) - .getValue(), (Class<? extends Layout>) i - .getItemProperty(CLASS).getValue(), (String) i - .getItemProperty(WIDTH).getValue())); - } - }); - - return layoutSelect; - } - - @Override - protected String getTestDescription() { - return "Tests what happens when the caption changes in various layouts. Behavior should be consistent."; - } - - @Override - protected Integer getTicketNumber() { - return 5424; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java deleted file mode 100644 index ec323f2db2..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java +++ /dev/null @@ -1,375 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.DateField; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.PasswordField; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class CaptionsInLayoutsWaiAria extends TestBase { - - private static final Object CAPTION = "CAPTION"; - private static final Object CLASS = "C"; - private static final Object WIDTH = "W"; - - private NativeSelect layoutSelect; - private Layout layout; - private VerticalLayout verticalLayout; - private HorizontalLayout horizontalLayout; - private GridLayout gridLayout; - private FormLayout formLayout; - private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>(); - private CssLayout cssLayout; - private HorizontalLayout layoutParent = new HorizontalLayout(); - - @Override - protected void setup() { - // setTheme("tests-tickets"); - addComponent(createLayoutSelect()); - addComponent(toggleRequired()); - // addComponent(toggleCaptions()); - // addComponent(toggleError()); - addComponent(toggleIcon()); - addComponent(toggleReadOnly()); - addComponent(toggleInvalid()); - addComponent(toggleEnabled()); - addComponent(addCaptionText()); - // layoutParent.addComponent(new - // NativeButton("Button right of layout")); - addComponent(layoutParent); - // addComponent(new NativeButton("Button below layout")); - createComponents(); - layoutSelect.setValue(layoutSelect.getItemIds().iterator().next()); - } - - private Component addCaptionText() { - Button b = new Button("Add caption text"); - b.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - prependCaptions("a"); - } - }); - return b; - } - - protected void prependCaptions(String prepend) { - for (AbstractField<?> c : components) { - c.setCaption(prepend + c.getCaption()); - } - - } - - private Component toggleRequired() { - CheckBox requiredToggle = new CheckBox(); - requiredToggle.setImmediate(true); - requiredToggle.setCaption("Required"); - requiredToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setRequired((Boolean) event.getProperty().getValue()); - } - }); - return requiredToggle; - } - - private Component toggleIcon() { - CheckBox iconToggle = new CheckBox(); - iconToggle.setImmediate(true); - iconToggle.setCaption("Icons"); - iconToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setIcon((Boolean) event.getProperty().getValue()); - } - }); - return iconToggle; - } - - private Component toggleReadOnly() { - CheckBox readOnlyToggle = new CheckBox(); - readOnlyToggle.setImmediate(true); - readOnlyToggle.setCaption("Read only"); - readOnlyToggle.addValueChangeListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - setReadOnly((Boolean) event.getProperty().getValue()); - } - }); - - return readOnlyToggle; - } - - private Component toggleEnabled() { - CheckBox enabledToggle = new CheckBox(); - enabledToggle.setImmediate(true); - enabledToggle.setValue(true); - enabledToggle.setCaption("Enabled"); - enabledToggle.addValueChangeListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - setEnabled((Boolean) event.getProperty().getValue()); - } - }); - - return enabledToggle; - } - - private Component toggleInvalid() { - CheckBox invalid = new CheckBox("Invalid"); - invalid.setImmediate(true); - invalid.addValueChangeListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - setInvalid((Boolean) event.getProperty().getValue()); - } - }); - - return invalid; - } - - protected void setInvalid(boolean value) { - UserError userError = null; - if (value) { - userError = new UserError( - "Der eingegebene Wert ist nicht zulässig!"); - } - - for (AbstractField<?> c : components) { - c.setComponentError(userError); - } - } - - protected void setRequired(boolean value) { - for (AbstractField<?> c : components) { - c.setRequired(value); - } - - } - - protected void setIcon(boolean value) { - for (AbstractField<?> c : components) { - if (!value) { - c.setIcon(null); - } else { - c.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - } - } - - } - - protected void setReadOnly(boolean value) { - for (AbstractField<?> c : components) { - c.setReadOnly(value); - } - } - - protected void setEnabled(boolean value) { - for (AbstractField<?> c : components) { - c.setEnabled(value); - } - } - - private Component toggleError() { - CheckBox errorToggle = new CheckBox(); - errorToggle.setImmediate(true); - errorToggle.setCaption("Error"); - errorToggle.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - setError((Boolean) event.getProperty().getValue()); - } - }); - return errorToggle; - } - - protected void setError(boolean value) { - for (AbstractField<?> c : components) { - if (value) { - c.setComponentError(new UserError("error")); - } else { - c.setComponentError(null); - - } - } - - } - - private void createComponents() { - components.add(new TextField("Default TextBox")); - components.add(new TextArea("Default TextArea.")); - // components.add(new RichTextArea("Default RichtTextArea")); - components.add(new PasswordField("Default Password")); - components.add(new DateField("Default DateField")); - - // PopupDateField popupDateField = new - // PopupDateField("Default DateField"); - // popupDateField.setTextFieldEnabled(false); - // components.add(popupDateField); - - components.add(new CheckBox("Default CheckBox")); - - ComboBox comboBox = new ComboBox("Default ComboBox"); - comboBox.addItem("Item1"); - components.add(comboBox); - - OptionGroup radioGroup = new OptionGroup("Single Items"); - radioGroup.addItem("Single Item 1"); - radioGroup.addItem("Single Item 2"); - radioGroup.setMultiSelect(false); - components.add(radioGroup); - - OptionGroup checkGroup = new OptionGroup("Multi Items"); - checkGroup.addItem("Multi Item 1"); - checkGroup.addItem("Multi Item 2"); - checkGroup.setMultiSelect(true); - components.add(checkGroup); - - // Tree tree = new Tree(); - // tree.setCaption("tree"); - // tree.addItem("single item"); - // components.add(tree); - } - - private void setLayout(Layout newLayout) { - if (layout == null) { - layoutParent.addComponent(newLayout, 0); - } else { - layoutParent.replaceComponent(layout, newLayout); - } - layout = newLayout; - - for (Component c : components) { - if (c.getParent() != layout) { - layout.addComponent(c); - } - } - - } - - private Layout getLayout(String caption, - Class<? extends Layout> layoutClass, String width) { - Layout l; - if (layoutClass == VerticalLayout.class) { - if (verticalLayout == null) { - verticalLayout = new VerticalLayout(); - verticalLayout.setStyleName("borders"); - } - l = verticalLayout; - } else if (layoutClass == HorizontalLayout.class) { - if (horizontalLayout == null) { - horizontalLayout = new HorizontalLayout(); - horizontalLayout.setStyleName("borders"); - } - l = horizontalLayout; - } else if (layoutClass == GridLayout.class) { - if (gridLayout == null) { - gridLayout = new GridLayout(); - gridLayout.setStyleName("borders"); - } - l = gridLayout; - } else if (layoutClass == CssLayout.class) { - if (cssLayout == null) { - cssLayout = new CssLayout(); - cssLayout.setStyleName("borders"); - } - l = cssLayout; - } else if (layoutClass == FormLayout.class) { - if (formLayout == null) { - formLayout = new FormLayout(); - formLayout.setStyleName("borders"); - } - l = formLayout; - } else { - return null; - } - - l.setCaption(caption); - if (width.equals("auto")) { - width = null; - } - - l.setWidth(width); - - // addComponent(l); - - return l; - } - - private Component createLayoutSelect() { - layoutSelect = new NativeSelect("Layout"); - layoutSelect.addContainerProperty(CAPTION, String.class, ""); - layoutSelect.addContainerProperty(CLASS, Class.class, ""); - layoutSelect.addContainerProperty(WIDTH, String.class, ""); - layoutSelect.setItemCaptionPropertyId(CAPTION); - layoutSelect.setNullSelectionAllowed(false); - - for (Class<?> cls : new Class[] { HorizontalLayout.class, - VerticalLayout.class, GridLayout.class, CssLayout.class, - FormLayout.class }) { - for (String width : new String[] { "auto" }) { - Object id = layoutSelect.addItem(); - Item i = layoutSelect.getItem(id); - i.getItemProperty(CAPTION).setValue( - cls.getSimpleName() + ", " + width); - i.getItemProperty(CLASS).setValue(cls); - i.getItemProperty(WIDTH).setValue(width); - } - - } - layoutSelect.setImmediate(true); - layoutSelect.addListener(new ValueChangeListener() { - - @Override - @SuppressWarnings("unchecked") - public void valueChange(ValueChangeEvent event) { - Item i = layoutSelect.getItem(event.getProperty().getValue()); - - setLayout(getLayout((String) i.getItemProperty(CAPTION) - .getValue(), (Class<? extends Layout>) i - .getItemProperty(CLASS).getValue(), (String) i - .getItemProperty(WIDTH).getValue())); - } - }); - - return layoutSelect; - } - - @Override - protected String getDescription() { - return "Tests what happens when the caption changes in various layouts. Behavior should be consistent."; - } - - @Override - protected Integer getTicketNumber() { - return 5424; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/uitest/src/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java deleted file mode 100644 index 4fa93e27b9..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.server.Sizeable; -import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase { - private int cols; - - @Override - protected String getDescription() { - return "Buttons should stay stacked on left when clicking new button"; - } - - @Override - protected Integer getTicketNumber() { - return 5227; - } - - @Override - public void init() { - final VerticalLayout mainLayout = new VerticalLayout(); - - mainLayout.setSpacing(true); - mainLayout.setMargin(true); - mainLayout.setHeight(100, Sizeable.UNITS_PERCENTAGE); - mainLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE); - setMainWindow(new LegacyWindow("Vaadin Test", mainLayout)); - - cols = 1; - final GridLayout gl = new GridLayout(cols, 3); - gl.setWidth("1000px"); - // textfield spreads across all cols - final TextField textfield = new TextField(); - textfield.setWidth(100, Sizeable.UNITS_PERCENTAGE); - Button b1 = new Button("new button"); - Button b2 = new Button("nothing"); - gl.addComponent(textfield, 0, 0); - gl.addComponent(b1, 0, 1); - gl.addComponent(b2, 0, 2); - b1.setWidth(270, Sizeable.UNITS_PIXELS); - b2.setWidth(270, Sizeable.UNITS_PIXELS); - b1.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - cols++; - gl.setColumns(cols); - Button b1 = new Button("new button" + cols); - Button b2 = new Button("nothing" + cols); - gl.addComponent(b1, cols - 1, 1); - gl.addComponent(b2, cols - 1, 2); - b1.setWidth(270, Sizeable.UNITS_PIXELS); - b2.setWidth(270, Sizeable.UNITS_PIXELS); - // adjust expand ratios... - if (cols > 0) { - // next to last colum 0, last column 100 - gl.setColumnExpandRatio(cols - 2, 0); - gl.setColumnExpandRatio(cols - 1, 100); - } - gl.removeComponent(textfield); - gl.addComponent(textfield, 0, 0, cols - 1, 0); - } - }); - gl.setSizeFull(); - mainLayout.addComponent(gl); - mainLayout.setExpandRatio(gl, 100); - Button restart = new Button("restart"); - mainLayout.addComponent(restart); - restart.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - close(); - } - }); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java deleted file mode 100644 index e5430a09af..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java +++ /dev/null @@ -1,38 +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.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Label; - -public class CssLayoutAbsoluteUrl extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - Label label = new Label("Hello"); - label.setId("myLabel"); - addComponent(new CssLayout(label) { - @Override - protected String getCss(Component c) { - return "color: blue; background-image: url(\"about:blank\");"; - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java deleted file mode 100644 index 1821acdbfa..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java +++ /dev/null @@ -1,39 +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.layouts; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class CssLayoutAbsoluteUrlTest extends SingleBrowserTest { - @Test - public void testAboutBlankStyle() { - openTestURL(); - - WebElement myLabel = findElement(By.id("myLabel")); - - String backgroundImage = myLabel.getCssValue("background-image"); - - // Not testing string equality since some browsers return the style with - // quotes around the url argument and some without quotes. - Assert.assertTrue(backgroundImage + " does not contain 'about:blank'", - backgroundImage.contains("about:blank")); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutCustomCss.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutCustomCss.java deleted file mode 100644 index 2f717d2b64..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutCustomCss.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -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.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.NativeButton; - -public class CssLayoutCustomCss extends TestBase implements ClickListener { - - protected Map<Component, String> css = new HashMap<Component, String>(); - private CssLayout layout; - - @Override - protected void setup() { - setTheme("tests-tickets"); - layout = new CssLayout() { - @Override - protected String getCss(com.vaadin.ui.Component c) { - return css.get(c); - } - }; - layout.setSizeFull(); - addComponent(layout); - - Button red, green; - layout.addComponent(red = createButton("color:red")); - layout.addComponent(createButton("color: blue")); - layout.addComponent(green = createButton("color: green")); - - red.click(); - green.click(); - layout.addComponent(createMarginsToggle()); - } - - private Component createMarginsToggle() { - final CheckBox cb = new CheckBox("Margins"); - cb.setImmediate(true); - cb.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - ((MarginHandler) layout).setMargin(cb.getValue()); - } - }); - - return cb; - } - - private Button createButton(String string) { - NativeButton button = new NativeButton(string); - css.put(button, string); - button.addListener(this); - return button; - } - - @Override - protected String getDescription() { - // TODO Auto-generated method stub - return null; - } - - @Override - protected Integer getTicketNumber() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - if (b.getCaption().contains("not ")) { - b.setCaption(b.getCaption().substring(4)); - css.put(b, b.getCaption()); - } else { - css.remove(b); - b.setCaption("not " + b.getCaption()); - } - layout.markAsDirty(); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java deleted file mode 100644 index 093dc782fb..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.layouts; - -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.CssLayout; -import com.vaadin.ui.TextField; - -@SuppressWarnings("serial") -public class CssLayoutRemoveComponent extends TestBase { - - @Override - protected void setup() { - final CssLayout layout = new CssLayout(); - final TextField tf = new TextField("Caption1"); - Button b = new Button("Remove field ", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.removeComponent(tf); - } - - }); - layout.addComponent(tf); - layout.addComponent(b); - layout.addComponent(new TextField("Caption2")); - layout.addComponent(new TextField("Caption3")); - - addComponent(layout); - } - - @Override - protected String getDescription() { - return "Clicking on the button should remove one text field but other textfields and their captions should stay intact."; - } - - @Override - protected Integer getTicketNumber() { - return 5778; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java deleted file mode 100644 index df4fc8615d..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.layouts; - -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.CssLayout; -import com.vaadin.ui.TextField; - -public class CssLayoutRemoveComponentWithCaption extends TestBase { - - @Override - protected void setup() { - final CssLayout layout = new CssLayout(); - final TextField tf = new TextField("Caption"); - Button b = new Button("Remove field and add new", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.removeComponent(tf); - addComponent(new TextField("new field")); - - } - - }); - layout.addComponent(tf); - layout.addComponent(b); - - addComponent(layout); - } - - @Override - protected String getDescription() { - return "Clicking on the button should remove the text field and add a new 'new field' text field"; - } - - @Override - protected Integer getTicketNumber() { - return 4204; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java deleted file mode 100644 index ed3c5e66d3..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.layouts; - -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.CssLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; - -public class CssLayoutSizeChangePropagation extends TestBase { - - @Override - protected void setup() { - getLayout().setSizeFull(); - final VerticalLayout sp = new VerticalLayout(); - - sp.setHeight("100%"); - - final CssLayout cssLayout = new CssLayout() { - @Override - protected String getCss(Component c) { - return "background-color: yellow;"; - } - }; - cssLayout.setSizeFull(); - Label l = new Label("bö"); - l.setSizeFull(); - cssLayout.addComponent(l); - - sp.addComponent(cssLayout); - - Button button = new Button("b"); - button.addListener(new ClickListener() { - boolean bool = true; - - @Override - public void buttonClick(ClickEvent event) { - sp.setExpandRatio(cssLayout, bool ? 1 : 0); - bool = !bool; - } - }); - - sp.addComponent(button); - sp.setExpandRatio(button, 1); - - getLayout().addComponent(sp); - - } - - @Override - protected String getDescription() { - return "Upper part of view should become yellow on button click."; - } - - @Override - protected Integer getTicketNumber() { - return 4351; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/DeepComponentTrees.java b/uitest/src/com/vaadin/tests/layouts/DeepComponentTrees.java deleted file mode 100644 index 643612d254..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/DeepComponentTrees.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class DeepComponentTrees extends TestBase { - - private Panel root; - - @Override - protected String getDescription() { - return "Vaadin should not choke on deep component trees. 15 levels should be minimum to survive."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - private int i = 0; - private Class<?> currentValue = VerticalLayout.class; - - @Override - protected void setup() { - Layout main = getLayout(); - main.setSizeUndefined(); - getMainWindow().getContent().setHeight(null); - - Label l = new Label( - "This is a nice game to guess how many Layouts your FF2 (or any other browser) can deal with. Due to the worldwide attempt to decrease energy consumption, playing this game is only allowed above 60° longitude betwheen August and May (as excess energy consumed by you CPU is used to heat your room). It is considered wise to save all your work before starting the game."); - - VerticalLayout rootLayout = new VerticalLayout(); - rootLayout.setMargin(true); - root = new Panel("Test box", rootLayout); - root.setWidth("600px"); - root.setHeight("200px"); - final Button b = new Button("Go try your luck with " + i + " layouts!"); - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - FF2KILLER(i++); - b.setCaption("Go try your luck with " + i + " layouts!"); - } - - }); - - final ComboBox s = new ComboBox("Restart game with select:"); - s.setNullSelectionAllowed(false); - s.addItem("-- Choose value --"); - s.setValue("-- Choose value --"); - s.addItem(VerticalLayout.class); - s.addItem(HorizontalLayout.class); - s.addItem(GridLayout.class); - s.addListener(new ComboBox.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - Object value = s.getValue(); - if (!value.equals("-- Choose value --")) { - currentValue = (Class<?>) value; - i = 0; - s.setValue("-- Choose value --"); - b.setCaption("Go try your luck with " + i + " layouts!"); - } - - } - }); - s.setImmediate(true); - - main.addComponent(l); - main.addComponent(b); - main.addComponent(s); - main.addComponent(root); - - } - - private void FF2KILLER(int layouts) { - Layout layout = getTestLayout(); - Layout r = layout; - for (int i = 0; i < layouts; i++) { - Layout lo = getTestLayout(); - layout.addComponent(lo); - layout = lo; - } - layout.addComponent(new Label( - "FF did it! Vaadin, Mozilla and you win! Dare to try again?")); - root.setContent(r); - } - - Layout getTestLayout() { - Layout l = new VerticalLayout(); - if (currentValue == GridLayout.class) { - l = new GridLayout(1, 1); - } else { - try { - l = (Layout) currentValue.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return l; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/uitest/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java deleted file mode 100644 index f596fdb77e..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.TextArea; - -public class FormLayoutWithInvisibleComponent extends TestBase { - - private TextArea messages; - - @Override - protected String getDescription() { - return "There is an initial invisible text field below the checkbox. Checking the checkbox should show the field as a textarea (40x10) and also show its caption(\"Messages visible\") and a required error (*)."; - } - - @Override - protected Integer getTicketNumber() { - return 2706; - } - - @Override - protected void setup() { - FormLayout formLayout = new FormLayout(); - CheckBox control = new CheckBox("Messages On/Off"); - control.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - messages.setVisible((Boolean) event.getProperty().getValue()); - messages.setRequired(true); - messages.setCaption("Messages visible"); - } - - }); - control.setImmediate(true); - formLayout.addComponent(control); - - messages = new TextArea("Messages hidden"); - messages.setRows(10); - messages.setColumns(40); - messages.setVisible(false); - messages.setEnabled(false); - formLayout.addComponent(messages); - - addComponent(formLayout); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutCaptions.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutCaptions.java deleted file mode 100644 index 923f91f246..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutCaptions.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.data.Item; -import com.vaadin.data.Validator; -import com.vaadin.data.util.BeanItem; -import com.vaadin.server.AbstractErrorMessage; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.FormFieldFactory; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class GridLayoutCaptions extends TestBase { - - class CustomForm extends Form { - private com.vaadin.ui.GridLayout layout; - - private VerticalLayout wrapper = new VerticalLayout(); - private CssLayout wrapper2 = new CssLayout(); - - private FormFieldFactory fff = new FormFieldFactory() { - - @Override - public Field<?> createField(Item item, Object propertyId, - Component uiContext) { - - if (propertyId.equals(DataPOJO.Fields.name.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, - propertyId, uiContext); - f.setCaption("This is a long caption for the name field"); - return f; - - } else if (propertyId.equals(DataPOJO.Fields.hp.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, - propertyId, uiContext); - f.setCaption("This is a long caption for the HP field, but it has a VL as a wrapper"); - - return f; - - } else if (propertyId.equals(DataPOJO.Fields.place.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, - propertyId, uiContext); - f.setCaption("This is a long caption for the Place field, but it has a CSSLo as a wrapper"); - - return f; - - } else if (propertyId.equals(DataPOJO.Fields.price.name())) { - Field<?> f = DefaultFieldFactory.get().createField(item, - propertyId, uiContext); - f.setCaption("With size undefined the caption behaves like this..."); - f.setSizeFull(); - - return f; - - } else { - return DefaultFieldFactory.get().createField(item, - propertyId, uiContext); - } - } - }; - - public CustomForm() { - super(); - layout = new GridLayout(3, 3); - layout.addComponent(wrapper, 1, 0); - layout.addComponent(wrapper2, 2, 0); - layout.setSpacing(true); - - setLayout(layout); - setFormFieldFactory(fff); - - Label l = new Label("A label with caption"); - l.setCaption("A really long caption that is clipped"); - - layout.addComponent(l, 0, 2); - - Label l2 = new Label("A wrapped label with caption"); - l2.setCaption("A really long caption that is not clipped"); - - VerticalLayout vl = new VerticalLayout(); - vl.addComponent(l2); - - layout.addComponent(vl, 1, 2); - - } - - public void createErrors() { - Validator.InvalidValueException ive = new Validator.InvalidValueException( - "Ipsum lipsum laarum lop... "); - - for (Object propIDs : getItemDataSource().getItemPropertyIds()) { - ((TextField) getField(propIDs)) - .setComponentError(AbstractErrorMessage - .getErrorMessageForException(ive)); - - } - - } - - public void clearErrors() { - for (Object propIDs : getItemDataSource().getItemPropertyIds()) { - ((TextField) getField(propIDs)).setComponentError(null); - - } - } - - @Override - protected void attachField(Object propertyId, Field field) { - - if (propertyId.equals(DataPOJO.Fields.name.name())) { - layout.addComponent(field, 0, 0); - - } else if (propertyId.equals(DataPOJO.Fields.hp.name())) { - wrapper.removeAllComponents(); - wrapper.addComponent(field); - } else if (propertyId.equals(DataPOJO.Fields.place.name())) { - wrapper2.removeAllComponents(); - wrapper2.addComponent(field); - } else if (propertyId.equals(DataPOJO.Fields.price.name())) { - layout.addComponent(field, 0, 1); - } - - } - } - - public static class DataPOJO { - - public enum Fields { - name, price, hp, place; - } - - private String name; - private int price; - private String hp; - private String place; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getPrice() { - return price; - } - - public void setPrice(int price) { - this.price = price; - } - - public String getHp() { - return hp; - } - - public void setHp(String hp) { - this.hp = hp; - } - - public String getPlace() { - return place; - } - - public void setPlace(String place) { - this.place = place; - } - - } - - @Override - protected void setup() { - LegacyWindow mainWindow = getMainWindow(); - - Label label = new Label("Hello Vaadin user"); - mainWindow.addComponent(label); - - DataPOJO forDemo = new DataPOJO(); - - BeanItem<DataPOJO> bi = new BeanItem<DataPOJO>(forDemo); - - final CustomForm aFormWithGl = new CustomForm(); - - aFormWithGl.setItemDataSource(bi); - - mainWindow.addComponent(aFormWithGl); - - Button b = new Button("Give me an error!", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - aFormWithGl.createErrors(); - - } - }); - mainWindow.addComponent(b); - - Button b2 = new Button("Get rid of an error!", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - aFormWithGl.clearErrors(); - - } - }); - mainWindow.addComponent(b2); - - } - - @Override - protected String getDescription() { - return "Captions in Gridlayout behaves differently than in other layouts"; - } - - @Override - protected Integer getTicketNumber() { - return 5424; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java deleted file mode 100644 index 4bf33903a1..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.vaadin.tests.layouts; - -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.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class GridLayoutExpandRatioModification extends TestBase implements - ClickListener { - - private boolean isVisible = false; - private GridLayout mainLayout; - private VerticalLayout vl1; - private VerticalLayout vl2; - private Button button; - - @Override - public void setup() { - LegacyWindow main = getMainWindow(); - - mainLayout = new GridLayout(3, 3); - main.setContent(mainLayout); - - // The upper layout - vl1 = new VerticalLayout(); - Label label1 = new Label("The upper/left layout"); - vl1.addComponent(label1); - - // Button that hides or shows the bottom part - button = new Button("show / hide", this); - - // The bottom layout - vl2 = new VerticalLayout(); - TextField tf = new TextField("The bottom/right field"); - tf.setHeight("100%"); - tf.setWidth("100%"); - vl2.addComponent(tf); - - // Add everything to the view - mainLayout.addComponent(vl1, 0, 0); - mainLayout.addComponent(button, 1, 1); - mainLayout.addComponent(vl2, 2, 2); - - // Set expand ratios, hide lower - mainLayout.setRowExpandRatio(0, 1); - mainLayout.setColumnExpandRatio(0, 1); - mainLayout.setRowExpandRatio(2, 0); - mainLayout.setColumnExpandRatio(2, 0); - - // Maximize everything - main.setSizeFull(); - mainLayout.setSizeFull(); - vl1.setSizeFull(); - vl2.setSizeFull(); - } - - @Override - public void buttonClick(ClickEvent event) { - if (isVisible) { - mainLayout.setRowExpandRatio(2, 0); - mainLayout.setColumnExpandRatio(2, 0); - isVisible = false; - } else { - mainLayout.setRowExpandRatio(2, 1); - mainLayout.setColumnExpandRatio(2, 1); - isVisible = true; - } - } - - @Override - protected String getDescription() { - return "Changing the expand ratio should repaint the layout correctly. Changing from 0 to something else should render the previously invisible component"; - } - - @Override - protected Integer getTicketNumber() { - return 2454; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java deleted file mode 100644 index 524799ab3c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class GridLayoutInsidePanel extends TestBase { - - @Override - protected String getDescription() { - return "The first Panel contains a VerticalLayout, which contains a GridLayout, which contains a Label. The second panel directly contains a GridLayout, which contains a Label. Both should be rendered in the same way."; - } - - @Override - protected Integer getTicketNumber() { - return 2652; - } - - @Override - protected void setup() { - { - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - gl.addComponent(new Label( - "A label which defines the size of the GL")); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - pl.setSizeUndefined(); - Panel p = new Panel("Panel 1", pl); - pl.setMargin(false); - p.setSizeUndefined(); - - pl.addComponent(gl); - addComponent(p); - } - { - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - gl.addComponent(new Label( - "A label which defines the size of the GL")); - - Panel p = new Panel("Panel 2", gl); - gl.setMargin(false); - p.setSizeUndefined(); - gl.setSizeUndefined(); - - addComponent(p); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java deleted file mode 100644 index bdda348005..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; - -public class GridLayoutInsidePanel2 extends LegacyApplication { - - private Layout layout; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow("Main"); - setMainWindow(w); - layout = (Layout) w.getContent(); - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - Label l = new Label("This should be visible"); - l.setWidth("100px"); - gl.addComponent(l); - - layout.setSizeUndefined(); - layout.addComponent(gl); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutNPE.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutNPE.java deleted file mode 100644 index 3531a4e13c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutNPE.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; - -public class GridLayoutNPE extends TestBase { - - @Override - protected void setup() { - final VerticalLayout lo = new VerticalLayout(); - - final GridLayout gl = new GridLayout(2, 1); - gl.setSpacing(true); - - final Label toRemove = new Label("First"); - gl.addComponent(toRemove); - final Label toEdit = new Label("Second"); - gl.addComponent(toEdit); - - final Button b = new Button("remove 'First'"); - final Button b2 = new Button("edit 'Second'"); - b2.setVisible(false); - - lo.addComponent(gl); - lo.addComponent(b); - lo.addComponent(b2); - - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(Button.ClickEvent event) { - gl.removeComponent(toRemove); - - // move another component to where the first was removed - // before rendering to the client - gl.removeComponent(toEdit); - // this could also be the result of removeAllComponents() - // followed by a loop of addComponent(c) - gl.addComponent(toEdit, 0, 0); - - b.setVisible(false); - b2.setVisible(true); - - } - - }); - - b2.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - toEdit.setValue("Second (edited)"); - } - - }); - - addComponent(lo); - } - - @Override - protected String getDescription() { - return "VGridLayout throws an NPE, causing client side to crash"; - } - - @Override - protected Integer getTicketNumber() { - return 4019; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java deleted file mode 100644 index 5d45f72142..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; - -/** - * Tests removing rows from a GridLayout - */ -@SuppressWarnings("serial") -public class GridLayoutRemoveFinalRow extends TestBase { - - @Override - protected void setup() { - getLayout().setSpacing(true); - - final GridLayout layout = new GridLayout(2, 2); - layout.setSpacing(true); - layout.addComponent(new Label("Label1")); - layout.addComponent(new Label("Label2")); - layout.addComponent(new Label("Label3")); - layout.addComponent(new Label("Label4")); - addComponent(layout); - - Button removeRowBtn = new Button("Remove row", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - layout.removeRow(0); - } - }); - addComponent(removeRowBtn); - } - - @Override - protected String getDescription() { - return "Removing last row of a GridLayout throws a IllegalArgumentException"; - } - - @Override - protected Integer getTicketNumber() { - return 4542; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java b/uitest/src/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java deleted file mode 100644 index 9753526a9e..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutSpanExpansion.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; - -public class GridLayoutSpanExpansion extends TestBase { - - @Override - protected void setup() { - GridLayout heightSpan = new GridLayout(2, 2); - heightSpan.setHeight("200px"); - heightSpan.setWidth("200px"); - heightSpan.addComponent(new Label("1"), 0, 0); - heightSpan.addComponent(new Label("2"), 0, 1); - heightSpan.addComponent(new Label( - "This is a somewhat long text that spans over a few lines."), - 1, 0, 1, 1); - heightSpan.setRowExpandRatio(1, 1); - addComponent(heightSpan); - - GridLayout widthSpan = new GridLayout(2, 2); - widthSpan.setHeight("100px"); - widthSpan.setWidth("200px"); - widthSpan.addComponent(new Label( - "This is a somewhat long text that spans over both columns."), - 0, 0, 1, 0); - Label label1 = new Label("1"); - label1.setSizeUndefined(); - widthSpan.addComponent(label1, 0, 1); - widthSpan.addComponent(new Label("2"), 1, 1); - widthSpan.setColumnExpandRatio(1, 1); - addComponent(widthSpan); - - GridLayout multipleSpans = new GridLayout(3, 3); - multipleSpans.setWidth("400px"); - multipleSpans.addComponent(new Button("Button 0,0"), 0, 0); - multipleSpans.addComponent(new Button("Button 1,0"), 1, 0); - multipleSpans.addComponent( - makeWideButton("A wide spanning button at 0,1"), 0, 1, 1, 1); - multipleSpans.addComponent( - makeWideButton("Another wide spanning button at 1,2"), 1, 2, 2, - 2); - multipleSpans.setColumnExpandRatio(0, 1); - multipleSpans.setColumnExpandRatio(1, 3); - multipleSpans.setColumnExpandRatio(2, 2); - addComponent(multipleSpans); - } - - private static Button makeWideButton(String caption) { - Button wideButton = new Button(caption); - wideButton.setWidth("100%"); - return wideButton; - } - - @Override - protected String getDescription() { - return "In the two first examples, the 1 and the 2 should be close to each other because of the expansion ratios. In the final example, there should be little extra space in the left column, much extra space in the middle and some extra space to the right"; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf(5868); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java deleted file mode 100644 index 739779a3e0..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; - -public class HiddenHorizontalLayout extends TestBase { - - @Override - protected String getDescription() { - return "Test to verify that toggling layout visibility works properly."; - } - - @Override - protected Integer getTicketNumber() { - return 3183; - } - - @Override - public void setup() { - - VerticalLayout vl = new VerticalLayout(); - vl.setSizeFull(); - getLayout().addComponent(vl); - - final HorizontalLayout hl = new HorizontalLayout(); - hl.setWidth("100%"); - hl.setHeight("30px"); - hl.addComponent(new Label("label1")); - hl.addComponent(new Label("label2")); - hl.addComponent(new Label("label3")); - hl.addComponent(new Label("label4")); - vl.addComponent(hl); - - Label l = new Label("Steps to reproduce with Vaadin 6.0.1:<br/>" - + "1. set browser size smaller than fullscreen<br/>" - + "2. Refresh page with browser<br/>" - + "3. Click \"toggle layout visibility\"<br>" - + "4. Resize browser window to full <br/>" - + "5. Click \"toggle layout visibility\"<br/>", - ContentMode.HTML); - vl.addComponent(l); - Button b = new Button("toggle layout visibility", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - hl.setVisible(!hl.isVisible()); - } - - }); - vl.addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPosition.java b/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPosition.java deleted file mode 100644 index a8a25d03ce..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPosition.java +++ /dev/null @@ -1,65 +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.layouts; - -import com.vaadin.annotations.Theme; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; - -/* - * 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. - */ -@Theme("valo") -public class HorizontalLayoutAndCaretPosition extends AbstractTestUI { - @Override - protected void setup(VaadinRequest request) { - final HorizontalLayout root = new HorizontalLayout(); - root.setSizeFull(); - addComponent(root); - root.addComponent(new TextField()); - - Label l = new Label(); - root.addComponent(l); - root.setExpandRatio(l, 1); - root.addComponent(new TextField()); - } - - @Override - protected String getTestDescription() { - return "Use IE. Enter some text to the text field. Clicking on the text should position the caret where you clicked, not cause it to jump to the start or the end"; - } - - @Override - protected Integer getTicketNumber() { - return 11152; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPositionTest.java b/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPositionTest.java deleted file mode 100644 index df42e292e3..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutAndCaretPositionTest.java +++ /dev/null @@ -1,45 +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.layouts; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class HorizontalLayoutAndCaretPositionTest extends MultiBrowserTest { - - @Test - public void testCaretPositionOnClck() { - openTestURL(); - TextFieldElement first = $(TextFieldElement.class).first(); - // type in some text to the first field - first.click(); - first.sendKeys("test"); - // make sure that the field could be focused and text typed - Assert.assertEquals("Field must be focused on click", "test", - first.getValue()); - // now move the focus to the next text field - $(TextFieldElement.class).get(1).click(); - // and back to the first one - first.click(30, 10); - first.sendKeys("do_not_put_in_beginning_"); - Assert.assertNotEquals("The caret position must be maintained", - "do_not_put_in_beginning_test", first.getValue()); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutWithLabelAndButton.java b/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutWithLabelAndButton.java deleted file mode 100644 index 9381f2caeb..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/HorizontalLayoutWithLabelAndButton.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.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; - -public class HorizontalLayoutWithLabelAndButton extends AbstractTestUIWithLog { - - @Override - protected void setup(VaadinRequest request) { - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - hl.setWidth("100%"); - Label l = new Label(); - l.setCaption("POTUS Database"); - l.setSizeUndefined(); - - Button b = new Button("Add new"); - hl.addComponents(l, b); - b.setStyleName("primary"); - hl.setExpandRatio(b, 1); - - addComponent(hl); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/HtmlInCaption.java b/uitest/src/com/vaadin/tests/layouts/HtmlInCaption.java deleted file mode 100644 index 830b96b3d7..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/HtmlInCaption.java +++ /dev/null @@ -1,159 +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.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.ColorPicker; -import com.vaadin.ui.ColorPickerArea; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Link; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class HtmlInCaption extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - HorizontalLayout main = new HorizontalLayout(); - addComponent(main); - VerticalLayout components = new VerticalLayout(); - components.setId("components"); - VerticalLayout layouts = new VerticalLayout(); - layouts.setId("layouts"); - main.addComponent(layouts); - main.addComponent(components); - - createComponents(components); - createLayouts(layouts); - - Window w = new Window(); - w.setCaption(getTextCaption("Window")); - w.setPositionX(600); - addWindow(w); - - w = new Window(); - w.setCaptionAsHtml(true); - w.setCaption(getHtmlCaption("Window")); - w.setPositionX(600); - w.setPositionY(100); - addWindow(w); - } - - private void createLayouts(VerticalLayout layouts) { - VerticalLayout vl = new VerticalLayout(tf(false), tf(true)); - vl.setCaption("VerticalLayout"); - layouts.addComponent(vl); - - HorizontalLayout hl = new HorizontalLayout(tf(false), tf(true)); - hl.setCaption("HorizontalLayout"); - layouts.addComponent(hl); - - GridLayout gl = new GridLayout(2, 1); - gl.setCaption("GridLayout"); - gl.addComponents(tf(false), tf(true)); - layouts.addComponent(gl); - - CssLayout cl = new CssLayout(); - cl.setCaption("CssLayout"); - cl.addComponents(tf(false), tf(true)); - layouts.addComponent(cl); - - AbsoluteLayout al = new AbsoluteLayout(); - al.setCaption("AbsoluteLayout"); - al.setWidth("300px"); - al.setHeight("200px"); - al.addComponent(tf(false), "top:30px"); - al.addComponent(tf(true), "top: 100px"); - layouts.addComponent(al); - } - - private void createComponents(VerticalLayout components) { - createComponent(components, Button.class); - createComponent(components, NativeButton.class); - createComponent(components, CheckBox.class); - createComponent(components, Link.class); - - createComponent(components, Panel.class); - createComponent(components, ColorPicker.class); - createComponent(components, ColorPickerArea.class); - createComponent(components, Form.class); - - } - - private void createComponent(VerticalLayout components, - Class<? extends AbstractComponent> class1) { - AbstractComponent ac; - try { - ac = class1.newInstance(); - ac.setCaption(getTextCaption(class1.getSimpleName())); - components.addComponent(ac); - } catch (Exception e) { - e.printStackTrace(); - } - - try { - ac = class1.newInstance(); - ac.setCaption(getHtmlCaption(class1.getSimpleName())); - ac.setCaptionAsHtml(true); - components.addComponent(ac); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - private Component tf(boolean htmlCaption) { - TextField tf = new TextField(); - if (htmlCaption) { - tf.setCaptionAsHtml(htmlCaption); - tf.setCaption(getHtmlCaption("")); - } else { - tf.setCaption(getTextCaption("")); - } - return tf; - } - - private String getTextCaption(String string) { - return "<b>Plain text " + string + "</b>"; - } - - private String getHtmlCaption(String string) { - return "<b><font color='red'>HTML " + string + "</font></b>"; - } - - @Override - protected Integer getTicketNumber() { - return 9426; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java deleted file mode 100644 index 504ee8b41b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java +++ /dev/null @@ -1,111 +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.layouts; - -import com.vaadin.annotations.Widgetset; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.extensions.LayoutMemoryUsageIE8Extension; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.HasComponents; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; - -@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class IE8MeasuredSizeMemoryLeak extends AbstractTestUI { - - private boolean state = false; - - private HasComponents component1 = new VerticalLayout() { - { - for (int i = 1; i <= 200; i++) { - String idText = "ID:" + i; - Label c = new Label(idText); - c.setId(idText); - addComponent(c); - } - } - }; - - private HasComponents component2 = new VerticalLayout() { - { - for (int i = 201; i <= 400; i++) { - String idText = "ID:" + i; - Label c = new Label(idText); - c.setId(idText); - addComponent(c); - } - } - }; - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. - * VaadinRequest) - */ - @Override - protected void setup(VaadinRequest request) { - new LayoutMemoryUsageIE8Extension().extend(this); - - VerticalLayout layout = new VerticalLayout(); - setContent(layout); - - final VerticalLayout contentLayout = new VerticalLayout(); - - Button button = new Button("Toggle"); - button.setId("toggle"); - button.addClickListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - contentLayout.removeAllComponents(); - if (state) { - contentLayout.addComponent(component1); - } else { - contentLayout.addComponent(component2); - } - state = !state; - } - - }); - - layout.addComponent(button); - layout.addComponent(contentLayout); - - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() - */ - @Override - protected String getTestDescription() { - return "IE8 leaks memory when components are added and removed"; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() - */ - @Override - protected Integer getTicketNumber() { - return 12688; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java deleted file mode 100644 index 33adb622c0..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java +++ /dev/null @@ -1,54 +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.layouts; - -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.testbench.parallel.Browser; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class IE8MeasuredSizeMemoryLeakTest extends MultiBrowserTest { - - @Test - public void testMeasuredSizesMapCleaned() { - openTestURL(); - Assert.assertEquals("No extra measured sizes in the beginning", 3, - getMeasuredSizesMapSize()); - vaadinElementById("toggle").click(); - Assert.assertEquals("Measured sizes after single toggle", 204, - getMeasuredSizesMapSize()); - vaadinElementById("toggle").click(); - Assert.assertEquals("Measured sizes cleaned on toggle", 204, - getMeasuredSizesMapSize()); - } - - private int getMeasuredSizesMapSize() { - JavascriptExecutor jsExec = (JavascriptExecutor) getDriver(); - Number result = (Number) jsExec - .executeScript("return window.vaadin.getMeasuredSizesCount();"); - return result.intValue(); - } - - @Override - public List<DesiredCapabilities> getBrowsersToTest() { - return getBrowserCapabilities(Browser.IE8); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/LayoutPerformanceTests.java b/uitest/src/com/vaadin/tests/layouts/LayoutPerformanceTests.java deleted file mode 100644 index 4e50f0d83b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/LayoutPerformanceTests.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.Iterator; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class LayoutPerformanceTests extends TestBase { - private static final String[] widths = { null, "100%", "200px" }; - - private enum ContainerType { - SIMPLE_WRAPS { - @Override - public ComponentContainer buildLayout(int depth, int leafs, - SampleType leafType, boolean fullHeight) { - if (depth == 0) { - return buildInnerLayout(leafs, leafType, fullHeight); - } - - AbstractOrderedLayout layout = createOrderedLayout(depth, - fullHeight); - layout.addComponent(buildLayout(depth - 1, leafs, leafType, - fullHeight)); - return layout; - } - }, - BORDER_LAYOUT { - @Override - public ComponentContainer buildLayout(int depth, int leafs, - SampleType leafType, boolean fullHeight) { - if (depth == 0) { - return buildInnerLayout(leafs, leafType, fullHeight); - } - - AbstractOrderedLayout layout = createOrderedLayout(depth, - fullHeight); - Component content = leafType.createContent(); - content.setSizeUndefined(); - layout.addComponent(content); - layout.addComponent(buildLayout(depth - 1, leafs, leafType, - fullHeight)); - layout.setExpandRatio(layout.getComponent(1), 1); - return layout; - } - }, - FRACTAL { - @Override - public ComponentContainer buildLayout(int depth, int leafs, - SampleType leafType, boolean fullHeight) { - if (depth == 0) { - return buildInnerLayout(leafs, leafType, fullHeight); - } - - AbstractOrderedLayout layout = createOrderedLayout(depth, - fullHeight); - layout.addComponent(buildLayout(depth - 1, leafs, leafType, - fullHeight)); - layout.addComponent(buildLayout(depth - 1, leafs, leafType, - fullHeight)); - layout.setExpandRatio(layout.getComponent(0), 1); - layout.setExpandRatio(layout.getComponent(1), 2); - return layout; - } - }; - public abstract ComponentContainer buildLayout(int depth, int leafs, - SampleType leafType, boolean fullHeight); - - protected AbstractOrderedLayout createOrderedLayout(int depth, - boolean fullHeight) { - AbstractOrderedLayout layout = (depth % 2) == 0 ? new VerticalLayout() - : new HorizontalLayout(); - layout.setWidth("100%"); - if (fullHeight) { - layout.setHeight("100%"); - } else { - layout.setHeight(null); - } - - return layout; - } - - public ComponentContainer buildInnerLayout(int leafs, - SampleType leafType, boolean fullHeight) { - VerticalLayout layout = new VerticalLayout(); - if (fullHeight) { - layout.setHeight("100%"); - layout.setWidth("100%"); - } - for (int i = 0; i < leafs; i++) { - Component leaf = leafType.createContent(); - if (leaf.getWidth() <= 0) { - leaf.setWidth(widths[i % 3]); - } - layout.addComponent(leaf); - } - return layout; - } - } - - private enum SampleType { - SHORT_LABEL { - @Override - public Component createContent() { - return new Label("Short label"); - } - }, - LONG_LABEL { - @Override - public Component createContent() { - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < 100; i++) { - builder.append("A rather long text. "); - } - return new Label(builder.toString()); - } - }, - BUTTON { - @Override - public Component createContent() { - return new Button("Text"); - } - }, - TEXT_FIELD { - @Override - public Component createContent() { - return new TextField("Field label"); - } - }, - HORIZONTAL_LAYOUT { - @Override - public Component createContent() { - HorizontalLayout layout = new HorizontalLayout(); - layout.addComponent(new Label("Left")); - layout.addComponent(new Label("Right")); - layout.setComponentAlignment(layout.getComponent(1), - Alignment.BOTTOM_RIGHT); - - return layout; - } - }, - WRAPPED_PANEL { - @Override - public Component createContent() { - HorizontalLayout horizontal = new HorizontalLayout(); - horizontal.setWidth("100%"); - horizontal.setHeight(null); - horizontal.setMargin(true); - - VerticalLayout left = new VerticalLayout(); - left.setWidth("100%"); - left.addComponent(new Label("Text 1")); - left.addComponent(new Label("Text 2")); - left.addComponent(new Label("Text 3")); - horizontal.addComponent(left); - - VerticalLayout right = new VerticalLayout(); - right.setWidth("100%"); - right.addComponent(new Label("Text 1")); - right.addComponent(new Label("Text 2")); - right.addComponent(new Label("Text 3")); - horizontal.addComponent(right); - - Panel panel = new Panel(horizontal); - panel.setCaption("Panel caption"); - panel.setWidth("100%"); - panel.setHeight(null); - - return panel; - } - }; - public abstract Component createContent(); - } - - private Component testLayout = new Label(""); - - private final CheckBox wrapInPanel = new CheckBox("Wrap in Panel"); - private final NativeSelect containerSelector = new NativeSelect( - "Wrapping structure", EnumSet.allOf(ContainerType.class)); - @SuppressWarnings("boxing") - private final NativeSelect levels = new NativeSelect("Wrapping depth", - Arrays.asList(0, 1, 2, 3, 4, 5, 10, 15, 20, 25)); - private final NativeSelect leafSelector = new NativeSelect("Leaf type", - EnumSet.allOf(SampleType.class)); - @SuppressWarnings("boxing") - private final NativeSelect childAmount = new NativeSelect("Leaf count", - Arrays.asList(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, - 4096, 8192, 16384)); - - @Override - protected void setup() { - HorizontalLayout controls = new HorizontalLayout(); - controls.setSpacing(true); - - controls.addComponent(wrapInPanel); - controls.addComponent(containerSelector); - controls.addComponent(levels); - controls.addComponent(leafSelector); - controls.addComponent(childAmount); - - controls.addComponent(new Button("Clear", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - setTestLayout(new Label("")); - } - })); - - controls.addComponent(new Button("Apply", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - SampleType leafType = (SampleType) leafSelector.getValue(); - if (leafType == null) { - return; - } - - ContainerType containerType = (ContainerType) containerSelector - .getValue(); - if (containerType == null) { - return; - } - - boolean wrapped = wrapInPanel.booleanValue(); - ComponentContainer container = containerType.buildLayout( - ((Number) levels.getValue()).intValue(), - ((Number) childAmount.getValue()).intValue(), leafType, - !wrapped); - if (wrapped) { - Panel panel = new Panel(container); - panel.setSizeFull(); - setTestLayout(panel); - } else { - setTestLayout(container); - } - } - })); - - for (Iterator<Component> i = controls.getComponentIterator(); i - .hasNext();) { - Component component = i.next(); - if (component instanceof NativeSelect) { - NativeSelect nativeSelect = (NativeSelect) component; - nativeSelect.setNullSelectionAllowed(false); - nativeSelect.setValue(new ArrayList<Object>(nativeSelect - .getItemIds()).get(0)); - } - controls.setComponentAlignment(component, Alignment.BOTTOM_LEFT); - } - - VerticalLayout layout = getLayout(); - layout.addComponent(controls); - layout.addComponent(testLayout); - layout.setExpandRatio(testLayout, 1); - layout.setSizeFull(); - } - - public void setTestLayout(Component testLayout) { - getLayout().replaceComponent(this.testLayout, testLayout); - getLayout().setExpandRatio(testLayout, 1); - this.testLayout = testLayout; - } - - @Override - protected String getDescription() { - // TODO Auto-generated method stub - return null; - } - - @Override - protected Integer getTicketNumber() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java deleted file mode 100644 index 3697ab1c26..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java +++ /dev/null @@ -1,85 +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.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.util.TestUtils; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class MarginWithExpandRatio extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - TestUtils.injectCSS(this, - ".hugemargin { margin: 10px 20px !important; }"); - - HorizontalLayout hl = new HorizontalLayout(); - addLayoutTest(hl); - hl.setExpandRatio(hl.getComponent(0), 1.0f); - hl.setExpandRatio(hl.getComponent(2), 0.5f); - VerticalLayout vl = new VerticalLayout(); - addLayoutTest(vl); - vl.setExpandRatio(vl.getComponent(0), 1.0f); - vl.setExpandRatio(vl.getComponent(2), 0.5f); - - GridLayout gl = new GridLayout(2, 1); - addLayoutTest(gl); - gl.setColumnExpandRatio(0, 1.0f); - gl.setRowExpandRatio(0, 1.0f); - gl.setColumnExpandRatio(1, 0.5f); - gl.setRowExpandRatio(1, 0.5f); - } - - @Override - protected String getTestDescription() { - return "Layout content overflows if CSS margin used with expand ratio"; - } - - @Override - protected Integer getTicketNumber() { - return 11553; - } - - private void addLayoutTest(Layout l) { - l.setSizeFull(); - - Label lbl = new Label("First (expand ratio 1)"); - lbl.setSizeUndefined(); - l.addComponent(lbl); - - lbl = new Label("Second (margin 10px)"); - lbl.setSizeUndefined(); - lbl.addStyleName("hugemargin"); - l.addComponent(lbl); - - lbl = new Label("Third (margin+xr)"); - lbl.setSizeUndefined(); - lbl.addStyleName("hugemargin"); - l.addComponent(lbl); - - Panel p = new Panel(l.getClass().getSimpleName(), l); - p.setWidth("600px"); - p.setHeight("200px"); - addComponent(p); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java b/uitest/src/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java deleted file mode 100644 index 364a0e267a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HasComponents; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SingleComponentContainer; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -public class MovingComponentsWhileOldParentInvisible extends TestBase { - - private HasComponents cc = new AbsoluteLayout(); // initial dummy - // contents - private Label lab; - - @Override - protected void setup() { - lab = new Label("Label inside the component container"); - lab.setWidth(null); - - ComboBox componentContainerSelect = new ComboBox("Container") { - { - pageLength = 0; - } - }; - componentContainerSelect.setId("componentContainerSelect"); - componentContainerSelect.setWidth("300px"); - componentContainerSelect.setImmediate(true); - componentContainerSelect.setNullSelectionAllowed(false); - // componentContainer.addContainerProperty(CAPTION, String.class, ""); - // componentContainer.addContainerProperty(CLASS, Class.class, ""); - - for (Class<? extends HasComponents> cls : getComponentContainers()) { - componentContainerSelect.addItem(cls); - } - componentContainerSelect.addListener(new ValueChangeListener() { - - @Override - @SuppressWarnings("unchecked") - public void valueChange(ValueChangeEvent event) { - HasComponents oldCC = cc; - cc = createComponentContainer((Class<? extends HasComponents>) event - .getProperty().getValue()); - addToCC(lab); - replaceComponent(oldCC, cc); - } - }); - - componentContainerSelect.setValue(componentContainerSelect.getItemIds() - .iterator().next()); - Button but1 = new Button("Move in and out of component container", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - cc.setVisible(!cc.isVisible()); - if (!cc.isVisible()) { - getLayout().addComponent(lab); - lab.setValue(lab.getValue().replace("inside", - "outside")); - } else { - addToCC(lab); - lab.setValue(lab.getValue().replace("outside", - "inside")); - } - } - }); - - addComponent(componentContainerSelect); - addComponent(cc); - addComponent(but1); - } - - protected void addToCC(Label lab2) { - if (cc instanceof ComponentContainer) { - ((ComponentContainer) cc).addComponent(lab); - } else if (cc instanceof SingleComponentContainer) { - ((SingleComponentContainer) cc).setContent(lab); - } else { - throw new RuntimeException("Don't know how to add to " - + cc.getClass().getName()); - } - } - - private Collection<Class<? extends HasComponents>> getComponentContainers() { - List<Class<? extends HasComponents>> list = new ArrayList<Class<? extends HasComponents>>(); - list.add(AbsoluteLayout.class); - list.add(Accordion.class); - list.add(CssLayout.class); - list.add(FormLayout.class); - list.add(GridLayout.class); - list.add(HorizontalLayout.class); - list.add(HorizontalSplitPanel.class); - list.add(Panel.class); - list.add(TabSheet.class); - list.add(VerticalLayout.class); - list.add(VerticalSplitPanel.class); - return list; - } - - protected HasComponents createComponentContainer( - Class<? extends HasComponents> value) { - try { - HasComponents cc = value.newInstance(); - cc.setWidth("300px"); - cc.setHeight("300px"); - return cc; - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - @Override - protected String getDescription() { - return "Client side layouts can easily have a bug where its internal data structures gets messed up when child components from it are moved forth and back when it is invisible (registered, but renders are ignored until becomes visible again). Things are especially easy to mess up when the layout uses wrapper widget over each component (like VOrderedLayout and VGridLayout does). This tests Vertical (Ordered), Grid and CssLayout."; - } - - @Override - protected Integer getTicketNumber() { - return 5372; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/MovingInvisibleField.java b/uitest/src/com/vaadin/tests/layouts/MovingInvisibleField.java deleted file mode 100644 index 1285e5b52e..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/MovingInvisibleField.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.tests.layouts; - -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.TextField; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class MovingInvisibleField extends TestBase { - - @Override - protected void setup() { - final VerticalLayout layout1 = new VerticalLayout(); - final VerticalLayout layout2 = new VerticalLayout(); - - final TextField tfHidden = new TextField("Hidden text field caption", - "A hidden text field"); - final TextField tfVisible = new TextField("Visible text field caption", - "A visible text field"); - tfHidden.setVisible(false); - Button b = new Button("Move hidden textfield to other layout"); - b.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (layout1.getComponentIndex(tfHidden) != -1) { - layout2.addComponent(tfVisible); - layout2.addComponent(tfHidden); - } else { - layout1.addComponent(tfVisible); - layout1.addComponent(tfHidden); - } - - } - - }); - - layout1.addComponent(tfVisible); - layout1.addComponent(tfHidden); - - addComponent(layout1); - addComponent(b); - addComponent(layout2); - } - - @Override - protected String getDescription() { - return "Above and below the button is a VerticalLayout. Initially the first one contains two components: a visiable and an invisible TextField. Click the button to move the TextFields to the second layout, both should be moved but only the visible rendered."; - } - - @Override - protected Integer getTicketNumber() { - return 5278; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java deleted file mode 100644 index 3d4b20d5d9..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ /dev/null @@ -1,1210 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Alignment; -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.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class OrderedLayoutBasics extends TestBase { - - String valignName[] = new String[] { "top", "middle", "bottom" }; - - Set<AbstractOrderedLayout> layouts = new HashSet<AbstractOrderedLayout>(); - private AbstractOrderedLayout layoutContainer; - private int suffix = 0; - - @Override - protected String getDescription() { - return "Various layout tests for VerticalLayout and HorizontalLayout"; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - public void setup() { - getMainWindow().getContent().setHeight(null); - - layoutContainer = new VerticalLayout(); - createUI(layoutContainer); - addComponent(layoutContainer); - } - - private void createUI(Layout layout) { - layout.addComponent(wrapLayout(layout_field_100pct_button_field(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_field_100pct_button_field(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_overfilled(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_overfilled(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_overfilled_dynamic_height(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_overfilled_dynamic_height(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_symmetric_fields(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_symmetric_fields(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_leftAndRight(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_leftAndRight(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_fixed_filled(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_fixed_filled(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_dynamic(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_dynamic(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_labels(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_labels(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_captions(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_captions(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size_and_relative_size(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size_and_relative_size(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size_and_fixed_size(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_captions_fixed_size_and_fixed_size(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_add_remove_components(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_add_remove_components(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_pctFilled(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_pctFilled(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_underFilled(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_underFilled(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_basic_test(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_basic_test(new VerticalLayout()))); - } - - private Layout wrapLayout(Layout ol) { - Panel p = new Panel(ol); - p.setSizeUndefined(); - p.setCaption(ol.getCaption()); - ol.setCaption(null); - - VerticalLayout l = new VerticalLayout(); - l.setSizeUndefined(); - l.addComponent(p); - // p.setWidth("600px"); - - if (ol instanceof AbstractOrderedLayout) { - layouts.add((AbstractOrderedLayout) ol); - } - return l; - } - - /* LAYOUTS */ - - @SuppressWarnings({ "unused", "deprecation" }) - private Layout layout1() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("200px"); - ol.setWidth(""); - ol.setCaption("Fixed height (200px) and dynamic width"); - - TextField tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth(""); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - ListSelect s = new ListSelect("100% high select"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth(""); - ol.addComponent(s); - - s = new ListSelect("200 px high select"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth(""); - ol.addComponent(s); - - // tf = new TextField("100% high TextField, right/bottom"); - // tf.setHeight("100%"); - // tf.setWidth(""); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - // tf = new TextField("100% high, 200px wide TextField"); - // tf.setHeight("100%"); - // tf.setWidth("200px"); - // ol.addComponent(tf); - - return ol; - - } - - @SuppressWarnings({ "unused", "deprecation" }) - private Layout layout2() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("70px"); - ol.setWidth(""); - ol.setCaption("Fixed height (50px) and dynamic width"); - - TextField tf = new TextField( - "100px high TextField, valign: bottom, should be partly outside"); - tf.setHeight("100px"); - tf.setWidth(""); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField( - "100% high, 50px wide TextField, valign: bottom, should fill full height"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - ListSelect s = new ListSelect( - "100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth(""); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new ListSelect("200 px high select, should be partly outside"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth(""); - ol.addComponent(s); - - return ol; - } - - @SuppressWarnings({ "unused", "deprecation" }) - private Layout layout3() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight(""); - ol.setWidth("500px"); - ol.setCaption("Fixed width (500px) and dynamic height"); - TextField tf; - - tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField("100px high TextField, valign: top"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("100% high, 50px wide TextField, valign: bottom"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - ListSelect s = new ListSelect( - "100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth("100%"); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new ListSelect( - "200 px high select, should make the layout 200px high"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth("100%"); - ol.addComponent(s); - - return ol; - } - - @SuppressWarnings({ "unused", "deprecation" }) - private Layout layout3New() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("300px"); - // ol.setWidth("500px"); - ol.setWidth(""); - ol.setCaption("Dynamic width and fixed height(300px)"); - TextField tf; - - tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField("100px high TextField, valign: top"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("100% high, 50px wide TextField, valign: bottom"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - ListSelect s = new ListSelect( - "100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth("100%"); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new ListSelect( - "200 px high select, should make the layout 200px high"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth("100%"); - ol.addComponent(s); - - return ol; - } - - @SuppressWarnings("unused") - private Layout layout4(AbstractOrderedLayout ol) { - // ol.setHeight("300px"); - // ol.setWidth("500px"); - ol.setMargin(true); - ol.setSpacing(true); - ol.setWidth(""); - ol.setCaption("Dynamic width and dynamic height"); - TextArea tf; - - tf = new TextArea("100% high TextField"); - tf.setCaption(null); - tf.setRequired(true); - tf.setValue("100% high Field"); - tf.setHeight("100%"); - tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - - tf = new TextArea("100% high TextField"); - tf.setCaption("100% high TextField"); - tf.setRequired(true); - tf.setValue("100% high Field"); - tf.setHeight("100%"); - tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - - for (int i = 1; i < 4; i++) { - int w = i * 100; - tf = new TextArea("Field " + i); - tf.setRows(2); - tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - + valignName[i % 3]); - tf.setWidth(w + "px"); - tf.setHeight(w + "px"); - ol.addComponent(tf); - if (i % 3 == 0) { - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - } else if (i % 3 == 1) { - ol.setComponentAlignment(tf, Alignment.MIDDLE_LEFT); - } else { - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - } - - } - - tf = new TextArea("100% high TextField"); - tf.setValue("100% high 100px wide"); - tf.setRows(2); - tf.setHeight("100%"); - tf.setWidth("100px"); - ol.addComponent(tf); - return ol; - } - - private Layout layout_field_100pct_button_field(AbstractOrderedLayout ol) { - ol.setHeight("500px"); - ol.setWidth("916px"); - ol.setMargin(false); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_field_100pct_button_field"); - TextArea tf; - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - Button b; - b = new Button("This is a 100%x50% valign middle button"); - b.setSizeFull(); - b.setHeight("50%"); - ol.addComponent(b); - ol.setExpandRatio(b, 1.0f); - ol.setComponentAlignment(b, Alignment.MIDDLE_RIGHT); - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_basic_test(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("900px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_basic_test"); - TextArea tf; - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - // Button b; - // b = new Button("This is a 100%x50% valign middle button"); - // b.setSizeFull(); - // b.setHeight("50%"); - // ol.addComponent(b, 1.0f); - // ol.setComponentAlignment(b, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_VERTICAL_CENTER); - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_symmetric_fields(AbstractOrderedLayout ol) { - ol.setHeight("900px"); - ol.setWidth("900px"); - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_symmetric_fields"); - TextArea tf; - - tf = new TextArea("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextArea("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); - - tf = new TextArea("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - return ol; - } - - private Layout layout_leftAndRight(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_leftAndRight"); - TextArea tf; - - // tf = new TextField("100%x100% Field"); - // tf.setCaption(null); - // tf.setValue("100% x 100% TextField"); - // tf.setSizeFull(); - // tf.setRequired(true); - // // tf.setComponentError(new UserError("It's broken!")); - // - // // tf.setHeight("100%"); - // // tf.setWidth("100px"); - // tf.setRows(2); - // ol.addComponent(tf); - // - // for (int i = 1; i < 5; i++) { - // int w = i * 100; - // tf = new TextField("Caption field " + i); - // tf.setRows(2); - // tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - // + valignName[i % 3]); - // tf.setWidth(w + "px"); - // tf.setHeight(w + "px"); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, - // AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); - // } - // - // tf.setValue(tf.getValue().toString() + " (100% wide)"); - // tf.setWidth("100%"); - - // tf = new TextField("100%x70px Field"); - // tf.setCaption(null); - // tf.setRequired(true); - // // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - // tf.setComponentError(new UserError("abc")); - // tf.setValue("100% high 70px wide TextField"); - // tf.setRows(2); - // // tf.setSizeFull(); - // tf.setHeight("100%"); - // tf.setWidth("70px"); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_TOP); - // ol.addComponent(tf); - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextArea("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_fixed_filled(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextArea tf; - - tf = new TextArea("60%x100% Field"); - tf.setCaption("This one has a caption"); - tf.setValue("60% x 100% TextField"); - tf.setWidth("100%"); - tf.setHeight("100%"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - ol.setExpandRatio(tf, 1f); - // - - tf = new TextArea("60%x60% Field"); - tf.setCaption(null); - tf.setValue("60% x 60% TextField"); - tf.setWidth("100%"); - tf.setHeight("60%"); - tf.setRequired(true); - ol.addComponent(tf); - ol.setExpandRatio(tf, 1f); - ol.setComponentAlignment(tf, Alignment.MIDDLE_LEFT); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - // - // for (int i = 1; i < 5; i++) { - // int w = i * 100; - // tf = new TextField("Caption field " + i); - // tf.setRows(2); - // tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - // + valignName[i % 3]); - // tf.setWidth(w + "px"); - // tf.setHeight(w + "px"); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, - // AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); - // } - // - // tf.setValue(tf.getValue().toString() + " (100% wide)"); - // tf.setWidth("100%"); - - // tf = new TextField("100%x70px Field"); - // tf.setCaption(null); - // tf.setRequired(true); - // // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - // tf.setComponentError(new UserError("abc")); - // tf.setValue("100% high 70px wide TextField"); - // tf.setRows(2); - // // tf.setSizeFull(); - // tf.setHeight("100%"); - // tf.setWidth("70px"); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_TOP); - // ol.addComponent(tf); - - tf = new TextArea("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextArea("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_overfilled(AbstractOrderedLayout ol) { - ol.setHeight("300px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("OverFilled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextArea tf; - - for (int i = 0; i < 5; i++) { - tf = new TextArea("200x200px Field"); - tf.setCaption("This one has a caption"); - tf.setValue("200x200 TextField"); - tf.setWidth("200px"); - tf.setHeight("200px"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - } - - return ol; - } - - private Layout layout_overfilled_dynamic_height(AbstractOrderedLayout ol) { - ol.setHeight(null); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("OverFilled with fixed width (" + ol.getWidth() - + "px) and dynamic height"); - TextArea tf; - - for (int i = 0; i < 10; i++) { - tf = new TextArea("200x200px Field"); - tf.setCaption("This one has a caption"); - tf.setWidth("200px"); - tf.setHeight(((i + 1) * 50) + "px"); - tf.setValue(tf.getWidth() + "x" + tf.getHeight() + " TextField"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - } - - return ol; - } - - // private Layout layout_add_components(AbstractOrderedLayout ol) { - // ol.setHeight("600px"); - // ol.setWidth("600px"); - // ol.setMargin(true); - // ol.setSpacing(true); - // - // // ol.setWidth(""); - // ol.setCaption("Fixed width (" + ol.getWidth() - // + "px) and fixed height (" + ol.getHeight() + "px)"); - // - // for (int i = 0; i < 3; i++) { - // Button b = createAddButton(ol); - // ol.addComponent(b); - // } - // - // return ol; - // - // } - - private Layout layout_add_remove_components(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_add_remove_components"); - - for (int i = 0; i < 2; i++) { - AbstractOrderedLayout inner = createAddRemove(ol, "", ""); - ol.addComponent(inner); - ol.setComponentAlignment(inner, Alignment.BOTTOM_RIGHT); - } - - return ol; - - } - - private Layout layout_dynamic(AbstractOrderedLayout ol) { - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Dynamic width, dynamic height"); - - for (int i = 0; i < 3; i++) { - Button b = new Button("Button " + i); - if (i == 2) { - b.setHeight("200px"); - } else { - b.setHeight("100%"); - } - ol.addComponent(b); - } - - return ol; - - } - - private Layout layout_captions(AbstractOrderedLayout ol) { - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Caption test with dynamic width"); - - TextField tf; - tf = new TextField("Short caption"); - ol.addComponent(tf); - - tf = new TextField( - "A very long caption which is probably much longer than the field"); - ol.addComponent(tf); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size(AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed size"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setValue("Undefined width"); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setValue("Undefined width"); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("Undefined width"); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size_and_relative_size( - AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width (700x250)"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setSizeFull(); - tf.setValue("100% wide field, ratio 1"); - - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 1); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setValue("100% wide field, ratio 2"); - tf.setSizeFull(); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 2); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("100% wide field, ratio 3"); - tf.setSizeFull(); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 3); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size_and_fixed_size( - AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setValue("250px wide field"); - tf.setWidth("250px"); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setWidth("250px"); - tf.setValue("250px wide field"); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("200px wide field"); - tf.setWidth("200px"); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_labels(AbstractOrderedLayout ol) { - // ol.setWidth("700px"); - // ol.setHeight("200px"); - - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width"); - - Label l; - l = new Label( - "This is a long text and should remain on one line as there is nothing forcing line breaks"); - ol.addComponent(l); - // ol.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - l = new Label("WTF OMG LOL"); - ol.addComponent(l); - // ol.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - return ol; - - } - - private AbstractOrderedLayout createAddRemove(AbstractOrderedLayout ol, - String width, String buttonSuffix) { - Button b = createAddButton(ol); - Button wb = createWideAddButton(ol); - Button r = createRemoveButton(ol, buttonSuffix); - VerticalLayout inner = new VerticalLayout(); - inner.setCaption("Width: " + width); - inner.setWidth(width); - - inner.addComponent(b); - inner.addComponent(wb); - inner.addComponent(r); - - // inner.setHeight("132px"); - return inner; - } - - private Button createAddButton(AbstractOrderedLayout ol) { - Button b = new Button("Add before", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - addBefore((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent(), ""); - } - - }); - b.setData(ol); - - return b; - } - - private Button createWideAddButton(AbstractOrderedLayout ol) { - Button b = new Button("Add 100% before", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - addBefore((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent(), "100%"); - } - - }); - b.setData(ol); - - return b; - } - - private Button createRemoveButton(AbstractOrderedLayout ol, String suffix) { - Button b = new Button("Remove this " + suffix, new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - remove((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent()); - } - - }); - b.setWidth("100%"); - b.setData(ol); - - return b; - } - - protected void remove(AbstractOrderedLayout ol, Component c) { - ol.removeComponent(c); - - } - - protected void addBefore(AbstractOrderedLayout ol, Component c, String width) { - int index = 0; - Iterator<Component> iter = ol.getComponentIterator(); - while (iter.hasNext()) { - if (iter.next() == c) { - break; - } - index++; - } - AbstractOrderedLayout inner = createAddRemove(ol, width, - String.valueOf(suffix++)); - ol.addComponent(inner, index); - if (width.contains("%")) { - ol.setExpandRatio(inner, 1.0f); - } - - ol.setComponentAlignment(inner, Alignment.BOTTOM_RIGHT); - - } - - private Layout layout_pctFilled(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("100 % filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextArea ta; - - ta = new TextArea(); - ta.setCaption("This one has a caption"); - ta.setValue("60% expand TextField"); - ta.setWidth("100%"); - ta.setHeight("100%"); - // ta.setRequired(true); - // ta.setComponentError(new UserError("It's broken!")); - - // ta.setHeight("100%"); - // ta.setWidth("100px"); - ta.setRows(2); - ol.addComponent(ta); - ol.setExpandRatio(ta, 60); - - ta = new TextArea(); - ta.setValue("100px 100px TextField"); - ta.setWidth("100px"); - ta.setHeight("100px"); - ta.setRows(2); - ol.addComponent(ta); - ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER); - - // - - ta = new TextArea("40%x40% Field"); - // ta.setCaption(null); - ta.setValue("40% expand (40% height) TextField"); - ta.setWidth("100%"); - ta.setHeight("40%"); - ol.addComponent(ta); - ol.setExpandRatio(ta, 40); - // ta.setRequired(true); - ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT); - - ta.setRows(2); - - return ol; - } - - @SuppressWarnings("unused") - private Layout layout_pctFilled2(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("100 % filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextArea ta; - - ta = new TextArea(); - // ta.setCaption("This one has a caption"); - ta.setValue("80% x 20% TextField"); - ta.setWidth("80%"); - ta.setHeight("20%"); - // ta.setRequired(true); - // ta.setComponentError(new UserError("It's broken!")); - - // ta.setHeight("100%"); - // ta.setWidth("100px"); - ta.setRows(2); - ol.addComponent(ta); - // - - ta = new TextArea("20%x60% Field"); - ta.setCaption(null); - ta.setValue("20% x 60% TextField"); - ta.setWidth("20%"); - ta.setHeight("60%"); - // ta.setRequired(true); - ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT); - - ta.setRows(2); - ol.addComponent(ta); - - return ol; - } - - private Layout layout_underFilled(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Underfilled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextArea ta; - - ta = new TextArea("60%x100% Field"); - ta.setCaption("Short capt"); - ta.setValue("60% x 100% TextField"); - ta.setWidth("60%"); - ta.setHeight("100%"); - ta.setRequired(true); - ta.setRows(2); - - ol.addComponent(ta); - ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER); - - ta = new TextArea("200px x 200px Field"); - // ta.setIcon(new ThemeResource("icons/16/document-add.png")); - ta.setValue("200x200 field"); - ta.setRows(2); - // ta.setSizeFull(); - ta.setHeight("200px"); - ta.setWidth("200px"); - ol.addComponent(ta); - ol.setComponentAlignment(ta, Alignment.TOP_LEFT); - - ta = new TextArea("200px x 200px Field"); - // ta.setIcon(new ThemeResource("icons/16/document-add.png")); - ta.setValue("200x200 field"); - ta.setRows(2); - // ta.setSizeFull(); - ta.setHeight("200px"); - ta.setWidth("200px"); - ol.addComponent(ta); - ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT); - return ol; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java deleted file mode 100644 index 41f1de2c4a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.TextField; - -public class OrderedLayoutCSSCompatibility extends TestBase { - - @Override - protected String getDescription() { - return "This test is to make sure that spacing/margins in OrderedLayout is still backwards compatible"; - } - - @Override - protected Integer getTicketNumber() { - return 2463; - } - - @Override - protected void setup() { - HorizontalLayout l = new HorizontalLayout(); - l.setMargin(true); - l.setSpacing(true); - l.addComponent(new TextField("abc")); - l.addComponent(new TextField("def")); - - addComponent(l); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayout.java b/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayout.java deleted file mode 100644 index a139c7f67a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayout.java +++ /dev/null @@ -1,46 +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.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.TextField; - -public class RelativeSizeInUndefinedCssLayout extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - getPage().getStyles().add(".css-style { width: 520px; }"); - - CssLayout cssLayout = new CssLayout(); - cssLayout.addStyleName("css-style"); - - setContent(cssLayout); - - FormLayout formLayout = new FormLayout(); - formLayout.setSizeFull(); - - cssLayout.addComponent(formLayout); - - TextField tf = new TextField("Enter something"); - tf.setWidth("100%"); - formLayout.addComponent(tf); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java b/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java deleted file mode 100644 index 340c627dd4..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/RelativeSizeInUndefinedCssLayoutTest.java +++ /dev/null @@ -1,37 +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.layouts; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.FormLayoutElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; - -public class RelativeSizeInUndefinedCssLayoutTest extends - SingleBrowserTestPhantomJS2 { - - @Test - public void relativeSizeInUndefinedCssLayout() { - openTestURL(); - int w = $(FormLayoutElement.class).first().getSize().getWidth(); - Assert.assertEquals(w, 520); - - int w2 = $(TextFieldElement.class).first().getSize().getWidth(); - Assert.assertTrue(w2 > 400); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/uitest/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java deleted file mode 100644 index 5abe915307..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java +++ /dev/null @@ -1,326 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.AbsoluteLayout.ComponentPosition; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class TestAbsoluteLayout extends TestBase { - - private static class MFieldFactory extends DefaultFieldFactory { - - @Override - public Field<?> createField(Item item, Object propertyId, - Component uiContext) { - if (propertyId.equals("CSSString")) { - TextArea f = new TextArea(); - f.setRows(5); - f.setHeight("8em"); - f.setCaption("CSS string"); - return f; - } else if (((String) propertyId).contains("Units")) { - NativeSelect s = new NativeSelect() { - }; - s.addContainerProperty("caption", String.class, ""); - s.setItemCaptionPropertyId("caption"); - s.setNullSelectionAllowed(false); - for (int i = 0; i < Layout.Unit.values().length; i++) { - Item unitItem = s.addItem(i); - unitItem.getItemProperty("caption").setValue( - Layout.Unit.values()[i]); - } - return s; - } - - return super.createField(item, propertyId, uiContext); - } - - private static MFieldFactory instance; - - public static DefaultFieldFactory get() { - if (instance == null) { - instance = new MFieldFactory(); - } - return instance; - } - } - - @Override - protected String getDescription() { - return "This is absolute layout tester."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - protected void setup() { - AbsoluteLayout layout = new AbsoluteLayout(); - setTheme("tests-tickets"); - layout.setStyleName("cyan"); - layout.setWidth("1000px"); - layout.setHeight("500px"); - - layout.addComponent(new Label("Hello World")); - - Button button = new Button("Centered button,z-index:10;"); - button.setSizeFull(); - layout.addComponent(button, - "top:40%;bottom:40%;right:20%;left:20%;z-index:10;"); - - Label label = new Label( - "Exotic positioned label. Fullsize, top:100px; left:2cm; right: 3.5in; bottom:12.12mm "); - label.setStyleName("yellow"); - label.setSizeFull(); - layout.addComponent(label, - "top:100px; left:2cm; right: 3.5in; bottom:12.12mm"); - - label = new Label("fullize, bottom:80%;left:80%;"); - label.setStyleName("green"); - label.setSizeFull(); - layout.addComponent(label, "bottom:80%;left:80%;"); - - label = new Label("bottomright"); - label.setSizeUndefined(); - label.setStyleName("green"); - layout.addComponent(label, "bottom:0px; right:0px;"); - - getLayout().setSizeFull(); - getLayout().addComponent(layout); - - getMainWindow().addWindow(new EditorWindow(layout)); - - } - - public class EditorWindow extends Window { - private final AbsoluteLayout l; - private Form componentEditor; - private Form positionEditor; - - public EditorWindow(AbsoluteLayout lo) { - super("AbsoluteLayout editor aka köyhän miehen wysiwyg"); - l = lo; - - setHeight("600px"); - - Button componentChooser = new Button("choose component to edit"); - componentChooser.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - final Window chooser = new Window("Choose component", - layout); - layout.setSizeUndefined(); - chooser.setModal(true); - - NativeSelect select = new NativeSelect( - "Choose component to edit"); - - select.setNullSelectionAllowed(false); - - IndexedContainer container = new IndexedContainer(); - container.addContainerProperty("caption", String.class, ""); - Iterator<Component> componentIterator = l - .getComponentIterator(); - while (componentIterator.hasNext()) { - AbstractComponent next = (AbstractComponent) componentIterator - .next(); - Item item = container.addItem(next); - - String caption = next.getClass().getSimpleName(); - - caption += "; cap: " + next.getCaption() + "; debugid" - + getId(); - - if (next instanceof Property) { - caption += " value:" - + ((Property<?>) next).getValue(); - } - - item.getItemProperty("caption").setValue(caption); - } - select.setContainerDataSource(container); - select.setItemCaptionPropertyId("caption"); - select.setImmediate(true); - - select.addListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - editcomponent((Component) event.getProperty() - .getValue()); - getMainWindow().removeWindow(chooser); - } - - }); - - layout.addComponent(select); - - getMainWindow().addWindow(chooser); - - } - }); - - addComponent(componentChooser); - - Button addComp = new Button("add component"); - addComp.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - final Window chooser = new Window( - "Choose component type to add", layout); - layout.setSizeUndefined(); - chooser.setModal(true); - - NativeSelect select = new NativeSelect( - "Choose component to edit"); - - select.setNullSelectionAllowed(false); - - IndexedContainer container = new IndexedContainer(); - - URL resource = AbstractComponent.class.getResource("."); - File directory = new File(resource.getFile()); - if (directory.exists()) { - // Get the list of the files contained in the - // package - final String[] files = directory.list(); - for (int j = 0; j < files.length; j++) { - // we are only interested in .class files - if (files[j].endsWith(".class")) { - // removes the .class extension - String p = resource.toString() - + files[j].substring(0, - files[j].length() - 6); - p = p.replaceAll(".*classes/", ""); - p = p.replaceAll("/", "."); - Class<?> c; - try { - c = Class.forName(p); - if (AbstractComponent.class - .isAssignableFrom(c) - && !p.toLowerCase().contains( - "layout") - && !p.toLowerCase().contains( - "abstract")) { - container.addItem(c); - } - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - select.setContainerDataSource(container); - select.setImmediate(true); - - select.addListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - Class<?> c = (Class<?>) event.getProperty() - .getValue(); - - try { - Component newInstance = (Component) c - .newInstance(); - l.addComponent(newInstance); - editcomponent(newInstance); - getMainWindow().removeWindow(chooser); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - }); - - layout.addComponent(select); - - getMainWindow().addWindow(chooser); - - } - }); - - addComponent(addComp); - - componentEditor = new Form(); - componentEditor.setBuffered(true); - componentEditor.setCaption("Component properties:"); - componentEditor.setFormFieldFactory(MFieldFactory.get()); - addComponent(componentEditor); - - positionEditor = new Form(); - positionEditor.setCaption("Component position"); - positionEditor.setBuffered(true); - positionEditor.setFormFieldFactory(MFieldFactory.get()); - addComponent(positionEditor); - - Button b = new Button("Commit changes", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - positionEditor.commit(); - componentEditor.commit(); - } - }); - addComponent(b); - - } - - private void editcomponent(Component value) { - - BeanItem<Component> beanItem = new BeanItem<Component>(value); - String c = "Component properties for " - + value.getClass().getSimpleName(); - ArrayList<String> fields = new ArrayList<String>( - Arrays.asList(new String[] { "width", "widthUnits", - "height", "heightUnits", "caption", "styleName" })); - if (value instanceof Label) { - c += "(" + ((Label) value).getValue() + ")"; - fields.add("value"); - } - - componentEditor.setItemDataSource(beanItem, fields); - - BeanItem<ComponentPosition> positionItem = new BeanItem<ComponentPosition>( - l.getPosition(value)); - componentEditor.setCaption(c); - - positionEditor.setItemDataSource(positionItem); - - } - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListeners.java b/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListeners.java deleted file mode 100644 index 22a37022c2..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListeners.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.event.LayoutEvents.LayoutClickEvent; -import com.vaadin.event.LayoutEvents.LayoutClickListener; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUIWithLog; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class TestLayoutClickListeners extends AbstractTestUIWithLog { - - @Override - protected void setup(VaadinRequest request) { - HorizontalLayout layoutsLayout = new HorizontalLayout(); - layoutsLayout.setSpacing(true); - addComponent(layoutsLayout); - - layoutsLayout.addComponent(createClickableGridLayout()); - layoutsLayout.addComponent(createClickableVerticalLayout()); - layoutsLayout.addComponent(createClickableAbsoluteLayout()); - layoutsLayout.addComponent(createClickableCSSLayout()); - } - - private Component createClickableAbsoluteLayout() { - final AbsoluteLayout al = new AbsoluteLayout(); - al.setCaption("AbsoluteLayout"); - al.setStyleName("borders"); - al.setWidth("300px"); - al.setHeight("500px"); - al.addComponent(new TextField("This is its caption", - "This is a textfield"), "top: 60px; left: 0px; width: 100px;"); - al.addComponent(new TextField("Another textfield caption", - "This is another textfield"), - "top: 120px; left: 20px; width: 100px;"); - - al.addComponent(new Button("A button with its own click listener", - new Button.ClickListener() { - - @Override - public void buttonClick( - com.vaadin.ui.Button.ClickEvent event) { - log("Button " + event.getButton().getCaption() - + " was clicked"); - - } - })); - al.addLayoutClickListener(new LayoutClickListener() { - - @Override - public void layoutClick(LayoutClickEvent event) { - logLayoutClick("AbsoluteLayout", event); - } - }); - - return al; - - } - - private Component createClickableCSSLayout() { - final CssLayout cl = new CssLayout(); - cl.setCaption("CSSLayout"); - cl.setStyleName("borders"); - cl.setWidth("300px"); - cl.setHeight("500px"); - cl.addComponent(new TextField("This is its caption", - "This is a textfield")); - cl.addComponent(new TextField("Another textfield caption", - "This is another textfield")); - - cl.addComponent(new Button("A button with its own click listener", - new Button.ClickListener() { - - @Override - public void buttonClick( - com.vaadin.ui.Button.ClickEvent event) { - log("Button " + event.getButton().getCaption() - + " was clicked"); - - } - })); - cl.addLayoutClickListener(new LayoutClickListener() { - - @Override - public void layoutClick(LayoutClickEvent event) { - logLayoutClick("CSSLayout", event); - } - }); - - return cl; - - } - - private Layout createClickableGridLayout() { - - GridLayout gl = new GridLayout(4, 4); - gl.setHeight("400px"); - gl.setWidth("564px"); - gl.setStyleName("borders"); - gl.setSpacing(true); - gl.setHideEmptyRowsAndColumns(true); - addContent(gl, 4); - TextArea largeTextarea = new TextArea("Large textarea"); - largeTextarea.setWidth("100%"); - largeTextarea.setHeight("99%"); - gl.addComponent(largeTextarea, 0, 3, 3, 3); - - gl.addLayoutClickListener(new LayoutClickListener() { - - @Override - public void layoutClick(LayoutClickEvent event) { - logLayoutClick("GridLayout", event); - } - }); - gl.setRowExpandRatio(3, 1); - return wrap(gl, "GridLayout"); - } - - protected void logLayoutClick(String layout, LayoutClickEvent event) { - String target = "<none>"; - Component component = event.getChildComponent(); - if (component != null) { - target = component.getCaption(); - if (target == null && component instanceof Label) { - target = ((Label) component).getValue().toString(); - } - } - String button = event.getButtonName(); - String type = "click"; - if (event.isDoubleClick()) { - type = "double-click"; - } - log(layout + ": " + button + " " + type + " on " + target); - } - - private Layout createClickableVerticalLayout() { - - VerticalLayout gl = new VerticalLayout(); - addContent(gl, 5); - - gl.addLayoutClickListener(new LayoutClickListener() { - - @Override - public void layoutClick(LayoutClickEvent event) { - logLayoutClick("VerticalLayout", event); - - } - }); - - return wrap(gl, "Clickable VerticalLayout"); - } - - private void addContent(Layout gl, int nr) { - for (int i = 1; i < nr; i++) { - Label l = new Label("This is label " + i); - l.setWidth(null); - gl.addComponent(l); - } - for (int i = nr; i < nr * 2; i++) { - gl.addComponent(new TextField("This is tf" + i, "this is tf " + i)); - } - } - - private Layout wrap(Component c, String caption) { - VerticalLayout vl = new VerticalLayout(); - Label l = new Label(caption); - l.setWidth(null); - vl.addComponent(l); - vl.addComponent(c); - - return vl; - } - - @Override - protected String getTestDescription() { - return "All layouts have click listeners attached and the events are shown in the event log at the top"; - } - - @Override - protected Integer getTicketNumber() { - return 3541; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java b/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java deleted file mode 100644 index ea47ab4620..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java +++ /dev/null @@ -1,200 +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.layouts; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.interactions.Actions; - -import com.vaadin.testbench.elements.AbsoluteLayoutElement; -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.CssLayoutElement; -import com.vaadin.testbench.elements.GridLayoutElement; -import com.vaadin.testbench.elements.LabelElement; -import com.vaadin.testbench.elements.TextFieldElement; -import com.vaadin.testbench.elements.VerticalLayoutElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Tests LayoutClickListener on different layouts. - * - * @since - * @author Vaadin Ltd - */ -public class TestLayoutClickListenersTest extends MultiBrowserTest { - - @Before - public void before() { - openTestURL(); - } - - @Test - public void clickInGridLayout() { - GridLayoutElement layout = $(GridLayoutElement.class).first(); - - // click on a label - layout.$(LabelElement.class).first().click(); - assertLogText("GridLayout 1st child clicked", - "1. GridLayout: left click on This is label 1"); - - // click on a text field - layout.$(TextFieldElement.class).get(1).click(); - assertLogText("GridLayout 5th child clicked", - "2. GridLayout: left click on This is tf5"); - - // click on the layout body (not any component inside the layout) - layout.click(130, 41); - assertLogText("GridLayout body clicked", - "3. GridLayout: left click on <none>"); - } - - @Test - public void clickInVerticalLayout() { - VerticalLayoutElement layout = $(VerticalLayoutElement.class).get(4); - - // click on a text field - layout.$(TextFieldElement.class).get(1).click(); - assertLogText("VerticalLayout 6th child clicked", - "1. VerticalLayout: left click on This is tf6"); - - // click on a label - layout.$(LabelElement.class).get(3).click(); - assertLogText("VerticalLayout 4th child clicked", - "2. VerticalLayout: left click on This is label 3"); - } - - @Test - public void clickInAbsoluteLayout() { - AbsoluteLayoutElement layout = $(AbsoluteLayoutElement.class).first(); - - // click on a button that has its own ClickListener (should be ignored - // by the LayoutClickListener) - layout.$(ButtonElement.class).first().click(); - assertLogText("A button with a ClickListener clicked", - "1. Button A button with its own click listener was clicked"); - - // click on a text field's caption - layout.$(TextFieldElement.class).first().click(); - assertLogText("AbsoluteLayout 1st child was clicked", - "2. AbsoluteLayout: left click on This is its caption"); - } - - @Test - public void clickInCSSLayout() { - CssLayoutElement layout = $(CssLayoutElement.class).first(); - - // click on a text field's caption - layout.$(TextFieldElement.class).first().click(); - assertLogText("CSSLayout 1st child clicked", - "1. CSSLayout: left click on This is its caption"); - - // click on a button that has its own ClickListener (should be ignored - // by the LayoutClickListener) - layout.$(ButtonElement.class).first().click(); - assertLogText("Abutton with a ClickListener was clicked", - "2. Button A button with its own click listener was clicked"); - } - - @Test - public void dragInGridLayout() { - GridLayoutElement layout = $(GridLayoutElement.class).first(); - - // Drag inside the first label in this layout - new Actions(getDriver()) - .moveToElement(layout.$(LabelElement.class).first(), 40, 8) - .clickAndHold().moveByOffset(-20, 0).release().perform(); - assertLogText("Mouse dragged in GridLayout", - "1. GridLayout: left click on This is label 1"); - - // Drag from the third label to a text field in this layout - new Actions(getDriver()) - .moveToElement(layout.$(LabelElement.class).get(2), 40, 8) - .clickAndHold() - .moveToElement(layout.$(TextFieldElement.class).get(3), 46, 33) - .release().perform(); - assertLogText("Expected the drag to be ignored between elements", - "1. GridLayout: left click on This is label 1"); - } - - @Test - public void dragInVerticalLayout() { - VerticalLayoutElement layout = $(VerticalLayoutElement.class).get(4); - - // Drag inside the first text field - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).first(), 25, 9) - .clickAndHold().moveByOffset(-20, 0).release().perform(); - assertLogText("Mouse dragged in VerticalLayout", - "1. VerticalLayout: left click on This is tf5"); - - // Drag from a caption to its text field - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).get(4), 28, 11) - .clickAndHold() - .moveToElement(layout.$(TextFieldElement.class).get(4), 39, 30) - .release().perform(); - assertLogText("Expected the drag to be ignored between elements", - "1. VerticalLayout: left click on This is tf5"); - } - - @Test - public void dragInAbsoluteLayout() { - AbsoluteLayoutElement layout = $(AbsoluteLayoutElement.class).first(); - - // Drag inside the first text field's caption - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).first(), 21, 9) - .clickAndHold().moveByOffset(-10, 0).release().perform(); - assertLogText("Mouse dragged in AbsoluteLayout", - "1. AbsoluteLayout: left click on This is its caption"); - - // Drag from a text field to another text field - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).get(1), 54, 7) - .clickAndHold() - .moveToElement(layout.$(TextFieldElement.class).first(), 52, 10) - .release().perform(); - assertLogText("Expected the drag to be ignored between elements", - "1. AbsoluteLayout: left click on This is its caption"); - } - - @Test - public void dragInCSSLayout() { - CssLayoutElement layout = $(CssLayoutElement.class).first(); - - // Drag inside the first text field's caption - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).first(), 51, 7) - .clickAndHold().moveByOffset(-20, 0).release().perform(); - assertLogText("Mouse dragged in CSSLayout", - "1. CSSLayout: left click on This is its caption"); - - // Drag from the first text field to the second text field - new Actions(getDriver()) - .moveToElement(layout.$(TextFieldElement.class).first(), 51, 27) - .clickAndHold() - .moveToElement(layout.$(TextFieldElement.class).get(1), 51, 27) - .release().perform(); - assertLogText("Expected the drag to be ignored between elements", - "1. CSSLayout: left click on This is its caption"); - } - - private void assertLogText(String message, String expected) { - String actual = $(LabelElement.class).first().getText(); - Assert.assertEquals(message, expected, actual); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/TestLayoutPerformance.java b/uitest/src/com/vaadin/tests/layouts/TestLayoutPerformance.java deleted file mode 100644 index f80d91ae1b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/TestLayoutPerformance.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class TestLayoutPerformance extends TestBase { - private NativeSelect ns; - private int i; - private NativeSelect ns2; - private VerticalLayout testarea = new VerticalLayout(); - - @Override - protected String getDescription() { - return "Test app to test simple rendering to various layouts."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - protected void setup() { - Label label = new Label("<h1>CssLayout performance test.</h1>", - ContentMode.HTML); - getLayout().addComponent(label); - - label = new Label( - "<em>Hint</em>. Use debug dialog to measure rendering times TODO: extend with size settings (to both layout and content).", - ContentMode.HTML); - getLayout().addComponent(label); - - ns = new NativeSelect("Select component to test"); - ns.addItem(CssLayout.class); - ns.addItem(GridLayout.class); - ns.addItem(VerticalLayout.class); - ns.setNullSelectionAllowed(false); - ns.setValue(CssLayout.class); - - ns2 = new NativeSelect("Select component to render inside layout."); - ns2.addItem(Label.class); - ns2.addItem(Button.class); - ns2.setNullSelectionAllowed(false); - ns2.setValue(Label.class); - - final TextField n = new TextField("Number of components"); - - n.setValue("1000"); - - final CheckBox cb = new CheckBox("Generate captions", false); - - Button b = new Button("Render component"); - - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - int components = Integer.parseInt(n.getValue()); - Layout layout = getCurrentLayout(); - for (int i = 0; i < components; i++) { - Component component = newTestComponent(); - if (cb.getValue()) { - component.setCaption("caption " + i); - } - layout.addComponent(component); - } - - testarea.removeAllComponents(); - testarea.addComponent(layout); - } - - }); - - getLayout().addComponent(ns); - getLayout().addComponent(ns2); - getLayout().addComponent(n); - getLayout().addComponent(cb); - getLayout().addComponent(b); - getLayout().addComponent(testarea); - - } - - private Layout getCurrentLayout() { - Class<?> value = (Class<?>) ns.getValue(); - if (value == GridLayout.class) { - return new GridLayout(10, 1); - } - - try { - return (Layout) value.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - - } - - private Component newTestComponent() { - Class<?> componentClass = (Class<?>) ns2.getValue(); - AbstractComponent newInstance = null; - try { - newInstance = (AbstractComponent) componentClass.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (componentClass == Label.class) { - ((Label) newInstance).setValue("Test l " + (i++)); - ((Label) newInstance).setSizeUndefined(); - } else { - newInstance.setCaption("Test l " + (i++)); - } - return newInstance; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/TreeWithBordersInLayout.java b/uitest/src/com/vaadin/tests/layouts/TreeWithBordersInLayout.java deleted file mode 100644 index 257e0174d5..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/TreeWithBordersInLayout.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Tree; -import com.vaadin.ui.VerticalLayout; - -public class TreeWithBordersInLayout extends AbstractTestCase { - - private static final Object CAPTION = "caption"; - - @Override - public void init() { - Layout mainLayout = new VerticalLayout(); - mainLayout.setSizeUndefined(); - setMainWindow(new LegacyWindow("main window", mainLayout)); - - setTheme("tests-tickets"); - - Tree t = new Tree(); - t.addContainerProperty(CAPTION, String.class, ""); - t.setItemCaptionPropertyId(CAPTION); - t.addItem("Item 1").getItemProperty(CAPTION).setValue("Item 1"); - - t.setSizeUndefined(); - t.setStyleName("redblueborders"); - mainLayout.addComponent(t); - - } - - @Override - protected String getDescription() { - return "The tree consists of one node and has a 10px blue red border and a 10px red right border. The tree node should be visible between the borders."; - } - - @Override - protected Integer getTicketNumber() { - return 3915; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java deleted file mode 100644 index bc7268356d..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.vaadin.tests.layouts; - -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.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class VerticalLayoutExpandRatioModification extends TestBase implements - ClickListener { - - private boolean isVisible = false; - private VerticalLayout mainLayout; - private VerticalLayout vl1; - private VerticalLayout vl2; - private Button button; - - @Override - public void setup() { - LegacyWindow main = getMainWindow(); - - mainLayout = new VerticalLayout(); - main.setContent(mainLayout); - - // The upper layout - vl1 = new VerticalLayout(); - Label label1 = new Label("The upper layout"); - vl1.addComponent(label1); - - // Button that hides or shows the bottom part - button = new Button("show / hide", this); - - // The bottom layout - vl2 = new VerticalLayout(); - TextField tf = new TextField("The bottom field"); - tf.setHeight("100%"); - vl2.addComponent(tf); - - // Add everything to the view - mainLayout.addComponent(vl1); - mainLayout.addComponent(button); - mainLayout.addComponent(vl2); - - // Set expand ratios, hide lower - mainLayout.setExpandRatio(vl1, 1); - mainLayout.setExpandRatio(vl2, 0); - - // Maximize everything - main.setSizeFull(); - mainLayout.setSizeFull(); - vl1.setSizeFull(); - vl2.setSizeFull(); - } - - @Override - public void buttonClick(ClickEvent event) { - if (isVisible) { - mainLayout.setExpandRatio(vl2, 0); - isVisible = false; - } else { - mainLayout.setExpandRatio(vl2, 1); - isVisible = true; - } - } - - @Override - protected String getDescription() { - return "Changing the expand ratio should repaint the layout correctly. Changing from 0 to something else should render the previously invisible component"; - } - - @Override - protected Integer getTicketNumber() { - return 2454; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java deleted file mode 100644 index 77f0d6cdda..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.UI; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.Reindeer; - -@SuppressWarnings("serial") -public class VerticalLayoutSlotExpansionAndAlignment extends UI { - - @Override - protected void init(VaadinRequest request) { - - VerticalLayout layout = new VerticalLayout(); - layout.setSizeFull(); - setContent(layout); - - HorizontalLayout header = new HorizontalLayout(new Label("HEADER")); - header.setHeight("100px"); - header.setWidth("100%"); - header.setStyleName(Reindeer.LAYOUT_WHITE); - layout.addComponent(header); - - HorizontalLayout content = new HorizontalLayout(new Label("CONTENT")); - content.setSizeFull(); - content.setStyleName(Reindeer.LAYOUT_BLUE); - layout.addComponent(content); - - HorizontalLayout footer = new HorizontalLayout(new Label("FOOTER")); - footer.setHeight("150px"); - footer.setWidth("100%"); - footer.setStyleName(Reindeer.LAYOUT_BLACK); - layout.addComponent(footer); - - // This break things - layout.setComponentAlignment(footer, Alignment.BOTTOM_LEFT); - layout.setExpandRatio(content, 1); - - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java deleted file mode 100644 index 906de9bb77..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; - -public class VerticalLayoutWithRelativeSizeComponents extends TestBase { - - @Override - protected String getDescription() { - return "A undefined wide VerticalLayout containing a 100% wide label, a Button and another identical label. The labels should be as wide as the button (400px) and there should be no extra space between the bottom of the first label and the button."; - } - - @Override - protected Integer getTicketNumber() { - return 2591; - } - - @Override - protected void setup() { - getLayout().setSizeUndefined(); - getMainWindow().getContent().setHeight(null); - - Label l = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc condimentum urna quis leo. In hac habitasse platea dictumst. Pellentesque tincidunt. Sed libero nisl, faucibus in, laoreet pellentesque, consectetur non, dolor. Sed tortor. Ut pretium sapien. Cras elementum enim non lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla velit est, aliquam a, pellentesque a, iaculis nec, sapien. Ut ultrices ligula vitae nulla. Morbi sem pede, iaculis ac, condimentum a, ornare eget, nisi. Aliquam hendrerit pulvinar massa. Vestibulum pretium purus eu augue. Sed posuere elit ut magna. Cras consequat faucibus nunc. Vestibulum quis diam."); - Label l2 = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc condimentum urna quis leo. In hac habitasse platea dictumst. Pellentesque tincidunt. Sed libero nisl, faucibus in, laoreet pellentesque, consectetur non, dolor. Sed tortor. Ut pretium sapien. Cras elementum enim non lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla velit est, aliquam a, pellentesque a, iaculis nec, sapien. Ut ultrices ligula vitae nulla. Morbi sem pede, iaculis ac, condimentum a, ornare eget, nisi. Aliquam hendrerit pulvinar massa. Vestibulum pretium purus eu augue. Sed posuere elit ut magna. Cras consequat faucibus nunc. Vestibulum quis diam."); - l.setWidth("100%"); - l2.setWidth("100%"); - - Button b = new Button("This defines the width"); - b.setWidth("400px"); - addComponent(l); - addComponent(b); - addComponent(l2); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java deleted file mode 100644 index f3d4029663..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.vaadin.tests.layouts; - -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.Label; -import com.vaadin.ui.VerticalLayout; - -public class VerticalLayoutWithRelativeSizeComponentsInitiallyHidden extends - TestBase { - - @Override - protected String getDescription() { - return "Size calculations fail if expanded component is relative sized " - + "and initially invisible and when becoming visible at the " - + "same time some other component size changes."; - } - - @Override - protected Integer getTicketNumber() { - return 4608; - } - - @Override - protected void setup() { - - VerticalLayout verticalLayout = getLayout(); - verticalLayout.setHeight("500px"); - - final Label bar = new Label("Bar"); - bar.setSizeUndefined(); - final Label foobar = new Label("FooBar"); - foobar.setSizeFull(); - foobar.setVisible(false); - - bar.setHeight("100px"); - - // bar.setHeight("100px"); - bar.setVisible(false); - - Button b = new Button( - "Click to set bar visible. Button should stay visible."); - b.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - bar.setVisible(true); - foobar.setVisible(true); - } - }); - - verticalLayout.addComponent(bar); - verticalLayout.addComponent(foobar); - verticalLayout.setExpandRatio(foobar, 1); - verticalLayout.addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayout.java b/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayout.java deleted file mode 100644 index 18ec491c0b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayout.java +++ /dev/null @@ -1,49 +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.layouts.customlayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; - -@SuppressWarnings("serial") -public class DefaultLocationInCustomLayout extends AbstractTestUI { - - protected static final String BUTTON_ID = "DefaultLocationInCustomLayoutTestButtonId"; - - @Override - protected Integer getTicketNumber() { - return 14340; - } - - @Override - protected String getTestDescription() { - return "A test for adding a component at the default location in a " - + "CustomLayout: a button should be visible."; - } - - @Override - protected void setup(VaadinRequest request) { - setTheme("tests-tickets"); - CustomLayout customLayout = new CustomLayout("Ticket14340"); - final Button button = new Button("Button"); - button.setId(BUTTON_ID); - customLayout.addComponent(button); - addComponent(customLayout); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayoutTest.java b/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayoutTest.java deleted file mode 100644 index f4ac7419f7..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/customlayout/DefaultLocationInCustomLayoutTest.java +++ /dev/null @@ -1,39 +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.layouts.customlayout; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class DefaultLocationInCustomLayoutTest extends MultiBrowserTest { - - @Test - public void buttonExistsInLayout() { - openTestURL(); - - // We don't use TestBench's ElementQuery here because we need to check - // the DOM for buttons existence. - assertThat( - driver.findElements( - By.id(DefaultLocationInCustomLayout.BUTTON_ID)).size(), - is(1)); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java deleted file mode 100644 index cd86fbcf3c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.vaadin.tests.layouts.gridlayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; - -public class GridLayoutMoveComponent extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - final GridLayout grid = new GridLayout(2, 3); - grid.setCaption("Fixed size grid"); - grid.setWidth("300px"); - grid.setHeight("100px"); - addComponent(grid); - - final Label l = new Label("100% label"); - final Button b = new Button("100px button"); - b.setWidth("100px"); - final TextField tf = new TextField("Undef textfield"); - - // Adding component to grid - grid.addComponent(l, 0, 0); - grid.addComponent(b, 0, 1); - grid.addComponent(tf, 0, 2); - - addComponent(new Button("Shift label right", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - // Moving component from 0,0 -> 1,0 - grid.removeComponent(l); - grid.addComponent(l, 1, 0); - } - })); - - addComponent(new Button("Shift button right", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - grid.removeComponent(b); - grid.addComponent(b, 1, 1); - } - })); - - addComponent(new Button("Shift text field right", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - grid.removeComponent(tf); - grid.addComponent(new Label("I'm on left"), 0, 2); - grid.addComponent(tf, 1, 2); - } - })); - } - - @Override - protected String getTestDescription() { - return "Click the buttons below the GridLayout to move the components to the right. Should definitely work no matter what."; - } - - @Override - protected Integer getTicketNumber() { - return 5525; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java deleted file mode 100644 index 0fab64989a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.layouts.gridlayout; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; -import org.junit.Test; - -import java.io.IOException; - -public class GridLayoutMoveComponentTest extends MultiBrowserTest { - - @Test - public void componentsShouldMoveRight() throws IOException { - openTestURL(); - - compareScreen("all-left"); - - clickButtonWithCaption("Shift label right"); - compareScreen("label-right"); - - clickButtonWithCaption("Shift button right"); - compareScreen("label-button-right"); - - clickButtonWithCaption("Shift text field right"); - compareScreen("label-button-textfield-right"); - } - - private void clickButtonWithCaption(String caption) { - $(ButtonElement.class).caption(caption).first().click(); - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java deleted file mode 100644 index c07deccd68..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.vaadin.tests.layouts.gridlayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class GridLayoutWidthChange extends AbstractTestUI { - - private GridLayout generateLayout() { - VerticalLayout fields1 = new VerticalLayout(); - - NativeButton nb = new NativeButton("A button"); - nb.setHeight("300px"); - fields1.addComponent(nb); - - VerticalLayout fields3 = new VerticalLayout(); - fields3.addComponent(new TextField("field14")); - - NativeButton b = new NativeButton("A big button"); - b.setWidth("200px"); - b.setHeight("200px"); - - GridLayout layout = new GridLayout(3, 2); - layout.setHideEmptyRowsAndColumns(true); - layout.setWidth("100%"); - layout.addComponent(fields1, 0, 0, 0, 1); - layout.addComponent(b, 2, 1); - - return layout; - } - - @Override - protected void setup(VaadinRequest request) { - final GridLayout layout1 = generateLayout(); - final CustomComponent cc = new CustomComponent(layout1); - cc.setWidth("500px"); - addComponent(cc); - - Button testButton = new Button("Reduce GridLayout parent width", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - cc.setWidth((cc.getWidth() - 100) + "px"); - } - - }); - addComponent(testButton); - } - - @Override - protected String getTestDescription() { - return "A 100% wide GridLayout is wrapped inside a CustomComponent. When the width of the CustomComponent is reduced, the size of the GridLayout should be reduced accordingly. The Buttons should stay in place vertically and just move closer to each other horizontally."; - } - - @Override - protected Integer getTicketNumber() { - // TODO Auto-generated method stub - return null; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java deleted file mode 100644 index ba3d0f06f1..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.tests.layouts.gridlayout; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.AbstractTB3Test; -import com.vaadin.tests.tb3.MultiBrowserTest; -import org.junit.Test; - -import java.io.IOException; - -import static org.junit.Assert.*; - -public class GridLayoutWidthChangeTest extends MultiBrowserTest { - - @Test - public void layoutIsReduced() throws IOException { - openTestURL(); - - compareScreen("initial"); - - $(ButtonElement.class).caption("Reduce GridLayout parent width") - .first().click(); - - compareScreen("buttonMoved"); - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumns.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumns.java deleted file mode 100644 index fc37455752..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumns.java +++ /dev/null @@ -1,54 +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.layouts.gridlayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridSpanEmptyColumns extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - GridLayout gridLayout = new GridLayout(3, 1); - gridLayout.setWidth("1000px"); - - Label bigCell = new Label("big cell"); - bigCell.setId("bigCell"); - Label smallCell = new Label("small cell"); - smallCell.setId("smallCell"); - gridLayout.addComponent(bigCell, 0, 0, 1, 0); // spans first two columns - gridLayout.addComponent(smallCell, 2, 0, 2, 0); // last column only - - addComponent(gridLayout); - } - - @Override - protected String getTestDescription() { - return "A 3x1 grid has a spanned component on the first two cells and a component on the last cell. The two components should occupy 2/3 and 1/3 of the available space respectively, instead of 1/2 each."; - } - - @Override - protected Integer getTicketNumber() { - return 14335; - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumnsTest.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumnsTest.java deleted file mode 100644 index f2b86fb69b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridSpanEmptyColumnsTest.java +++ /dev/null @@ -1,50 +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.layouts.gridlayout; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.testbench.elements.LabelElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Tests that GridLayout handles elements spanning otherwise empty columns - * correctly (#14335) - * - * @since 7.2.5 - * @author markus - */ -public class GridSpanEmptyColumnsTest extends MultiBrowserTest { - - @Test - public void componentsShouldMoveRight() throws IOException { - openTestURL(); - - LabelElement bigCell = $(LabelElement.class).id("bigCell"); - LabelElement smallCell = $(LabelElement.class).id("smallCell"); - - // Width is 1000px. Big cell should take up 2/3, small cell should take - // up 1/3. - assertEquals(667, bigCell.getSize().width); - assertEquals(333, smallCell.getSize().width); - - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java deleted file mode 100644 index 7ea8739cf4..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java +++ /dev/null @@ -1,109 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseAddReplaceMove extends BaseLayoutTestUI { - - /** - * @param layoutClass - */ - public BaseAddReplaceMove(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - // Set undefined height to avoid expanding - l2.setHeight(null); - // extra layout from which components will be moved - final HorizontalLayout source = new HorizontalLayout(); - source.addComponent(new Label("OTHER LABEL 1")); - source.addComponent(new Label("OTHER LABEL 2")); - - final AbstractComponent c1 = new Label("<b>LABEL</b>", ContentMode.HTML); - final AbstractComponent c2 = new Label("<b>LABEL</b>", ContentMode.HTML); - final AbstractComponent c3 = new Table("TABLE"); - c3.setHeight("100px"); - c3.setWidth("100%"); - - final Button btnAdd = new Button("Test add"); - final Button btnReplace = new Button("Test replace"); - final Button btnMove = new Button("Test move"); - final Button btnRemove = new Button("Test remove"); - - l1.addComponent(btnAdd); - l1.addComponent(btnReplace); - l1.addComponent(btnMove); - l1.addComponent(btnRemove); - - btnAdd.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l2.addComponent(new TextField()); - } - }); - btnReplace.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l2.replaceComponent(c1, c3); - } - }); - btnMove.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l2.moveComponentsFrom(source); - } - }); - btnRemove.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l2.removeComponent(c1); - l2.removeComponent(c2); - } - }); - - l2.addComponent(c1); - l2.addComponent(c2); - l2.addComponent(c3); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMoveTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMoveTest.java deleted file mode 100644 index 786e47cef1..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMoveTest.java +++ /dev/null @@ -1,44 +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.layouts.layouttester; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public abstract class BaseAddReplaceMoveTest extends MultiBrowserTest { - @Test - public void LayoutAlignment() throws IOException, InterruptedException { - openTestURL(); - waitForElementPresent(By.className("v-table")); - compareScreen("initial"); - String[] states = { "add", "replace", "move", "remove" }; - List<ButtonElement> buttons = $(ButtonElement.class).all(); - int index = 0; - // go through all buttons click them and see result - for (ButtonElement btn : buttons) { - btn.click(); - waitForElementPresent(By.className("v-table")); - compareScreen(states[index]); - index++; - } - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignment.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignment.java deleted file mode 100644 index bfdc53bf7c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignment.java +++ /dev/null @@ -1,67 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractOrderedLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ -abstract public class BaseAlignment extends BaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - // create two columns of components with different - // alignment. Used to test alignment in layouts - init(); - buildLayout(); - super.setup(request); - } - - public BaseAlignment(Class<? extends AbstractOrderedLayout> layoutClass) { - super(layoutClass); - } - - /** - * Build Layout for test - */ - private void buildLayout() { - for (int i = 0; i < components.length; i++) { - AbstractOrderedLayout layout = null; - try { - layout = (AbstractOrderedLayout) layoutClass.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - layout.setHeight("300px"); - layout.setWidth("200px"); - layout.addComponent(components[i]); - layout.setComponentAlignment(components[i], alignments[i]); - if (i < components.length / 2) { - l1.addComponent(layout); - } else { - l2.addComponent(layout); - } - } - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignmentTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignmentTest.java deleted file mode 100644 index 9dd90a4031..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseAlignmentTest.java +++ /dev/null @@ -1,36 +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.layouts.layouttester; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class BaseAlignmentTest extends MultiBrowserTest { - - @Test - public void layoutAlignment() throws IOException { - openTestURL(); - compareScreen("alignment"); - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaption.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaption.java deleted file mode 100644 index 37ce77e745..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaption.java +++ /dev/null @@ -1,44 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.TabSheet; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseCaption extends BaseLayoutTestUI { - - /** - * @param layoutClass - */ - public BaseCaption(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - l1.addComponent(createLabelsFields(ComboBox.class, true, "")); - l2.addComponent(createLabelsFields(TabSheet.class, false, "")); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaptionTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaptionTest.java deleted file mode 100644 index ed20657e2a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseCaptionTest.java +++ /dev/null @@ -1,35 +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.layouts.layouttester; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class BaseCaptionTest extends MultiBrowserTest { - @Test - public void LayoutCaption() throws IOException, InterruptedException { - openTestURL(); - compareScreen("caption"); - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizing.java deleted file mode 100644 index d9377c6a8b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizing.java +++ /dev/null @@ -1,38 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseComponentSizing extends BaseLayoutTestUI { - - public BaseComponentSizing(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - getLayoutForLayoutSizing("component"); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizingTest.java deleted file mode 100644 index 252cfcd359..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseComponentSizingTest.java +++ /dev/null @@ -1,45 +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.layouts.layouttester; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public abstract class BaseComponentSizingTest extends MultiBrowserTest { - @Test - public void ComponentSizing() throws IOException, InterruptedException { - openTestURL(); - sleep(500); - compareScreen("initial"); - String[] states = { "setSize350px", "setSize_-1px", "setSize75Percent", - "setSize100Percent" }; - List<ButtonElement> buttons = $(ButtonElement.class).all(); - int index = 0; - // go through all buttons click them and see result - for (ButtonElement btn : buttons) { - btn.click(); - sleep(500); - compareScreen(states[index]); - index++; - } - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIcon.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIcon.java deleted file mode 100644 index 34ec7928ff..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIcon.java +++ /dev/null @@ -1,51 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseIcon extends BaseLayoutTestUI { - /** - * @param layoutClass - */ - public BaseIcon(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - l1.addComponent(createLabelsFields(TextField.class, true, "")); - l1.addComponent(createLabelsFields(Label.class, true, "")); - l1.addComponent(createLabelsFields(Button.class, true, "")); - l2.addComponent(createLabelsFields(ComboBox.class, true, "")); - l2.addComponent(createLabelsFields(Link.class, true, "")); - l2.addComponent(createLabelsFields(TabSheet.class, true, "")); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIconTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIconTest.java deleted file mode 100644 index 9322672eae..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseIconTest.java +++ /dev/null @@ -1,37 +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.layouts.layouttester; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class BaseIconTest extends MultiBrowserTest { - - @Test - public void LayoutIcon() throws IOException { - openTestURL(); - compareScreen("icon"); - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpand.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpand.java deleted file mode 100644 index f21db94f80..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpand.java +++ /dev/null @@ -1,77 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Table; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseLayoutExpand extends BaseLayoutTestUI { - - public BaseLayoutExpand(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - class ExpandButton extends Button { - final private AbstractComponent c1; - private AbstractComponent c2; - private float expandComp1; - private float expandComp2; - - public ExpandButton(final AbstractComponent c1, - final AbstractComponent c2, float e1, float e2) { - super(); - this.c1 = c1; - this.c2 = c2; - expandComp1 = e1; - expandComp2 = e2; - setCaption("Expand ratio: " + e1 * 100 + " /" + e2 * 100); - addClickListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - l2.setExpandRatio(c1, expandComp1); - l2.setExpandRatio(c2, expandComp2); - } - }); - } - } - Table t1 = getTestTable(); - Table t2 = getTestTable(); - t1.setSizeFull(); - t2.setSizeFull(); - l2.addComponent(t1); - l2.addComponent(t2); - - l1.addComponent(new ExpandButton(t1, t2, 1.0f, 0.0f)); - l1.addComponent(new ExpandButton(t1, t2, 0.5f, 0.50f)); - l1.addComponent(new ExpandButton(t1, t2, .25f, 0.75f)); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpandTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpandTest.java deleted file mode 100644 index 036b053fb5..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutExpandTest.java +++ /dev/null @@ -1,45 +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.layouts.layouttester; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; -import org.openqa.selenium.By; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public abstract class BaseLayoutExpandTest extends MultiBrowserTest { - - @Test - public void LayoutExpand() throws IOException, InterruptedException { - openTestURL(); - waitForElementPresent(By.className("v-table")); - compareScreen("initial"); - String[] states = { "expand_100_0", "expand_50_50", "expand_25_75" }; - List<ButtonElement> buttons = $(ButtonElement.class).all(); - int index = 0; - // go through all buttons click them and see result - for (ButtonElement btn : buttons) { - btn.click(); - waitForElementPresent(By.className("v-table")); - compareScreen(states[index]); - index++; - } - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java deleted file mode 100644 index e98573d170..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java +++ /dev/null @@ -1,81 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseLayoutForSpacingMargin extends BaseLayoutTestUI { - /** - * @param layoutClass - */ - public BaseLayoutForSpacingMargin( - Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - Table t1 = getTestTable(); - Table t2 = getTestTable(); - t1.setSizeFull(); - t2.setSizeFull(); - l2.addComponent(t1); - l2.setMargin(false); - l2.setSpacing(false); - // Must add something around the hr to avoid the margins collapsing - l2.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); - l2.addComponent(t2); - final Button btn1 = new Button("Toggle margin on/off"); - btn1.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - boolean margin = l2.getMargin().hasLeft(); - l2.setMargin(!margin); - - } - }); - final Button btn2 = new Button("Toggle spacing on/off"); - btn2.addClickListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - l2.setSpacing(!l2.isSpacing()); - } - }); - l1.addComponent(btn1); - l1.addComponent(btn2); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutMarginSpacingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutMarginSpacingTest.java deleted file mode 100644 index 46edfec986..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutMarginSpacingTest.java +++ /dev/null @@ -1,42 +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.layouts.layouttester; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public abstract class BaseLayoutMarginSpacingTest extends MultiBrowserTest { - - @Test - public void LayoutMarginSpacing() throws IOException, InterruptedException { - openTestURL(); - sleep(500); - compareScreen("initial"); - String[] states = { "marginOnSpaceOff", "marginOnfSpaceOn" }; - ButtonElement marginBtn = $(ButtonElement.class).get(0); - ButtonElement spaceBtn = $(ButtonElement.class).get(1); - marginBtn.click(); - sleep(1000); - compareScreen(states[0]); - spaceBtn.click(); - sleep(1000); - compareScreen(states[1]); - } -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutRegErrorTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutRegErrorTest.java deleted file mode 100644 index 61d6f8a362..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutRegErrorTest.java +++ /dev/null @@ -1,37 +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.layouts.layouttester; - -import java.io.IOException; - -import org.junit.Test; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class BaseLayoutRegErrorTest extends MultiBrowserTest { - - @Test - public void LayoutRegError() throws IOException { - openTestURL(); - compareScreen("RegError"); - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizing.java deleted file mode 100644 index edc0b275d1..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizing.java +++ /dev/null @@ -1,40 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseLayoutSizing extends BaseLayoutTestUI { - /** - * @param layoutClass - */ - public BaseLayoutSizing(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - getLayoutForLayoutSizing("layout"); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizingTest.java deleted file mode 100644 index e97353c989..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutSizingTest.java +++ /dev/null @@ -1,50 +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.layouts.layouttester; - -import java.io.IOException; -import java.util.List; - -import org.junit.Test; - -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class BaseLayoutSizingTest extends MultiBrowserTest { - @Test - public void LayoutSizing() throws IOException, InterruptedException { - openTestURL(); - sleep(500); - compareScreen("initial"); - String[] states = { "setSize350px", "setSize_-1px", "setSize75Percent", - "setSize100Percent" }; - List<ButtonElement> buttons = $(ButtonElement.class).all(); - int index = 0; - // go through all buttons click them and see result - for (ButtonElement btn : buttons) { - btn.click(); - sleep(500); - compareScreen(states[index]); - index++; - } - } - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java deleted file mode 100644 index 02fcb677cd..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java +++ /dev/null @@ -1,288 +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.layouts.layouttester; - -import com.vaadin.server.Resource; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Alignment; -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.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -/** - * - * Base class for Layout tests. - */ -public abstract class BaseLayoutTestUI extends AbstractTestUI { - protected static final String FOLDER_16_PNG = "../icons/runo/16/folder.png"; - protected static final String CALENDAR_32_PNG = "../runo/icons/16/calendar.png"; - protected static final String LOCK_16_PNG = "../runo/icons/16/lock.png"; - protected static final String GLOBE_16_PNG = "../runo/icons/16/globe.png"; - public Alignment[] alignments = new Alignment[] { Alignment.TOP_CENTER, - Alignment.TOP_LEFT, Alignment.TOP_RIGHT, Alignment.BOTTOM_CENTER, - Alignment.BOTTOM_LEFT, Alignment.BOTTOM_RIGHT, - Alignment.MIDDLE_CENTER, Alignment.MIDDLE_LEFT, - Alignment.MIDDLE_RIGHT }; - - public final String[] CAPTIONS = new String[] { "", - "VeryLongOneWordCaption", - "Very long caption of 50 approximately symbols aaaaaaaaaaaa aaaaaa aaa " }; - Resource[] ICONS = new Resource[] { new ThemeResource(CALENDAR_32_PNG), - new ThemeResource(LOCK_16_PNG), new ThemeResource(GLOBE_16_PNG) }; - public AbstractComponent[] components = new AbstractComponent[alignments.length]; - - protected AbstractOrderedLayout l1; - protected AbstractOrderedLayout l2; - protected Class<? extends AbstractLayout> layoutClass; - protected VerticalLayout mainLayout = new VerticalLayout(); - - public BaseLayoutTestUI(Class<? extends AbstractLayout> layoutClass) { - super(); - fillComponents(); - this.layoutClass = layoutClass; - - } - - protected void init() { - try { - l1 = (AbstractOrderedLayout) layoutClass.newInstance(); - l2 = (AbstractOrderedLayout) layoutClass.newInstance(); - } catch (InstantiationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IllegalAccessException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - if (layoutClass.equals(HorizontalLayout.class)) { - setLayoutMeasures(l1, l2, "600px", "400px"); - } else if (layoutClass.equals(VerticalLayout.class)) { - setLayoutMeasures(l1, l2, "400px", "400px"); - } else { - setDefaultForVertical(l1, l2); - } - } - - private void fillComponents() { - for (int i = 0; i < components.length; i++) { - String name = "Field" + i; - TextField field = new TextField(); - field.setValue(name); - components[i] = field; - } - } - - protected AbstractLayout createLabelsFields( - Class<? extends AbstractComponent> compType) { - return createLabelsFields(compType, false, null); - } - - protected void getLayoutForLayoutSizing(final String compType) { - - l2.setSpacing(false); - l2.setMargin(false); - - final AbstractComponent c1 = getTestTable(); - c1.setSizeFull(); - final AbstractComponent c2 = getTestTable(); - c2.setSizeFull(); - - class SetSizeButton extends Button { - SetSizeButton(final String size) { - super(); - setCaption("Set size " + size); - addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (compType == "layout") { - l2.setHeight(size); - l2.setWidth(size); - } else if (compType == "component") { - c2.setHeight(size); - c2.setWidth(size); - } else { - } - - } - }); - } - - } - Button btn1 = new SetSizeButton("350px"); - Button btn2 = new SetSizeButton("-1px"); - Button btn3 = new SetSizeButton("75%"); - Button btn4 = new SetSizeButton("100%"); - - l1.addComponent(btn1); - l1.addComponent(btn2); - l1.addComponent(btn3); - l1.addComponent(btn4); - l2.addComponent(c1); - l2.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); - l2.addComponent(c2); - l2.setExpandRatio(c1, 0.5f); - l2.setExpandRatio(c2, 0.5f); - - btn2.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Label newLabel = new Label("--- NEW LABEL ---"); - newLabel.setSizeUndefined(); - l2.addComponent(newLabel); - - } - }); - } - - protected Table getTestTable() { - Table t = new Table(); - t.setPageLength(5); - t.addContainerProperty("test", String.class, null); - t.addItem(new Object[] { "qwertyuiop asdfghjköäxccvbnm,m,." }, 1); - t.addItem(new Object[] { "YGVYTCTCTRXRXRXRX" }, 2); - return t; - } - - protected AbstractLayout createLabelsFields( - Class<? extends AbstractComponent> compType, boolean useIcon, - String ErrorMessage) { - AbstractLayout mainLayout = new VerticalLayout(); - AbstractLayout curLayout = null; - try { - curLayout = layoutClass.newInstance(); - } catch (InstantiationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IllegalAccessException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - final Component[] components = new Component[CAPTIONS.length]; - - for (int i = 0; i < components.length; i++) { - AbstractComponent comp = null; - try { - comp = compType.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - components[i] = comp; - comp.setCaption(CAPTIONS[i]); - if (useIcon) { - comp.setIcon(ICONS[i]); - } - if (ErrorMessage != null) { - if (ErrorMessage.length() == 0) { - comp.setComponentError(new UserError(null)); - } else { - comp.setComponentError(new UserError(ErrorMessage)); - } - } - // if component is a tab sheet add two tabs for it - if (comp instanceof TabSheet) { - comp.setSizeUndefined(); - TabSheet tab = (TabSheet) comp; - tab.addTab(new UndefWideLabel("TAB1"), "TAB1", - new ThemeResource(GLOBE_16_PNG)); - tab.addTab(new UndefWideLabel("TAB2"), "TAB2", null); - } - curLayout.addComponent(comp); - mainLayout.addComponent(curLayout); - } - return mainLayout; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. - * VaadinRequest) - */ - @Override - protected void setup(VaadinRequest request) { - mainLayout.addComponent(l1); - mainLayout.addComponent(l2); - addComponent(mainLayout); - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() - */ - @Override - protected String getTestDescription() { - return null; - } - - protected void setLayoutMeasures(AbstractOrderedLayout l1, - AbstractOrderedLayout l2, String w, String h) { - l1.setWidth(w); - l1.setHeight(h); - l2.setWidth(h); - l2.setHeight(w); - } - - protected void setDefaultForVertical(AbstractOrderedLayout l1, - AbstractOrderedLayout l2) { - l1.setWidth("800px"); - l1.setHeight("600px"); - l2.setWidth("800px"); - l2.setHeight("600px"); - } - - protected void setDefaultForHorizontal(AbstractOrderedLayout l1, - AbstractOrderedLayout l2) { - l1.setWidth("600px"); - l1.setHeight("600px"); - l2.setWidth("600px"); - l2.setHeight("600px"); - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() - */ - @Override - protected Integer getTicketNumber() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseRegError.java b/uitest/src/com/vaadin/tests/layouts/layouttester/BaseRegError.java deleted file mode 100644 index df4053b533..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/BaseRegError.java +++ /dev/null @@ -1,60 +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.layouts.layouttester; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.AbstractLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class BaseRegError extends BaseLayoutTestUI { - - public BaseRegError(Class<? extends AbstractLayout> layoutClass) { - super(layoutClass); - } - - @Override - protected void setup(VaadinRequest request) { - init(); - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - - l1.addComponent(createLabelsFields(Label.class, true, "")); - l1.addComponent(createLabelsFields(Button.class, true, "")); - l1.addComponent(createLabelsFields(TabSheet.class, true, "")); - l1.addComponent(createLabelsFields(TextField.class, true, "")); - - l2.addComponent(createLabelsFields(ComboBox.class, true, "")); - l2.addComponent(createLabelsFields(DateField.class, true, "")); - l2.addComponent(createLabelsFields(NativeSelect.class, true, "")); - l2.addComponent(createLabelsFields(CheckBox.class, true, "")); - - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java deleted file mode 100644 index 84254b4935..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java +++ /dev/null @@ -1,105 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class GridAddReplaceMove extends GridBaseLayoutTestUI { - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. - * VaadinRequest) - */ - @Override - protected void setup(VaadinRequest request) { - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - - final HorizontalLayout source = new HorizontalLayout(); - source.addComponent(new Label("OTHER LABEL 1")); - source.addComponent(new Label("OTHER LABEL 2")); - - final AbstractComponent c1 = new Label("<b>LABEL</b>", ContentMode.HTML); - final AbstractComponent c2 = new Label("<b>LABEL</b>", ContentMode.HTML); - final AbstractComponent c3 = new Table("TABLE"); - c3.setHeight("100px"); - c3.setWidth("100%"); - - final Button btnAdd = new Button("Test add"); - final Button btnReplace = new Button("Test replace"); - final Button btnMove = new Button("Test move"); - final Button btnRemove = new Button("Test remove"); - - layout.addComponent(btnAdd); - layout.addComponent(btnReplace); - layout.addComponent(btnMove); - layout.addComponent(btnRemove); - - btnAdd.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.addComponent(new TextField()); - } - }); - btnReplace.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.replaceComponent(c1, c3); - } - }); - btnMove.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.moveComponentsFrom(source); - } - }); - btnRemove.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - layout.removeComponent(c1); - layout.removeComponent(c2); - } - }); - - layout.addComponent(c1); - layout.addComponent(c2); - layout.addComponent(c3); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMoveTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMoveTest.java deleted file mode 100644 index f83a6ccf67..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMoveTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAddReplaceMoveTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridAddReplaceMoveTest extends BaseAddReplaceMoveTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignment.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignment.java deleted file mode 100644 index e061532690..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignment.java +++ /dev/null @@ -1,41 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; - -public class GridAlignment extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - buildLayout(); - super.setup(request); - } - - /** - * Build Layout for test - */ - private void buildLayout() { - layout.setColumns(3); - layout.setRows(3); - // layout.setHeight("600px"); - // layout.setWidth("900px"); - for (int i = 0; i < components.length; i++) { - layout.addComponent(components[i]); - layout.setComponentAlignment(components[i], alignments[i]); - } - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignmentTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignmentTest.java deleted file mode 100644 index cdc040930b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridAlignmentTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAlignmentTest; - -public class GridAlignmentTest extends BaseAlignmentTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java deleted file mode 100644 index c08e5286a6..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java +++ /dev/null @@ -1,108 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.layouts.layouttester.BaseLayoutTestUI; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; - -/** - * - * @since - * @author Vaadin Ltd - */ -public abstract class GridBaseLayoutTestUI extends BaseLayoutTestUI { - protected GridLayout layout = new GridLayout(); - - /** - * @param layoutClass - */ - public GridBaseLayoutTestUI() { - super(GridLayout.class); - layout.setHideEmptyRowsAndColumns(true); - } - - @Override - protected void setup(VaadinRequest request) { - layout.setMargin(true); - layout.setSizeFull(); - getUI().setContent(layout); - } - - @Override - protected void getLayoutForLayoutSizing(final String compType) { - - layout.setSpacing(false); - layout.setMargin(false); - - final AbstractComponent c1 = getTestTable(); - c1.setSizeFull(); - final AbstractComponent c2 = getTestTable(); - c2.setSizeFull(); - - class SetSizeButton extends Button { - SetSizeButton(final String size) { - super(); - setCaption("Set size " + size); - addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (compType == "layout") { - layout.setHeight(size); - layout.setWidth(size); - } else if (compType == "component") { - c2.setHeight(size); - c2.setWidth(size); - } else { - } - - } - }); - } - - } - Button btn1 = new SetSizeButton("550px"); - Button btn2 = new SetSizeButton("-1px"); - Button btn3 = new SetSizeButton("75%"); - Button btn4 = new SetSizeButton("100%"); - - layout.addComponent(btn1); - layout.addComponent(btn2); - layout.addComponent(btn3); - layout.addComponent(btn4); - layout.addComponent(c1); - layout.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); - layout.addComponent(c2); - btn2.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Label newLabel = new Label("--- NEW LABEL ---"); - newLabel.setSizeUndefined(); - layout.addComponent(newLabel); - } - }); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaption.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaption.java deleted file mode 100644 index 7b1c3d9a65..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaption.java +++ /dev/null @@ -1,35 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; - -public class GridCaption extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - layout.addComponent(createLabelsFields(Button.class, true, "")); - layout.addComponent(createLabelsFields(Label.class, true, "")); - layout.addComponent(createLabelsFields(ComboBox.class, true, "")); - layout.addComponent(createLabelsFields(TabSheet.class, false, "")); - super.setup(request); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaptionTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaptionTest.java deleted file mode 100644 index ab8046ebf3..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridCaptionTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseCaptionTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridCaptionTest extends BaseCaptionTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizing.java deleted file mode 100644 index bebccfbf9d..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizing.java +++ /dev/null @@ -1,32 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridComponentSizing extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - getLayoutForLayoutSizing("component"); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizingTest.java deleted file mode 100644 index 6572bd2a50..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridComponentSizingTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseComponentSizingTest; - -public class GridComponentSizingTest extends BaseComponentSizingTest { - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIcon.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIcon.java deleted file mode 100644 index 863a4f2c1d..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIcon.java +++ /dev/null @@ -1,42 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridIcon extends GridBaseLayoutTestUI { - @Override - protected void setup(VaadinRequest request) { - layout.addComponent(createLabelsFields(TextField.class, true, "")); - layout.addComponent(createLabelsFields(Label.class, true, "")); - layout.addComponent(createLabelsFields(Button.class, true, "")); - layout.addComponent(createLabelsFields(ComboBox.class, true, "")); - layout.addComponent(createLabelsFields(Link.class, true, "")); - layout.addComponent(createLabelsFields(TabSheet.class, true, "")); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIconTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIconTest.java deleted file mode 100644 index 25a0faa88e..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridIconTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseIconTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridIconTest extends BaseIconTest { - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpand.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpand.java deleted file mode 100644 index b3a84cdc26..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpand.java +++ /dev/null @@ -1,64 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.Table; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutExpand extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - class ExpandButton extends Button { - - public ExpandButton(final int i1, final int i2, final float e1, - final float e2) { - super(); - setCaption("Expand ratio: " + e1 * 100 + " /" + e2 * 100); - addClickListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - layout.setColumnExpandRatio(i1, e1); - layout.setColumnExpandRatio(i2, e2); - } - }); - } - } - Table t1 = getTestTable(); - Table t2 = getTestTable(); - t1.setSizeFull(); - t2.setSizeFull(); - layout.setColumns(4); - layout.setRows(4); - layout.addComponent(new ExpandButton(1, 2, 1.0f, 0.0f), 0, 0); - layout.addComponent(new ExpandButton(1, 2, 0.5f, 0.50f), 0, 1); - layout.addComponent(new ExpandButton(1, 2, .25f, 0.75f), 0, 2); - - layout.addComponent(t1, 1, 1); - layout.addComponent(t2, 2, 1); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpandTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpandTest.java deleted file mode 100644 index 2a49af52a9..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutExpandTest.java +++ /dev/null @@ -1,26 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutExpandTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutExpandTest extends BaseLayoutExpandTest { -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java deleted file mode 100644 index 78a67bdf82..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java +++ /dev/null @@ -1,74 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutMarginSpacing extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - Table t1 = getTestTable(); - Table t2 = getTestTable(); - t1.setSizeFull(); - t2.setSizeFull(); - - final Button btn1 = new Button("Toggle margin on/off"); - btn1.addClickListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - boolean margin = layout.getMargin().hasLeft(); - layout.setMargin(!margin); - - } - }); - final Button btn2 = new Button("Toggle spacing on/off"); - btn2.addClickListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - layout.setSpacing(!layout.isSpacing()); - } - }); - layout.addComponent(btn1); - layout.addComponent(btn2); - - layout.addComponent(t1); - layout.setMargin(false); - layout.setSpacing(false); - // Must add something around the hr to avoid the margins collapsing - layout.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); - layout.addComponent(t2); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacingTest.java deleted file mode 100644 index 516f3b088b..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacingTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutMarginSpacingTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutMarginSpacingTest extends BaseLayoutMarginSpacingTest { - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegError.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegError.java deleted file mode 100644 index 5b4dd2a947..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegError.java +++ /dev/null @@ -1,54 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutRegError extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - buildLayout(); - super.setup(request); - } - - private void buildLayout() { - - layout.addComponent(createLabelsFields(Label.class, true, "")); - layout.addComponent(createLabelsFields(Button.class, true, "")); - layout.addComponent(createLabelsFields(TabSheet.class, true, "")); - layout.addComponent(createLabelsFields(TextField.class, true, "")); - - layout.addComponent(createLabelsFields(ComboBox.class, true, "")); - layout.addComponent(createLabelsFields(DateField.class, true, "")); - layout.addComponent(createLabelsFields(NativeSelect.class, true, "")); - layout.addComponent(createLabelsFields(CheckBox.class, true, "")); - - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegErrorTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegErrorTest.java deleted file mode 100644 index e377a7b0c4..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutRegErrorTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutRegErrorTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutRegErrorTest extends BaseLayoutRegErrorTest { - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizing.java deleted file mode 100644 index 8358f91997..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizing.java +++ /dev/null @@ -1,32 +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.layouts.layouttester.GridLayout; - -import com.vaadin.server.VaadinRequest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutSizing extends GridBaseLayoutTestUI { - - @Override - protected void setup(VaadinRequest request) { - getLayoutForLayoutSizing("layout"); - super.setup(request); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizingTest.java deleted file mode 100644 index c8a48cd70c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutSizingTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.GridLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutSizingTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class GridLayoutSizingTest extends BaseLayoutSizingTest { - -}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMove.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMove.java deleted file mode 100644 index c4787045fc..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMove.java +++ /dev/null @@ -1,31 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseAddReplaceMove; -import com.vaadin.ui.HorizontalLayout; - -public class HAddReplaceMove extends BaseAddReplaceMove { - - /** - * @param layoutClass - */ - public HAddReplaceMove() { - super(HorizontalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMoveTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMoveTest.java deleted file mode 100644 index 367664069d..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAddReplaceMoveTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAddReplaceMoveTest; - -public class HAddReplaceMoveTest extends BaseAddReplaceMoveTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignment.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignment.java deleted file mode 100644 index 9864fcaa41..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignment.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAlignment; -import com.vaadin.ui.HorizontalLayout; - -public class HAlignment extends BaseAlignment { - - public HAlignment() { - super(HorizontalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignmentTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignmentTest.java deleted file mode 100644 index 055ad8e607..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HAlignmentTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAlignmentTest; - -public class HAlignmentTest extends BaseAlignmentTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaption.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaption.java deleted file mode 100644 index 3088a00c39..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaption.java +++ /dev/null @@ -1,31 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseCaption; -import com.vaadin.ui.HorizontalLayout; - -public class HCaption extends BaseCaption { - - /** - * @param layoutClass - */ - public HCaption() { - super(HorizontalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaptionTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaptionTest.java deleted file mode 100644 index c10da9eefe..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HCaptionTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseCaptionTest; - -public class HCaptionTest extends BaseCaptionTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizing.java deleted file mode 100644 index b042c018eb..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizing.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseComponentSizing; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HComponentSizing extends BaseComponentSizing { - - /** - * @param layoutClass - */ - public HComponentSizing() { - super(HorizontalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizingTest.java deleted file mode 100644 index 86aa330901..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HComponentSizingTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseComponentSizingTest; - -public class HComponentSizingTest extends BaseComponentSizingTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIcon.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIcon.java deleted file mode 100644 index cb4eb321b9..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIcon.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseIcon; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HIcon extends BaseIcon { - - /** - * @param layoutClass - */ - public HIcon() { - super(HorizontalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIconTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIconTest.java deleted file mode 100644 index e01e1d1726..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HIconTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseIconTest; - -public class HIconTest extends BaseIconTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpand.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpand.java deleted file mode 100644 index 273ca07bc4..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpand.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseLayoutExpand; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HLayoutExpand extends BaseLayoutExpand { - - /** - * @param layoutClass - */ - public HLayoutExpand() { - super(HorizontalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpandTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpandTest.java deleted file mode 100644 index f24abba9d2..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutExpandTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutExpandTest; - -public class HLayoutExpandTest extends BaseLayoutExpandTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacing.java deleted file mode 100644 index 9fea380155..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacing.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseLayoutForSpacingMargin; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HLayoutMarginSpacing extends BaseLayoutForSpacingMargin { - - /** - * @param layoutClass - */ - public HLayoutMarginSpacing() { - super(HorizontalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacingTest.java deleted file mode 100644 index 1abae12ce6..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutMarginSpacingTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutMarginSpacingTest; - -public class HLayoutMarginSpacingTest extends BaseLayoutMarginSpacingTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegError.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegError.java deleted file mode 100644 index 3c7134a061..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegError.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseRegError; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HLayoutRegError extends BaseRegError { - - /** - * @param layoutClass - */ - public HLayoutRegError() { - super(HorizontalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegErrorTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegErrorTest.java deleted file mode 100644 index 673c08d4fa..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutRegErrorTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutRegErrorTest; - -public class HLayoutRegErrorTest extends BaseLayoutRegErrorTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizing.java deleted file mode 100644 index 350037b05c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizing.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.HLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseComponentSizing; -import com.vaadin.ui.HorizontalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class HLayoutSizing extends BaseComponentSizing { - - /** - * @param layoutClass - */ - public HLayoutSizing() { - super(HorizontalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizingTest.java deleted file mode 100644 index 5f4d52a5d5..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HLayout/HLayoutSizingTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.HLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutSizingTest; - -public class HLayoutSizingTest extends BaseLayoutSizingTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java b/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java deleted file mode 100644 index c998ce458a..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.vaadin.tests.layouts.layouttester; - -import com.vaadin.ui.Label; - -public class UndefWideLabel extends Label { - - public UndefWideLabel(String value) { - super(value); - setWidth(null); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMove.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMove.java deleted file mode 100644 index a0ef960f57..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMove.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseAddReplaceMove; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VAddReplaceMove extends BaseAddReplaceMove { - - /** - * @param layoutClass - */ - public VAddReplaceMove() { - super(VerticalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMoveTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMoveTest.java deleted file mode 100644 index 70f7237c96..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAddReplaceMoveTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAddReplaceMoveTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class VAddReplaceMoveTest extends BaseAddReplaceMoveTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignment.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignment.java deleted file mode 100644 index 9872b4bfd7..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignment.java +++ /dev/null @@ -1,25 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAlignment; -import com.vaadin.ui.VerticalLayout; - -public class VAlignment extends BaseAlignment { - public VAlignment() { - super(VerticalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignmentTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignmentTest.java deleted file mode 100644 index f49787754c..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VAlignmentTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseAlignmentTest; - -public class VAlignmentTest extends BaseAlignmentTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaption.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaption.java deleted file mode 100644 index b2f50961cb..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaption.java +++ /dev/null @@ -1,38 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseCaption; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VCaption extends BaseCaption { - - /** - * @param layoutClass - */ - public VCaption() { - super(VerticalLayout.class); - // TODO Auto-generated constructor stub - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaptionTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaptionTest.java deleted file mode 100644 index 942736b286..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VCaptionTest.java +++ /dev/null @@ -1,27 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseCaptionTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class VCaptionTest extends BaseCaptionTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizing.java deleted file mode 100644 index 67fcb85652..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizing.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseComponentSizing; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VComponentSizing extends BaseComponentSizing { - - /** - * @param layoutClass - */ - public VComponentSizing() { - super(VerticalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizingTest.java deleted file mode 100644 index bef10a6a58..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VComponentSizingTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseComponentSizingTest; - -public class VComponentSizingTest extends BaseComponentSizingTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIcon.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIcon.java deleted file mode 100644 index 1420be4907..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIcon.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseIcon; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VIcon extends BaseIcon { - - /** - * @param layoutClass - */ - public VIcon() { - super(VerticalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIconTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIconTest.java deleted file mode 100644 index 221bf2e2db..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VIconTest.java +++ /dev/null @@ -1,21 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseIconTest; - -public class VIconTest extends BaseIconTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpand.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpand.java deleted file mode 100644 index 15a31b16f0..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpand.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseLayoutExpand; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VLayoutExpand extends BaseLayoutExpand { - - /** - * @param layoutClass - */ - public VLayoutExpand() { - super(VerticalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpandTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpandTest.java deleted file mode 100644 index 152e3f0b86..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutExpandTest.java +++ /dev/null @@ -1,26 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutExpandTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class VLayoutExpandTest extends BaseLayoutExpandTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacing.java deleted file mode 100644 index d6d9040bae..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacing.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseLayoutForSpacingMargin; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VLayoutMarginSpacing extends BaseLayoutForSpacingMargin { - - /** - * @param layoutClass - */ - public VLayoutMarginSpacing() { - super(VerticalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacingTest.java deleted file mode 100644 index 89ffdf792f..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutMarginSpacingTest.java +++ /dev/null @@ -1,22 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutMarginSpacingTest; - -public class VLayoutMarginSpacingTest extends BaseLayoutMarginSpacingTest { - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegError.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegError.java deleted file mode 100644 index 72fd35b842..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegError.java +++ /dev/null @@ -1,36 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseRegError; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VLayoutRegError extends BaseRegError { - - /** - * @param layoutClass - */ - public VLayoutRegError() { - super(VerticalLayout.class); - } -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegErrorTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegErrorTest.java deleted file mode 100644 index 7f803781fb..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutRegErrorTest.java +++ /dev/null @@ -1,26 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutRegErrorTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class VLayoutRegErrorTest extends BaseLayoutRegErrorTest { -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizing.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizing.java deleted file mode 100644 index ea6464cfb7..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizing.java +++ /dev/null @@ -1,37 +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.layouts.layouttester.VLayout; - -import com.vaadin.annotations.Theme; -import com.vaadin.tests.layouts.layouttester.BaseComponentSizing; -import com.vaadin.ui.VerticalLayout; - -/** - * - * @since - * @author Vaadin Ltd - */ - -public class VLayoutSizing extends BaseComponentSizing { - - /** - * @param layoutClass - */ - public VLayoutSizing() { - super(VerticalLayout.class); - } - -} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizingTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizingTest.java deleted file mode 100644 index 519f8113f8..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VLayout/VLayoutSizingTest.java +++ /dev/null @@ -1,26 +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.layouts.layouttester.VLayout; - -import com.vaadin.tests.layouts.layouttester.BaseLayoutSizingTest; - -/** - * - * @since - * @author Vaadin Ltd - */ -public class VLayoutSizingTest extends BaseLayoutSizingTest { -} |