From 0b6ade580d8e592614a2a249bbc420e811f1a210 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 6 Nov 2009 07:31:34 +0000 Subject: [PATCH] test case for TextField sizing issues in IE svn changeset:9652/svn branch:6.2 --- .../components/textfield/SizedTextFields.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/textfield/SizedTextFields.java diff --git a/tests/src/com/vaadin/tests/components/textfield/SizedTextFields.java b/tests/src/com/vaadin/tests/components/textfield/SizedTextFields.java new file mode 100644 index 0000000000..f639172340 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/textfield/SizedTextFields.java @@ -0,0 +1,71 @@ +package com.vaadin.tests.components.textfield; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class SizedTextFields extends TestBase { + + @Override + protected void setup() { + + TextField tf; + + VerticalLayout vl; + + CssLayout cssLayout = new CssLayout() { + @Override + protected String getCss(Component c) { + return "margin-top: 20px; background:red;"; + } + }; + + vl = new VerticalLayout(); + vl.setHeight("40px"); + vl.setWidth("200px"); + + tf = new TextField(); + tf.setSizeFull(); + vl.addComponent(tf); + vl.setCaption("Fullsize textfield in 40px height 200px width box"); + cssLayout.addComponent(vl); + + vl = new VerticalLayout(); + vl.setHeight("40px"); + vl.setWidth("200px"); + + tf = new TextField(); + tf.setRows(2); // make it text area, instead of oneliner + tf.setSizeFull(); + vl.addComponent(tf); + vl.setCaption("Fullsize textarea in 100px height 200px width box"); + cssLayout.addComponent(vl); + + vl = new VerticalLayout(); + vl.setSizeUndefined(); + + tf = new TextField(); + vl.addComponent(tf); + vl.setCaption("Normal textfield in natural size."); + cssLayout.addComponent(vl); + + getLayout().addComponent(cssLayout); + + } + + @Override + protected String getDescription() { + return "TextField sizing is problematic with old IE browsers. " + + "This test is to verify correct size. No red color should " + + "be visible in IE (at least with default windows themes) " + + "and textfields should not look clipped."; + } + + @Override + protected Integer getTicketNumber() { + return 2058; + } + +} -- 2.39.5