From: Joonas Lehtinen Date: Thu, 3 Jul 2008 17:26:34 +0000 (+0000) Subject: More extensive tests for #1902 X-Git-Tag: 6.7.0.beta1~4478 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8dcf53e0099914db77830e0a4058a0bc10b2b84f;p=vaadin-framework.git More extensive tests for #1902 svn changeset:5045/svn branch:trunk --- diff --git a/WebContent/ITMILL/themes/tests-tickets/styles.css b/WebContent/ITMILL/themes/tests-tickets/styles.css index 7f558c42b8..4c8ea4a202 100644 --- a/WebContent/ITMILL/themes/tests-tickets/styles.css +++ b/WebContent/ITMILL/themes/tests-tickets/styles.css @@ -29,3 +29,11 @@ .i-table-cell-content-young { color: green; } + +/*****************************************************************************/ +/* Ticket 1902 */ +/*****************************************************************************/ + +.i-orderedlayout-red-background { + background: red; + } diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket1902.java b/src/com/itmill/toolkit/tests/tickets/Ticket1902.java index 8d5c85df6f..d8ba095d4c 100644 --- a/src/com/itmill/toolkit/tests/tickets/Ticket1902.java +++ b/src/com/itmill/toolkit/tests/tickets/Ticket1902.java @@ -5,24 +5,67 @@ import com.itmill.toolkit.ui.Button; import com.itmill.toolkit.ui.OrderedLayout; import com.itmill.toolkit.ui.TextField; import com.itmill.toolkit.ui.Window; +import com.itmill.toolkit.ui.Button.ClickEvent; public class Ticket1902 extends Application { public void init() { + // Main layout and main window + final OrderedLayout mainLayout = new OrderedLayout(); + setMainWindow(new Window("Testcase for #1902", mainLayout)); + setTheme("tests-tickets"); + mainLayout.setMargin(false); + mainLayout.setSpacing(true); + mainLayout.addComponent(new Button("mainLayout.setSizeFull()", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + mainLayout.setSizeFull(); + getMainWindow().showNotification( + "Set the main layout size full"); + } + })); + mainLayout.addComponent(new Button("mainLayout.setWidth(\"100%\")", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + mainLayout.setWidth("100%"); + getMainWindow().showNotification( + "Set the main layout width 100%"); + } + })); + + // 100% wide component + Button b2 = new Button("100% wide button"); + mainLayout.addComponent(b2); + b2.setWidth("100%"); + + // 400px wide colored layout OrderedLayout lo = new OrderedLayout(); - setMainWindow(new Window("Testcase for #1902", lo)); + lo.setStyleName("red-background"); + mainLayout.addComponent(lo); + lo.setWidth(400); - lo.setSpacing(false); - lo.setMargin(false); + Button b = new Button("100% wide button"); + lo.addComponent(b); + b.setWidth("100%"); TextField tf = new TextField("100% wide textfield"); lo.addComponent(tf); tf.setWidth("100%"); - Button b = new Button("100% wide button"); - lo.addComponent(b); - b.setWidth("100%"); + // 400x100 colored layout + OrderedLayout lo2 = new OrderedLayout(); + lo2.setStyleName("red-background"); + mainLayout.addComponent(lo2); + lo2.setWidth(400); + lo2.setHeight(200); + + Button b3 = new Button("100% wide button"); + lo2.addComponent(b3); + b3.setWidth("100%"); + TextField tf2 = new TextField("100% wide textfield"); + lo2.addComponent(tf2); + tf2.setWidth("100%"); } } \ No newline at end of file