From f9bb88a3cd7c424126d96ba24e315569aec8bce9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 4 Jan 2013 15:34:01 +0200 Subject: [PATCH] Fix some small issues in LayoutTesterApplication Change-Id: I996c62309072102a284622fcda6090b447282bdf --- .../vaadin/tests/layouts/layouttester/GridLayoutTests.java | 7 +++++++ .../tests/layouts/layouttester/HorizontalLayoutTests.java | 4 +++- .../tests/layouts/layouttester/VerticalLayoutTests.java | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java index 28f6dfdbc4..76fa8c6cc9 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java @@ -9,6 +9,7 @@ import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractField; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -402,6 +403,9 @@ public class GridLayoutTests extends AbstractLayoutTests { baseLayout.addComponent(button3); baseLayout.addComponent(button4); baseLayout.addComponent(glo); + // Don't expand the buttons + ((AbstractOrderedLayout) baseLayout).setExpandRatio(glo, 1); + button1.setEnabled(true); button2.setEnabled(false); button3.setEnabled(false); @@ -474,6 +478,9 @@ public class GridLayoutTests extends AbstractLayoutTests { baseLayout.addComponent(glo); + // Don't expand the buttons + ((AbstractOrderedLayout) baseLayout).setExpandRatio(glo, 1); + button1.addListener(new Button.ClickListener() { private static final long serialVersionUID = 7716267156088629379L; diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java index 113106a40b..7a53a6583e 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java @@ -289,7 +289,9 @@ public class HorizontalLayoutTests extends AbstractLayoutTests { @Override public void buttonClick(ClickEvent event) { vlo.setSizeUndefined(); - vlo.addComponent(new Label("--- NEW LABEL ---")); + Label label = new Label("--- NEW LABEL ---"); + label.setWidth(null); + vlo.addComponent(label); button2.setEnabled(false); button3.setEnabled(true); } diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java index 654a282bb4..7764589ff7 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java @@ -110,6 +110,9 @@ public class VerticalLayoutTests extends AbstractLayoutTests { final VerticalLayout vlo = getTestLaytout(); final VerticalLayout vlo2 = getTestLaytout(); + // Set undefined height to avoid expanding + vlo2.setHeight(null); + final HorizontalLayout source = new HorizontalLayout(); source.addComponent(new Label("OTHER LABEL 1")); source.addComponent(new Label("OTHER LABEL 2")); -- 2.39.5