From 1199239a48959e3510991095f2d9165f8681e51d Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 2 Sep 2008 06:34:11 +0000 Subject: [PATCH] Test case for #2032 svn changeset:5321/svn branch:trunk --- .../toolkit/tests/tickets/Ticket2032.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/com/itmill/toolkit/tests/tickets/Ticket2032.java diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket2032.java b/src/com/itmill/toolkit/tests/tickets/Ticket2032.java new file mode 100644 index 0000000000..be0098a884 --- /dev/null +++ b/src/com/itmill/toolkit/tests/tickets/Ticket2032.java @@ -0,0 +1,57 @@ +package com.itmill.toolkit.tests.tickets; + +import com.itmill.toolkit.Application; +import com.itmill.toolkit.terminal.UserError; +import com.itmill.toolkit.ui.ExpandLayout; +import com.itmill.toolkit.ui.GridLayout; +import com.itmill.toolkit.ui.Panel; +import com.itmill.toolkit.ui.TextField; +import com.itmill.toolkit.ui.Window; + +public class Ticket2032 extends Application { + + public void init() { + Window w = new Window(getClass().getSimpleName()); + setMainWindow(w); + // setTheme("tests-tickets"); + GridLayout layout = new GridLayout(10, 10); + w.setLayout(layout); + createUI(layout); + } + + private void createUI(GridLayout layout) { + ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); + Panel p = new Panel(el); + p.setWidth(600); + p.setHeight(500); + p.getLayout().setSizeFull(); + + TextField tf = new TextField("Field caption"); + tf.setValue("Expanded"); + el.addComponent(tf); + el.expand(tf); + tf.setSizeFull(); + + tf = new TextField("Vertical bottom"); + // tf.setComponentError(new UserError("Error")); + tf.setValue("Vertical bottom"); + el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, + ExpandLayout.ALIGNMENT_BOTTOM); + el.addComponent(tf); + + tf = new TextField("Vertical top"); + tf.setComponentError(new UserError("Error")); + el.addComponent(tf); + tf.setValue("Vertical top"); + el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, + ExpandLayout.ALIGNMENT_TOP); + tf = new TextField("Vertical center"); + el.addComponent(tf); + tf.setValue("Vertical center"); + // tf.setComponentError(new UserError("Error")); + el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, + ExpandLayout.ALIGNMENT_VERTICAL_CENTER); + + layout.addComponent(p); + } +} -- 2.39.5