aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/layouts/layouttester
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
committerArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
commit7b25b3886ea95bc6495506fbe9472e45fcbde684 (patch)
tree0b93cb65dab437feb46720659a63b8f1ef48f7f4 /uitest/src/com/vaadin/tests/layouts/layouttester
parent8941056349e302e687e40e94c13709e75f256d73 (diff)
downloadvaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.tar.gz
vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.zip
Renamed tests -> uitest and tests/testbench -> uitest/src (#9299)
Diffstat (limited to 'uitest/src/com/vaadin/tests/layouts/layouttester')
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/AbstractLayoutTests.java30
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java618
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java578
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html896
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java130
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java12
-rw-r--r--uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java615
7 files changed, 2879 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/AbstractLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/AbstractLayoutTests.java
new file mode 100644
index 0000000000..c96d542a4c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/AbstractLayoutTests.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.layouts.layouttester;
+
+import com.vaadin.ui.Layout;
+
+public abstract class AbstractLayoutTests {
+
+ protected static final String FOLDER_16_PNG = "../icons/runo/16/folder.png";
+ protected static final String CALENDAR_32_PNG = "../runo/icons/32/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";
+
+ abstract protected Layout getCaptionsTests();
+
+ abstract protected Layout getIconsTests();
+
+ abstract protected Layout getRequiredErrorIndicatorsTests();
+
+ abstract protected Layout getAlignmentTests();
+
+ abstract protected Layout getExpandRatiosTests();
+
+ abstract protected Layout getMarginSpacingTests();
+
+ abstract protected Layout getComponentAddReplaceMoveTests();
+
+ abstract protected Layout getComponentSizingTests();
+
+ abstract protected Layout getLayoutSizingTests();
+
+}
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
new file mode 100644
index 0000000000..8da94feb7f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
@@ -0,0 +1,618 @@
+package com.vaadin.tests.layouts.layouttester;
+
+import java.util.Date;
+
+import com.vaadin.Application;
+import com.vaadin.server.Resource;
+import com.vaadin.server.SystemError;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
+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.DateField;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.InlineDateField;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+public class GridLayoutTests extends AbstractLayoutTests {
+
+ private AbstractComponent rc1, col1, col2, col3, row1, row2, row3, x3, x22;
+
+ public GridLayoutTests(Application application) {
+ super();
+ }
+
+ @Override
+ protected Layout getAlignmentTests() {
+ HorizontalLayout hlo = new HorizontalLayout();
+ hlo.setSpacing(true);
+ GridLayout glo = getTestGrid();
+ glo.addStyleName(Reindeer.LAYOUT_WHITE);
+ Alignment[] alignments = new Alignment[] { Alignment.BOTTOM_LEFT,
+ Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT,
+ Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER,
+ Alignment.MIDDLE_RIGHT, Alignment.TOP_LEFT,
+ Alignment.TOP_CENTER, Alignment.TOP_RIGHT };
+
+ glo.replaceComponent(col1, col1 = new TextField());
+ glo.replaceComponent(col2, col2 = new TextField());
+ glo.replaceComponent(col3, col3 = new TextField());
+ ((TextField) col1).setValue("BOTTOM_RIGHT");
+ ((TextField) col2).setValue("BOTTOM_LEFT");
+ ((TextField) col3).setValue("BOTTOM_CENTER");
+ glo.setComponentAlignment(col2, alignments[0]);
+ glo.setComponentAlignment(col3, alignments[1]);
+ glo.setComponentAlignment(col1, alignments[2]);
+
+ glo.setComponentAlignment(row1, alignments[3]);
+ glo.setComponentAlignment(row2, alignments[4]);
+ glo.setComponentAlignment(row3, alignments[5]);
+ hlo.addComponent(glo);
+ glo = getTestGrid();
+ glo.replaceComponent(row1, row1 = new DateField());
+ glo.replaceComponent(row2, row2 = new DateField());
+ glo.replaceComponent(row3, row3 = new DateField());
+ ((DateField) row1).setResolution(DateField.RESOLUTION_SEC);
+ ((DateField) row2).setResolution(DateField.RESOLUTION_SEC);
+ ((DateField) row3).setResolution(DateField.RESOLUTION_SEC);
+ glo.setComponentAlignment(col2, alignments[6]);
+ glo.setComponentAlignment(col3, alignments[7]);
+ glo.setComponentAlignment(col1, alignments[8]);
+ hlo.addComponent(glo);
+ return hlo;
+ }
+
+ @Override
+ protected Layout getCaptionsTests() {
+ GridLayout glo = getTestGrid();
+ glo.setWidth("600px");
+ String[] captions = new String[] {
+ "",
+ "abcdefghijklmnopq",
+ "abc def hij klm nop qrs tuv xyz qaz wsx edc rfv tgb yhn ujm mko nji bhu vgy cft cde" };
+ glo.replaceComponent(col1, col1 = new TextField());
+ glo.replaceComponent(col2, col2 = new TextField());
+ glo.replaceComponent(col3, col3 = new TextField());
+
+ col1.setCaption(captions[0]);
+ col2.setCaption(captions[1]);
+ col3.setCaption(captions[2]);
+ col3.setIcon(new ThemeResource(LOCK_16_PNG));
+
+ glo.replaceComponent(row1, row1 = new Label());
+ glo.replaceComponent(row2, row2 = new Label());
+ glo.replaceComponent(row3, row3 = new Label());
+
+ row1.setCaption(captions[0]);
+ row2.setCaption(captions[1]);
+ row3.setCaption(captions[2]);
+
+ glo.replaceComponent(x3, x3 = getTestTabsheet());
+ glo.replaceComponent(x22, x22 = getTestTable());
+ x22.setComponentError(new UserError("component error, user error"));
+
+ x3.setCaption(captions[1]);
+ x22.setCaption(captions[2]);
+
+ return glo;
+ }
+
+ @Override
+ protected Layout getComponentAddReplaceMoveTests() {
+ final GridLayout glo = getTestGrid();
+ glo.setHeight("350px");
+ Layout baseLayout = getBaseLayout();
+ final Button button1 = new Button("Test add");
+ final Button button2 = new Button("Test replace");
+ final Button button3 = new Button("Test move");
+ final Button button4 = new Button("Test remove comp 1,1");
+ final Button button5 = new Button("Test remove row 0");
+ final Button button6 = new Button("Test remove comp row3");
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ baseLayout.addComponent(button5);
+ baseLayout.addComponent(button6);
+ baseLayout.addComponent(glo);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+ button5.setEnabled(false);
+ button6.setEnabled(false);
+
+ final HorizontalLayout source = new HorizontalLayout();
+ source.addComponent(new Label("MOVE LABEL 1"));
+ source.addComponent(new Label("MOVE LABEL 2"));
+
+ final AbstractComponent cc1 = getTestTabsheet();
+ cc1.setCaption("ADDED COMPONENT");
+
+ final AbstractComponent cc2 = getTestTabsheet();
+ cc2.setCaption("REPLACEMENT COMPONENT");
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.addComponent(cc1);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.replaceComponent(x22, cc2);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.moveComponentsFrom(source);
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.removeComponent(1, 1);
+ button4.setEnabled(false);
+ button5.setEnabled(true);
+ }
+ });
+
+ button5.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.removeRow(0);
+ button5.setEnabled(false);
+ button6.setEnabled(true);
+ }
+ });
+ button6.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.removeComponent(row3);
+ button6.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getComponentSizingTests() {
+ final GridLayout glo = getTestGrid();
+ glo.setHeight("350px");
+ Layout baseLayout = getBaseLayout();
+ final Button button1 = new Button("full size, 3x1");
+ final Button button2 = new Button("200 px width, 3x1");
+ final Button button3 = new Button("200 px width, table");
+ final Button button4 = new Button("undefined size+add, table");
+
+ glo.replaceComponent(x22, x22 = getTestTable());
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ baseLayout.addComponent(glo);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ x3.setSizeFull();
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ x3.setWidth("200px");
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ x22.setWidth("200px");
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ x22.setSizeUndefined();
+ ((Table) x22).addItem(new Object[] { "NEW ROW1" }, 3);
+ ((Table) x22).addItem(new Object[] { "NEW ROW2" }, 4);
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getExpandRatiosTests() {
+ final GridLayout glo = getTestGrid();
+ Layout baseLayout = getBaseLayout();
+ final Button button1 = new Button("set col 3 expand 1");
+ final Button button2 = new Button("set all cols expand 0.25");
+ final Button button3 = new Button("set row 0 expand 0.5");
+ final Button button4 = new Button("set row 3 expand 0.2");
+ glo.setHeight("400px");
+ glo.replaceComponent(x22, x22 = getTestTable());
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ baseLayout.addComponent(glo);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setColumnExpandRatio(3, 1);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setColumnExpandRatio(0, 0.25f);
+ glo.setColumnExpandRatio(1, 0.25f);
+ glo.setColumnExpandRatio(2, 0.25f);
+ glo.setColumnExpandRatio(3, 0.25f);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setRowExpandRatio(0, 0.5f);
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setRowExpandRatio(3, 0.3f);
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getIconsTests() {
+ GridLayout glo = getTestGrid();
+ glo.setWidth("600px");
+ Resource[] icons = new Resource[] { new ThemeResource(CALENDAR_32_PNG),
+ new ThemeResource(LOCK_16_PNG) };
+
+ glo.replaceComponent(col1, col1 = new TextField("TEXTFIELD"));
+ glo.replaceComponent(col2, col2 = new Label("LABEL"));
+ glo.replaceComponent(col3, col3 = new Link("LINK", null));
+
+ col1.setIcon(icons[0]);
+ col2.setIcon(icons[1]);
+ col3.setIcon(icons[0]);
+ rc1.setIcon(icons[1]);
+ col3.setCaption("long test caption bewucbwuebco or bmort b cbwecubw wbeucwe asdasd asdasda asdasd");
+ col3.setComponentError(new UserError("component error, user error"));
+
+ glo.replaceComponent(row1, row1 = new DateField());
+ glo.replaceComponent(row2, row2 = new NativeSelect());
+ glo.replaceComponent(row3, row3 = getTestTabsheet());
+
+ row1.setIcon(icons[1]);
+ row2.setIcon(icons[0]);
+ row3.setIcon(icons[1]);
+
+ glo.replaceComponent(x3, x3 = new CheckBox("CHECKBOX"));
+ glo.replaceComponent(x22, x22 = new Panel("PANEL"));
+ x22.setIcon(new ThemeResource(CALENDAR_32_PNG));
+
+ x3.setIcon(icons[0]);
+ x22.setIcon(icons[1]);
+
+ return glo;
+ }
+
+ @Override
+ protected Layout getLayoutSizingTests() {
+ final GridLayout glo = getTestGrid();
+ Layout baseLayout = getBaseLayout();
+ baseLayout.setWidth("500px");
+ baseLayout.setHeight("500px");
+ final Button button1 = new Button("Set fixed height 350px");
+ final Button button2 = new Button(
+ "Set undefined size and add component");
+ final Button button3 = new Button("Set fixed width and height 75%");
+ final Button button4 = new Button("Set size full");
+
+ glo.replaceComponent(x22, x22 = getTestTable());
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ baseLayout.addComponent(glo);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setHeight("350px");
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setSizeUndefined();
+ glo.addComponent(new Label("--- NEW LABEL ---"));
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setWidth("75%");
+ glo.setHeight("75%");
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setSizeFull();
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getMarginSpacingTests() {
+ final GridLayout glo = getTestGrid();
+ Layout baseLayout = getBaseLayout();
+ baseLayout.setWidth("500px");
+ baseLayout.setHeight("500px");
+ final Button button1 = new Button("Set margin on");
+ final Button button2 = new Button("Set spacing on");
+ final Button button3 = new Button("Set margin off");
+ final Button button4 = new Button("Set spacing off");
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ baseLayout.addComponent(glo);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setMargin(true);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setSpacing(true);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setMargin(false);
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ glo.setSpacing(false);
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getRequiredErrorIndicatorsTests() {
+ GridLayout glo = getTestGrid();
+ glo.setWidth("600px");
+ Resource[] icons = new Resource[] { new ThemeResource(CALENDAR_32_PNG),
+ new ThemeResource(LOCK_16_PNG) };
+
+ glo.replaceComponent(col1, col1 = new TextField("TEXTFIELD"));
+ glo.replaceComponent(col2, col2 = new Label("LABEL"));
+ glo.replaceComponent(col3, col3 = new Link("LINK", null));
+
+ col1.setIcon(icons[0]);
+ col1.setComponentError(new UserError("component error, user error"));
+ col2.setComponentError(new SystemError("component error, system error"));
+ col3.setComponentError(new UserError("component error, user error"));
+
+ glo.replaceComponent(row1, row1 = new DateField());
+ glo.replaceComponent(row2, row2 = new NativeSelect());
+ glo.replaceComponent(row3, row3 = getTestTabsheet());
+
+ ((AbstractField<?>) col1).setRequired(true);
+ ((AbstractField<?>) col1).setValidationVisible(true);
+ ((AbstractField<?>) col1).setRequiredError("required error");
+
+ ((AbstractField<?>) row1).setRequired(true);
+ ((AbstractField<?>) row1).setValidationVisible(true);
+ ((AbstractField<?>) row1).setRequiredError("required error");
+
+ ((AbstractField<?>) row2).setRequired(true);
+ ((AbstractField<?>) row2).setValidationVisible(true);
+ ((AbstractField<?>) row2).setRequiredError("required error");
+ row2.setComponentError(new UserError("component error, user error"));
+
+ row3.setComponentError(new UserError("component error, user error"));
+ row3.setIcon(icons[1]);
+ row3.setCaption("long test caption bewucbwuebco or bmort b cbwecubw wbeucwe asdasd asdasda asdasd");
+
+ glo.replaceComponent(x3, x3 = new CheckBox("CHECKBOX"));
+ glo.replaceComponent(x22, x22 = new Panel("PANEL"));
+
+ x3.setComponentError(new UserError("component error, user error"));
+ x22.setComponentError(new UserError("component error, user error"));
+ x22.setIcon(icons[0]);
+
+ return glo;
+ }
+
+ private GridLayout getTestGrid() {
+ // Create a 4 by 4 grid layout.
+ GridLayout grid = new GridLayout(4, 4);
+ // Fill out the first row using the cursor.
+ grid.addComponent(rc1 = new Button("R/C 1"));
+
+ grid.addComponent(col1 = new Button("Col " + (grid.getCursorX() + 1)));
+ grid.addComponent(col2 = new Button("Col " + (grid.getCursorX() + 1)));
+ grid.addComponent(col3 = new Button("Col " + (grid.getCursorX() + 1)));
+
+ // Fill out the first column using coordinates.
+
+ grid.addComponent(row1 = new Button("Row " + 1), 0, 1);
+ grid.addComponent(row2 = new Button("Row " + 2), 0, 2);
+ grid.addComponent(row3 = new Button("Row " + 3), 0, 3);
+
+ // Add some components of various shapes.
+ grid.addComponent(x3 = new Button("3x1 button"), 1, 1, 3, 1);
+ grid.addComponent(new Label("1x2 cell"), 1, 2, 1, 3);
+ x22 = new InlineDateField("A 2x2 date field");
+ ((InlineDateField) x22).setResolution(DateField.RESOLUTION_DAY);
+ ((InlineDateField) x22).setValue(new Date(128028960000l));
+ grid.addComponent(x22, 2, 2, 3, 3);
+ grid.setWidth("450px");
+ grid.setHeight("450px");
+ return grid;
+ }
+
+ private VerticalLayout getBaseLayout() {
+ VerticalLayout vlo = new VerticalLayout();
+ vlo.setSizeUndefined();
+ return vlo;
+ }
+
+ private AbstractComponent getTestTabsheet() {
+ TabSheet tabsheet = new TabSheet();
+ tabsheet.setSizeUndefined();
+ tabsheet.addTab(new UndefWideLabel("TAB1"), "TAB1", new ThemeResource(
+ GLOBE_16_PNG));
+ tabsheet.addTab(new UndefWideLabel("TAB2"), "TAB2", null);
+ return tabsheet;
+ }
+
+ private Table getTestTable() {
+ Table t = new Table();
+ t.setSizeUndefined();
+ t.setPageLength(5);
+ t.addContainerProperty("test", String.class, null);
+ t.addItem(new Object[] { "qwertyuiop asdfghjklzxccvbnm,m,." }, 1);
+ t.addItem(new Object[] { "YGVYTCTCTRXRXRXRX" }, 2);
+ return t;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
new file mode 100644
index 0000000000..0042f0ba11
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
@@ -0,0 +1,578 @@
+package com.vaadin.tests.layouts.layouttester;
+
+import com.vaadin.Application;
+import com.vaadin.server.Resource;
+import com.vaadin.server.SystemError;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
+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.DateField;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+public class HorizontalLayoutTests extends AbstractLayoutTests {
+
+ public HorizontalLayoutTests(Application application) {
+ super();
+ }
+
+ @Override
+ protected Layout getAlignmentTests() {
+ Layout baseLayout = getBaseLayout();
+ HorizontalLayout vlo = getTestLaytout();
+ AbstractComponent[] components = new AbstractComponent[9];
+ String[] styles = { Reindeer.LAYOUT_BLUE, Reindeer.LAYOUT_WHITE };
+ Alignment[] alignments = new Alignment[] { Alignment.BOTTOM_LEFT,
+ Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT,
+ Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER,
+ Alignment.MIDDLE_RIGHT, Alignment.TOP_LEFT,
+ Alignment.TOP_CENTER, Alignment.TOP_RIGHT };
+
+ vlo.addStyleName(Reindeer.LAYOUT_WHITE);
+ baseLayout.addComponent(vlo);
+ int index = 0;
+ for (int i = 0; i < components.length; i++) {
+ if (i > 0 && i % 3 == 0) {
+ vlo = getTestLaytout();
+ vlo.addStyleName(styles[index++]);
+ baseLayout.addComponent(vlo);
+ }
+ components[i] = new TextField();
+ ((TextField) components[i]).setValue("FIELD " + i);
+ vlo.addComponent(components[i]);
+ vlo.setComponentAlignment(components[i], alignments[i]);
+ }
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getCaptionsTests() {
+ Layout baseLayout = getBaseLayout();
+ AbstractComponent component = null;
+
+ String[] captions = new String[] {
+ "",
+ "abcdefghijklmnopq",
+ "abc def hij klm nop qrs tuv xyz qaz wsx edc rfv tgb yhn ujm mko nji bhu vgy cft cde" };
+
+ HorizontalLayout vlo = getTestLaytout();
+ for (int i = 0; i < captions.length; i++) {
+ component = new TextField();
+ ((TextField) component).setValue("FIELD " + i);
+ component.setCaption(captions[i]);
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < captions.length; i++) {
+ component = new Label();
+ ((Label) component).setValue("Label " + i);
+ component.setCaption(captions[i]);
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < captions.length; i++) {
+ component = new Select();
+ component.setCaption(captions[i]);
+ component.setIcon(new ThemeResource(LOCK_16_PNG));
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < captions.length; i++) {
+ component = getTestTabsheet();
+ component.setCaption(captions[i]);
+ component.setComponentError(new UserError(
+ "component error, user error"));
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getComponentAddReplaceMoveTests() {
+ final HorizontalLayout vlo = getTestLaytout();
+ Layout baseLayout = getBaseLayout();
+ final HorizontalLayout source = new HorizontalLayout();
+ source.addComponent(new Label("OTHER LABEL 1"));
+ source.addComponent(new Label("OTHER LABEL 2"));
+
+ final AbstractComponent c1 = new Button("BUTTON");
+ final AbstractComponent c2 = new Label("<b>LABEL</b>",
+ ContentMode.XHTML);
+ final AbstractComponent c3 = new Table("TABLE");
+ c3.setHeight("100px");
+ c3.setWidth("100%");
+
+ final Button addButton = new Button("Test add");
+ final Button replaceButton = new Button("Test replace");
+ final Button moveButton = new Button("Test move");
+ final Button removeButton = new Button("Test remove");
+
+ replaceButton.setEnabled(false);
+ moveButton.setEnabled(false);
+ removeButton.setEnabled(false);
+
+ addButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.addComponent(new TextField());
+ addButton.setEnabled(false);
+ replaceButton.setEnabled(true);
+ }
+ });
+ replaceButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.replaceComponent(c1, c3);
+ replaceButton.setEnabled(false);
+ moveButton.setEnabled(true);
+ }
+ });
+ moveButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.moveComponentsFrom(source);
+ moveButton.setEnabled(false);
+ removeButton.setEnabled(true);
+ }
+ });
+ removeButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.removeComponent(c1);
+ vlo.removeComponent(c2);
+ removeButton.setEnabled(false);
+ }
+ });
+
+ baseLayout.addComponent(addButton);
+ baseLayout.addComponent(replaceButton);
+ baseLayout.addComponent(moveButton);
+ baseLayout.addComponent(removeButton);
+
+ vlo.addComponent(c1);
+ vlo.addComponent(c2);
+ vlo.addComponent(c3);
+ baseLayout.addComponent(vlo);
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getComponentSizingTests() {
+ final HorizontalLayout vlo = getTestLaytout();
+ Layout baseLayout = getBaseLayout();
+
+ final AbstractComponent c = getTestTable();
+
+ final Button biggerButton = new Button("full size");
+ final Button smallerButton = new Button("200 px width");
+ final Button originalButton = new Button("undefined size+add");
+
+ baseLayout.addComponent(biggerButton);
+ baseLayout.addComponent(smallerButton);
+ baseLayout.addComponent(originalButton);
+ vlo.addComponent(c);
+ baseLayout.addComponent(vlo);
+
+ biggerButton.setEnabled(true);
+ smallerButton.setEnabled(false);
+ originalButton.setEnabled(false);
+
+ biggerButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setSizeFull();
+ biggerButton.setEnabled(false);
+ smallerButton.setEnabled(true);
+ }
+ });
+ smallerButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setWidth("200px");
+ smallerButton.setEnabled(false);
+ originalButton.setEnabled(true);
+ }
+ });
+ originalButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ originalButton.setEnabled(false);
+ c.setSizeUndefined();
+ ((Table) c)
+ .addItem(
+ new Object[] { "VYVTCTC VYVYV ECECCE NIDSD SDMPOM" },
+ 3);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getLayoutSizingTests() {
+ final HorizontalLayout vlo = getTestLaytout();
+ vlo.setSpacing(false);
+ vlo.setMargin(false);
+ Layout baseLayout = getBaseLayout();
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Set fixed height 350px");
+ final Button button2 = new Button(
+ "Set undefined size and add component");
+ final Button button3 = new Button("Set fixed width and height 75%");
+ final Button button4 = new Button("Set size full");
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ vlo.addComponent(c1);
+ vlo.addComponent(c2);
+ vlo.setExpandRatio(c1, 0.5f);
+ vlo.setExpandRatio(c2, 0.5f);
+
+ baseLayout.addComponent(vlo);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setHeight("350px");
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setSizeUndefined();
+ vlo.addComponent(new Label("--- NEW LABEL ---"));
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setWidth("75%");
+ vlo.setHeight("75%");
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setSizeFull();
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getExpandRatiosTests() {
+ final HorizontalLayout vlo = getTestLaytout();
+ Layout baseLayout = getBaseLayout();
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Expand to 1/undefined");
+ final Button button2 = new Button("Expand to 0.5/0.5");
+ final Button button3 = new Button("Expand to 0.75/0.25");
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+
+ vlo.addComponent(c1);
+ vlo.addComponent(c2);
+ baseLayout.addComponent(vlo);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setExpandRatio(c1, 1.0f);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setExpandRatio(c1, 0.5f);
+ vlo.setExpandRatio(c2, 0.5f);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setExpandRatio(c1, 0.75f);
+ vlo.setExpandRatio(c2, 0.25f);
+ button3.setEnabled(false);
+ }
+ });
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getIconsTests() {
+ HorizontalLayout vlo = getTestLaytout();
+ AbstractComponent[] components = new AbstractComponent[2];
+ Layout baseLayout = getBaseLayout();
+ Resource[] icons = new Resource[] { new ThemeResource(CALENDAR_32_PNG),
+ new ThemeResource(LOCK_16_PNG) };
+
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new TextField();
+ ((TextField) components[i]).setValue("FIELD " + i);
+ components[i].setIcon(icons[i]);
+ components[i]
+ .setCaption("long test caption bewucbwuebco or bmort b cbwecubw wbeucwe asdasd asdasda asdasd");
+ vlo.addComponent(components[i]);
+ }
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Label();
+ ((Label) components[i]).setValue("Label " + i);
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Select();
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Button();
+ components[i].setComponentError(new UserError(
+ "component error, user error"));
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Link("Link", null);
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getMarginSpacingTests() {
+ final HorizontalLayout vlo = getTestLaytout();
+ vlo.setSpacing(false);
+ vlo.setMargin(false);
+ Layout baseLayout = getBaseLayout();
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Set margin on");
+ final Button button2 = new Button("Set spacing on");
+ final Button button3 = new Button("Set margin off");
+ final Button button4 = new Button("Set spacing off");
+
+ baseLayout.addComponent(button1);
+ baseLayout.addComponent(button2);
+ baseLayout.addComponent(button3);
+ baseLayout.addComponent(button4);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ vlo.addComponent(c1);
+ vlo.addComponent(c2);
+ vlo.setExpandRatio(c1, 0.5f);
+ vlo.setExpandRatio(c2, 0.5f);
+ baseLayout.addComponent(vlo);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setMargin(true);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setSpacing(true);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setMargin(false);
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo.setSpacing(false);
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getRequiredErrorIndicatorsTests() {
+ HorizontalLayout vlo = getTestLaytout();
+ Layout baseLayout = getBaseLayout();
+ AbstractComponent[] components = new AbstractComponent[4];
+ components[0] = new Label("LABEL");
+ components[0].setSizeUndefined();
+ components[1] = new Button("BUTTON");
+ components[2] = getTestTable();
+ components[3] = getTestTabsheet();
+ components[3].setIcon(new ThemeResource(LOCK_16_PNG));
+
+ AbstractField<?>[] fields = new AbstractField<?>[5];
+ fields[0] = new TextField();
+ fields[0].setRequired(true);
+ fields[0].setValidationVisible(true);
+ fields[0].setRequiredError("required error");
+
+ fields[1] = new TextField();
+ fields[1].setValue("TEXTFIELD2");
+ fields[1]
+ .setComponentError(new UserError("component error, user error"));
+
+ fields[2] = new Select();
+ fields[2].setComponentError(new SystemError(
+ "component error, system error"));
+ fields[3] = new DateField();
+ fields[3].setComponentError(new SystemError(
+ "component error, system error"));
+
+ fields[4] = new CheckBox();
+ fields[4]
+ .setComponentError(new UserError("component error, user error"));
+
+ for (int i = 0; i < components.length; i++) {
+ components[i].setComponentError(new UserError(
+ "component error, user error"));
+ vlo.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < fields.length; i++) {
+ vlo.addComponent(fields[i]);
+ }
+ baseLayout.addComponent(vlo);
+ return baseLayout;
+ }
+
+ private VerticalLayout getBaseLayout() {
+ VerticalLayout vlo = new VerticalLayout();
+ vlo.setSizeUndefined();
+ return vlo;
+ }
+
+ private HorizontalLayout getTestLaytout() {
+ HorizontalLayout vlo = new HorizontalLayout();
+ vlo.setHeight("100px");
+ vlo.setWidth("750px");
+ return vlo;
+ }
+
+ private AbstractComponent getTestTabsheet() {
+ TabSheet tabsheet = new TabSheet();
+ tabsheet.setSizeUndefined();
+ tabsheet.addTab(new UndefWideLabel("TAB1"), "TAB1", new ThemeResource(
+ GLOBE_16_PNG));
+ tabsheet.addTab(new UndefWideLabel("TAB2"), "TAB2", null);
+ return tabsheet;
+ }
+
+ private Table getTestTable() {
+ Table t = new Table();
+ t.setSizeUndefined();
+ t.setPageLength(5);
+ t.addContainerProperty("test", String.class, null);
+ t.addItem(new Object[] { "qwertyuiop asdfghjkl zxccvbnm,m,." }, 1);
+ t.addItem(new Object[] { "YGVYTCTCTRXRXRXRX" }, 2);
+ return t;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
new file mode 100644
index 0000000000..8408aba9fd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
@@ -0,0 +1,896 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>LayoutTesterApplication</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">LayoutTesterApplication</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.layouts.layouttester.LayoutTesterApplication?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>1</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>2</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>3</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>4</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>5</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>6</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>7</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>8</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>9</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>10</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>11</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>12</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>13</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>14</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>15</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>16</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>17</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>18</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>19</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>20</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>21</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>22</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>23</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>24</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>25</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>26</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>27</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>28</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td>
+ <td>label=class com.vaadin.ui.HorizontalLayout</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>29</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>30</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>31</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>32</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>33</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>34</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>35</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>36</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>37</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>38</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>39</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>40</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>41</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>42</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>43</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>44</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>45</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>46</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>47</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>48</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>49</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>50</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>51</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>52</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>53</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>54</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>55</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>56</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td>
+ <td>label=class com.vaadin.ui.GridLayout</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>57</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>58</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>59</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>60</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>61</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>62</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>63</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>64</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>65</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>66</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>67</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>68</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>69</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>70</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>71</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>72</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>73</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>74</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>75</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>76</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>77</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>78</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>79</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>80</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>81</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>82</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>83</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>84</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>85</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>86</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>87</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>88</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
new file mode 100644
index 0000000000..e31ecc2498
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
@@ -0,0 +1,130 @@
+package com.vaadin.tests.layouts.layouttester;
+
+import java.lang.reflect.Method;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+@SuppressWarnings("serial")
+public class LayoutTesterApplication extends AbstractTestCase {
+ Button nextButton = new Button("Next");
+ private int layoutIndex = -1;
+ private int layoutCount = 1;
+
+ private Method[] layoutGetters;
+ private LegacyWindow mainWindow;
+ private NativeSelect layoutSelector;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow("LayoutTesterApplication");
+ setMainWindow(mainWindow);
+ loadLayoutGetters();
+ nextLaytout();
+
+ nextButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = -1577298910202253538L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ nextLaytout();
+ }
+ });
+ }
+
+ private void nextLaytout() {
+ try {
+ mainWindow.removeAllComponents();
+ HorizontalLayout vlo = new HorizontalLayout();
+ vlo.setSpacing(true);
+ ++layoutIndex;
+ if (layoutIndex >= layoutCount) {
+ layoutIndex = 0;
+ }
+ mainWindow.addComponent(vlo);
+ vlo.addComponent(nextButton);
+ vlo.addComponent(getLayoutTypeSelect());
+ vlo.addComponent(new UndefWideLabel(layoutGetters[layoutIndex]
+ .getName()));
+
+ Layout lo = null;
+ if (layoutSelector.getValue() == VerticalLayout.class) {
+ lo = getVerticalTestLayout(layoutIndex);
+ } else if (layoutSelector.getValue() == HorizontalLayout.class) {
+ lo = getHorizontalTestLayout(layoutIndex);
+ } else if (layoutSelector.getValue() == GridLayout.class) {
+ lo = getGridTestLayout(layoutIndex);
+ }
+ if (lo != null) {
+ lo.addStyleName(Reindeer.LAYOUT_BLUE);
+ mainWindow.addComponent(lo);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void loadLayoutGetters() {
+ layoutGetters = AbstractLayoutTests.class.getDeclaredMethods();
+ layoutCount = layoutGetters.length;
+ }
+
+ public Layout getVerticalTestLayout(int index) throws Exception {
+ VerticalLayoutTests vlotest = new VerticalLayoutTests(this);
+ return (Layout) layoutGetters[index].invoke(vlotest, (Object[]) null);
+ }
+
+ public Layout getHorizontalTestLayout(int index) throws Exception {
+ HorizontalLayoutTests hlotest = new HorizontalLayoutTests(this);
+ return (Layout) layoutGetters[index].invoke(hlotest, (Object[]) null);
+ }
+
+ public Layout getGridTestLayout(int index) throws Exception {
+ GridLayoutTests hlotest = new GridLayoutTests(this);
+ return (Layout) layoutGetters[index].invoke(hlotest, (Object[]) null);
+ }
+
+ private NativeSelect getLayoutTypeSelect() {
+ if (layoutSelector == null) {
+ layoutSelector = new NativeSelect();
+ layoutSelector.addItem(VerticalLayout.class);
+ layoutSelector.addItem(HorizontalLayout.class);
+ layoutSelector.addItem(GridLayout.class);
+ layoutSelector.setNullSelectionAllowed(false);
+ layoutSelector.setImmediate(true);
+ layoutSelector.select(VerticalLayout.class);
+ layoutSelector.addListener(new Property.ValueChangeListener() {
+ private static final long serialVersionUID = -605319614765838359L;
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ layoutIndex = -1;
+ nextLaytout();
+ }
+ });
+ }
+ return layoutSelector;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Test application for VerticalLayout, HorizontalLayout, and GridLayout";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5334;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java b/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java
new file mode 100644
index 0000000000..c998ce458a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/UndefWideLabel.java
@@ -0,0 +1,12 @@
+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/VerticalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
new file mode 100644
index 0000000000..3e668289fe
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
@@ -0,0 +1,615 @@
+package com.vaadin.tests.layouts.layouttester;
+
+import com.vaadin.Application;
+import com.vaadin.server.Resource;
+import com.vaadin.server.SystemError;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
+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.DateField;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class VerticalLayoutTests extends AbstractLayoutTests {
+
+ public VerticalLayoutTests(Application application) {
+ super();
+ }
+
+ @Override
+ protected Layout getAlignmentTests() {
+ Layout baseLayout = getBaseLayout();
+ ((HorizontalLayout) baseLayout).setSpacing(true);
+ VerticalLayout vlo = getTestLaytout();
+ AbstractComponent[] components = new AbstractComponent[9];
+ Alignment[] alignments = new Alignment[] { Alignment.BOTTOM_CENTER,
+ Alignment.BOTTOM_LEFT, Alignment.BOTTOM_RIGHT,
+ Alignment.MIDDLE_CENTER, Alignment.MIDDLE_LEFT,
+ Alignment.MIDDLE_RIGHT, Alignment.TOP_CENTER,
+ Alignment.TOP_LEFT, Alignment.TOP_RIGHT };
+
+ for (int i = 0; i < components.length / 2; i++) {
+ components[i] = new TextField();
+ ((TextField) components[i]).setValue("FIELD " + i);
+ vlo.addComponent(components[i]);
+ vlo.setComponentAlignment(components[i], alignments[i]);
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = components.length / 2; i < components.length; i++) {
+ components[i] = new TextField();
+ ((TextField) components[i]).setValue("FIELD " + i);
+ vlo.addComponent(components[i]);
+ vlo.setComponentAlignment(components[i], alignments[i]);
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
+ }
+ baseLayout.addComponent(vlo);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getCaptionsTests() {
+ Layout baseLayout = getBaseLayout();
+ VerticalLayout vlo = getTestLaytout();
+ AbstractComponent component = null;
+
+ String[] captions = new String[] {
+ "",
+ "abcdefghijklmnopq",
+ "abc def hij klm nop qrs tuv xyz qaz wsx edc rfv tgb yhn ujm mko nji bhu vgy cft cde" };
+
+ for (int i = 0; i < captions.length; i++) {
+ component = new TextField();
+ ((TextField) component).setValue("FIELD " + i);
+ component.setCaption(captions[i]);
+ vlo.addComponent(component);
+ }
+ for (int i = 0; i < captions.length; i++) {
+ component = new Label();
+ ((Label) component).setValue("Label " + i);
+ component.setCaption(captions[i]);
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ vlo = getTestLaytout();
+ for (int i = 0; i < captions.length; i++) {
+ component = new Select();
+ component.setCaption(captions[i]);
+ component.setIcon(new ThemeResource(LOCK_16_PNG));
+ vlo.addComponent(component);
+ }
+ for (int i = 0; i < captions.length; i++) {
+ component = getTestTabsheet();
+ component.setCaption(captions[i]);
+ component.setComponentError(new UserError(
+ "component error, user error"));
+ vlo.addComponent(component);
+ }
+ baseLayout.addComponent(vlo);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getComponentAddReplaceMoveTests() {
+ Layout baseLayout = getBaseLayout();
+ final VerticalLayout vlo = getTestLaytout();
+ final VerticalLayout vlo2 = getTestLaytout();
+
+ final HorizontalLayout source = new HorizontalLayout();
+ source.addComponent(new Label("OTHER LABEL 1"));
+ source.addComponent(new Label("OTHER LABEL 2"));
+
+ final AbstractComponent c1 = new Button("BUTTON");
+ final AbstractComponent c2 = new Label("<b>LABEL</b>",
+ ContentMode.XHTML);
+ final AbstractComponent c3 = new Table("TABLE");
+ c3.setHeight("100px");
+ c3.setWidth("100%");
+
+ final Button addButton = new Button("Test add");
+ final Button replaceButton = new Button("Test replace");
+ final Button moveButton = new Button("Test move");
+ final Button removeButton = new Button("Test remove");
+
+ replaceButton.setEnabled(false);
+ moveButton.setEnabled(false);
+ removeButton.setEnabled(false);
+
+ addButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.addComponent(new TextField());
+ addButton.setEnabled(false);
+ replaceButton.setEnabled(true);
+ }
+ });
+ replaceButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.replaceComponent(c1, c3);
+ replaceButton.setEnabled(false);
+ moveButton.setEnabled(true);
+ }
+ });
+ moveButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.moveComponentsFrom(source);
+ moveButton.setEnabled(false);
+ removeButton.setEnabled(true);
+ }
+ });
+ removeButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.removeComponent(c1);
+ vlo2.removeComponent(c2);
+ removeButton.setEnabled(false);
+ }
+ });
+
+ vlo.addComponent(addButton);
+ vlo.addComponent(replaceButton);
+ vlo.addComponent(moveButton);
+ vlo.addComponent(removeButton);
+
+ baseLayout.addComponent(vlo);
+ vlo2.addComponent(c1);
+ vlo2.addComponent(c2);
+ vlo2.addComponent(c3);
+ baseLayout.addComponent(vlo2);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getComponentSizingTests() {
+ Layout baseLayout = getBaseLayout();
+ final VerticalLayout vlo = getTestLaytout();
+
+ final AbstractComponent c = getTestTable();
+
+ final Button biggerButton = new Button("full size");
+ final Button smallerButton = new Button("200 px width");
+ final Button originalButton = new Button("undefined size and add");
+
+ vlo.addComponent(biggerButton);
+ vlo.addComponent(smallerButton);
+ vlo.addComponent(originalButton);
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+ vlo2.addComponent(c);
+ baseLayout.addComponent(vlo2);
+
+ biggerButton.setEnabled(true);
+ smallerButton.setEnabled(false);
+ originalButton.setEnabled(false);
+
+ biggerButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setSizeFull();
+ biggerButton.setEnabled(false);
+ smallerButton.setEnabled(true);
+ }
+ });
+ smallerButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setWidth("200px");
+ smallerButton.setEnabled(false);
+ originalButton.setEnabled(true);
+ }
+ });
+ originalButton.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ originalButton.setEnabled(false);
+ c.setSizeUndefined();
+ ((Table) c)
+ .addItem(
+ new Object[] { "VYVTCTC VYVYV ECECCE NIDSD SDMPOM" },
+ 3);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getLayoutSizingTests() {
+ Layout baseLayout = getBaseLayout();
+ final VerticalLayout vlo = getTestLaytout();
+
+ vlo.setSpacing(false);
+ vlo.setMargin(false);
+
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Set fixed height 350px");
+ final Button button2 = new Button(
+ "Set undefined size and add component");
+ final Button button3 = new Button("Set fixed width and height 75%");
+ final Button button4 = new Button("Set size full");
+
+ vlo.addComponent(button1);
+ vlo.addComponent(button2);
+ vlo.addComponent(button3);
+ vlo.addComponent(button4);
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ vlo2.addComponent(c1);
+ vlo2.addComponent(new Label(
+ "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>",
+ ContentMode.XHTML));
+ vlo2.addComponent(c2);
+ vlo2.setExpandRatio(c1, 0.5f);
+ vlo2.setExpandRatio(c2, 0.5f);
+ baseLayout.addComponent(vlo2);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setHeight("350px");
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setSizeUndefined();
+ Label newLabel = new Label("--- NEW LABEL ---");
+ newLabel.setSizeUndefined();
+ vlo2.addComponent(newLabel);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setWidth("75%");
+ vlo2.setHeight("75%");
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setSizeFull();
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getExpandRatiosTests() {
+ Layout baseLayout = getBaseLayout();
+ final VerticalLayout vlo = getTestLaytout();
+
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Expand to 1/undefined");
+ final Button button2 = new Button("Expand to 0.5/0.5");
+ final Button button3 = new Button("Expand to 0.75/0.25");
+
+ vlo.addComponent(button1);
+ vlo.addComponent(button2);
+ vlo.addComponent(button3);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+
+ vlo2.addComponent(c1);
+ vlo2.addComponent(c2);
+ baseLayout.addComponent(vlo2);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setExpandRatio(c1, 1.0f);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setExpandRatio(c1, 0.5f);
+ vlo2.setExpandRatio(c2, 0.5f);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setExpandRatio(c1, 0.75f);
+ vlo2.setExpandRatio(c2, 0.25f);
+ button3.setEnabled(false);
+ }
+ });
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getIconsTests() {
+ Layout baseLayout = getBaseLayout();
+ VerticalLayout vlo = getTestLaytout();
+ AbstractComponent[] components = new AbstractComponent[2];
+
+ Resource[] icons = new Resource[] { new ThemeResource(CALENDAR_32_PNG),
+ new ThemeResource(LOCK_16_PNG) };
+
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new TextField();
+ ((TextField) components[i]).setValue("FIELD " + i);
+ components[i].setIcon(icons[i]);
+ components[i]
+ .setCaption("long test caption bewucbwuebco or bmort b cbwecubw wbeucwe asdasd asdasda asdasd");
+ vlo.addComponent(components[i]);
+ }
+
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Label();
+ ((Label) components[i]).setValue("Label " + i);
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Select();
+ components[i].setIcon(icons[i]);
+ vlo.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Button();
+ components[i].setComponentError(new UserError(
+ "component error, user error"));
+ components[i].setIcon(icons[i]);
+ vlo2.addComponent(components[i]);
+ }
+
+ for (int i = 0; i < components.length; i++) {
+ components[i] = new Link("Link", null);
+ components[i].setIcon(icons[i]);
+ vlo2.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo2);
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getMarginSpacingTests() {
+ Layout baseLayout = getBaseLayout();
+ final VerticalLayout vlo = getTestLaytout();
+ vlo.setSpacing(false);
+ vlo.setMargin(false);
+
+ final AbstractComponent c1 = getTestTable();
+ c1.setSizeFull();
+ final AbstractComponent c2 = getTestTable();
+ c2.setSizeFull();
+
+ final Button button1 = new Button("Set margin on");
+ final Button button2 = new Button("Set spacing on");
+ final Button button3 = new Button("Set margin off");
+ final Button button4 = new Button("Set spacing off");
+
+ vlo.addComponent(button1);
+ vlo.addComponent(button2);
+ vlo.addComponent(button3);
+ vlo.addComponent(button4);
+ button1.setEnabled(true);
+ button2.setEnabled(false);
+ button3.setEnabled(false);
+ button4.setEnabled(false);
+
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+
+ vlo2.addComponent(c1);
+ // Must add something around the hr to avoid the margins collapsing
+ vlo2.addComponent(new Label(
+ "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>",
+ ContentMode.XHTML));
+ vlo2.addComponent(c2);
+ vlo2.setExpandRatio(c1, 0.5f);
+ vlo2.setExpandRatio(c2, 0.5f);
+ baseLayout.addComponent(vlo2);
+
+ button1.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setMargin(true);
+ button1.setEnabled(false);
+ button2.setEnabled(true);
+ }
+ });
+ button2.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setSpacing(true);
+ button2.setEnabled(false);
+ button3.setEnabled(true);
+ }
+ });
+ button3.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setMargin(false);
+ button3.setEnabled(false);
+ button4.setEnabled(true);
+ }
+ });
+ button4.addListener(new Button.ClickListener() {
+ private static final long serialVersionUID = 7716267156088629379L;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ vlo2.setSpacing(false);
+ button4.setEnabled(false);
+ }
+ });
+
+ return baseLayout;
+ }
+
+ @Override
+ protected Layout getRequiredErrorIndicatorsTests() {
+ Layout baseLayout = getBaseLayout();
+ VerticalLayout vlo = getTestLaytout();
+ AbstractComponent[] components = new AbstractComponent[4];
+ components[0] = new Label("LABEL");
+ components[0].setSizeUndefined();
+ components[1] = new Button("BUTTON");
+ components[2] = getTestTable();
+ components[3] = getTestTabsheet();
+ components[3].setIcon(new ThemeResource(LOCK_16_PNG));
+
+ AbstractField<?>[] fields = new AbstractField<?>[6];
+ fields[0] = new TextField();
+ fields[0].setRequired(true);
+ fields[0].setValidationVisible(true);
+ fields[0].setRequiredError("required error");
+
+ fields[1] = new TextField();
+ fields[1].setValue("TEXTFIELD2");
+ fields[1]
+ .setComponentError(new UserError("component error, user error"));
+
+ fields[2] = new Select();
+ fields[2].setComponentError(new SystemError(
+ "component error, system error"));
+ fields[3] = new DateField();
+ fields[3].setComponentError(new SystemError(
+ "component error, system error"));
+
+ fields[4] = new CheckBox();
+ fields[4]
+ .setComponentError(new UserError("component error, user error"));
+
+ fields[5] = new NativeSelect();
+ fields[5].setRequired(true);
+ fields[5].setValidationVisible(true);
+ fields[5].setRequiredError("required error");
+ fields[5]
+ .setComponentError(new UserError("component error, user error"));
+ fields[5].setIcon(new ThemeResource(CALENDAR_32_PNG));
+
+ for (int i = 0; i < components.length; i++) {
+ components[i].setComponentError(new UserError(
+ "component error, user error"));
+ vlo.addComponent(components[i]);
+ }
+ baseLayout.addComponent(vlo);
+ final VerticalLayout vlo2 = getTestLaytout();
+ for (int i = 0; i < fields.length; i++) {
+ vlo2.addComponent(fields[i]);
+ }
+
+ baseLayout.addComponent(vlo2);
+ return baseLayout;
+ }
+
+ private HorizontalLayout getBaseLayout() {
+ HorizontalLayout hlo = new HorizontalLayout();
+ hlo.setSizeUndefined();
+ return hlo;
+ }
+
+ private VerticalLayout getTestLaytout() {
+ VerticalLayout vlo = new VerticalLayout();
+ vlo.setHeight("500px");
+ vlo.setWidth("400px");
+ return vlo;
+ }
+
+ private AbstractComponent getTestTabsheet() {
+ TabSheet tabsheet = new TabSheet();
+ tabsheet.setSizeUndefined();
+ tabsheet.addTab(new UndefWideLabel("TAB1"), "TAB1", new ThemeResource(
+ GLOBE_16_PNG));
+ tabsheet.addTab(new UndefWideLabel("TAB2"), "TAB2", null);
+ return tabsheet;
+ }
+
+ private Table getTestTable() {
+ Table t = new Table();
+ t.setSizeUndefined();
+ 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;
+ }
+}