From 223902154b9db14ce533f8f914eb186d4d5f44a7 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 16 Mar 2010 09:08:21 +0000 Subject: [PATCH] added test case svn changeset:11904/svn branch:6.3 --- .../CssLayoutSizeChangePropagation.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java diff --git a/tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java b/tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java new file mode 100644 index 0000000000..a464e9b5c9 --- /dev/null +++ b/tests/src/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java @@ -0,0 +1,61 @@ +package com.vaadin.tests.layouts; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; + +public class CssLayoutSizeChangePropagation extends TestBase { + + @Override + protected void setup() { + getLayout().setSizeFull(); + final VerticalLayout sp = new VerticalLayout(); + + sp.setHeight("100%"); + + final CssLayout cssLayout = new CssLayout() { + @Override + protected String getCss(Component c) { + return "background-color: yellow;"; + } + }; + cssLayout.setSizeFull(); + Label l = new Label("bö"); + l.setSizeFull(); + cssLayout.addComponent(l); + + sp.addComponent(cssLayout); + + Button button = new Button("b"); + button.addListener(new ClickListener() { + boolean bool = true; + + public void buttonClick(ClickEvent event) { + sp.setExpandRatio(cssLayout, bool ? 1 : 0); + bool = !bool; + } + }); + + sp.addComponent(button); + sp.setExpandRatio(button, 1); + + getLayout().addComponent(sp); + + } + + @Override + protected String getDescription() { + return "Upper part of view should become yellow on button click."; + } + + @Override + protected Integer getTicketNumber() { + return 4351; + } + +} -- 2.39.5