From: Matti Tahvonen Date: Wed, 28 Apr 2010 11:18:38 +0000 (+0000) Subject: test case for #4608 X-Git-Tag: 6.7.0.beta1~1670^2~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a648226a8495cd2347181293686e825d1a54edc6;p=vaadin-framework.git test case for #4608 svn changeset:12880/svn branch:6.3 --- diff --git a/tests/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java b/tests/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java new file mode 100644 index 0000000000..f9ff36d9ee --- /dev/null +++ b/tests/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java @@ -0,0 +1,58 @@ +package com.vaadin.tests.layouts; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; + +public class VerticalLayoutWithRelativeSizeComponentsInitiallyHidden extends + TestBase { + + @Override + protected String getDescription() { + return "Size calculations fail if expanded component is relative sized " + + "and initially invisible and when becoming visible at the " + + "same time some other component size changes."; + } + + @Override + protected Integer getTicketNumber() { + return 4608; + } + + @Override + protected void setup() { + + VerticalLayout verticalLayout = getLayout(); + verticalLayout.setHeight("500px"); + + final Label bar = new Label("Bar"); + bar.setSizeUndefined(); + final Label foobar = new Label("FooBar"); + foobar.setSizeFull(); + foobar.setVisible(false); + + bar.setHeight("100px"); + + // bar.setHeight("100px"); + bar.setVisible(false); + + Button b = new Button( + "Click to set bar visible. Button should stay visible."); + b.addListener(new ClickListener() { + + public void buttonClick(ClickEvent event) { + bar.setVisible(true); + foobar.setVisible(true); + } + }); + + verticalLayout.addComponent(bar); + verticalLayout.addComponent(foobar); + verticalLayout.setExpandRatio(foobar, 1); + verticalLayout.addComponent(b); + } + +}