diff options
5 files changed, 26 insertions, 14 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java index 3f5a5ae46d..f0e5606995 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDetailsLayoutExpand.java @@ -70,10 +70,12 @@ public class GridDetailsLayoutExpand extends AbstractTestUI { // 2 Labels added to the layout2 final Label lbl2 = new Label("test2"); + lbl2.setWidth("100%"); lbl2.setId("lbl2"); layout2.addComponent(lbl2); final Label lbl3 = new Label("test3"); + lbl3.setWidth("100%"); lbl3.setId("lbl3"); layout2.addComponent(lbl3); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java index 3124806a2e..4326866e02 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java @@ -16,12 +16,12 @@ package com.vaadin.tests.layouts.layouttester; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.AbstractLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.v7.ui.Table; /** @@ -54,9 +54,11 @@ public class BaseLayoutForSpacingMargin extends BaseLayoutTestUI { l2.setMargin(false); l2.setSpacing(false); // Must add something around the hr to avoid the margins collapsing - l2.addComponent(new Label( + Label spacer = new Label( "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); + ContentMode.HTML); + spacer.setWidth("100%"); + l2.addComponent(spacer); l2.addComponent(t2); final Button btn1 = new Button("Toggle margin on/off"); btn1.addClickListener(new ClickListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java index e10c3974f8..67a38cf7a2 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java @@ -19,6 +19,7 @@ import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractLayout; @@ -32,7 +33,6 @@ import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; -import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.v7.ui.Table; import com.vaadin.v7.ui.TextField; @@ -141,14 +141,17 @@ public abstract class BaseLayoutTestUI extends AbstractTestUI { Button btn3 = new SetSizeButton("75%"); Button btn4 = new SetSizeButton("100%"); + Label spacer = new Label( + "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", + ContentMode.HTML); + spacer.setWidth("100%"); + l1.addComponent(btn1); l1.addComponent(btn2); l1.addComponent(btn3); l1.addComponent(btn4); l2.addComponent(c1); - l2.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); + l2.addComponent(spacer); l2.addComponent(c2); l2.setExpandRatio(c1, 0.5f); l2.setExpandRatio(c2, 0.5f); diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java index b6e88ea18e..7c826eeab9 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java @@ -16,12 +16,12 @@ package com.vaadin.tests.layouts.layouttester.GridLayout; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.layouts.layouttester.BaseLayoutTestUI; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; @@ -86,14 +86,17 @@ public abstract class GridBaseLayoutTestUI extends BaseLayoutTestUI { Button btn3 = new SetSizeButton("75%"); Button btn4 = new SetSizeButton("100%"); + Label spacer = new Label( + "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", + ContentMode.HTML); + spacer.setWidth("100%"); + layout.addComponent(btn1); layout.addComponent(btn2); layout.addComponent(btn3); layout.addComponent(btn4); layout.addComponent(c1); - layout.addComponent(new Label( - "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); + layout.addComponent(spacer); layout.addComponent(c2); btn2.addClickListener(new ClickListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java index 3a56e23978..af719b56f7 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java @@ -16,11 +16,11 @@ package com.vaadin.tests.layouts.layouttester.GridLayout; import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Label; -import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.v7.ui.Table; /** @@ -66,9 +66,11 @@ public class GridLayoutMarginSpacing extends GridBaseLayoutTestUI { layout.setMargin(false); layout.setSpacing(false); // Must add something around the hr to avoid the margins collapsing - layout.addComponent(new Label( + Label spacer = new Label( "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>", - ContentMode.HTML)); + ContentMode.HTML); + spacer.setWidth("100%"); + layout.addComponent(spacer); layout.addComponent(t2); } } |