]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test case for #2032
authorArtur Signell <artur.signell@itmill.com>
Tue, 2 Sep 2008 06:34:11 +0000 (06:34 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 2 Sep 2008 06:34:11 +0000 (06:34 +0000)
svn changeset:5321/svn branch:trunk

src/com/itmill/toolkit/tests/tickets/Ticket2032.java [new file with mode: 0644]

diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket2032.java b/src/com/itmill/toolkit/tests/tickets/Ticket2032.java
new file mode 100644 (file)
index 0000000..be0098a
--- /dev/null
@@ -0,0 +1,57 @@
+package com.itmill.toolkit.tests.tickets;\r
+\r
+import com.itmill.toolkit.Application;\r
+import com.itmill.toolkit.terminal.UserError;\r
+import com.itmill.toolkit.ui.ExpandLayout;\r
+import com.itmill.toolkit.ui.GridLayout;\r
+import com.itmill.toolkit.ui.Panel;\r
+import com.itmill.toolkit.ui.TextField;\r
+import com.itmill.toolkit.ui.Window;\r
+\r
+public class Ticket2032 extends Application {\r
+\r
+    public void init() {\r
+        Window w = new Window(getClass().getSimpleName());\r
+        setMainWindow(w);\r
+        // setTheme("tests-tickets");\r
+        GridLayout layout = new GridLayout(10, 10);\r
+        w.setLayout(layout);\r
+        createUI(layout);\r
+    }\r
+\r
+    private void createUI(GridLayout layout) {\r
+        ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL);\r
+        Panel p = new Panel(el);\r
+        p.setWidth(600);\r
+        p.setHeight(500);\r
+        p.getLayout().setSizeFull();\r
+\r
+        TextField tf = new TextField("Field caption");\r
+        tf.setValue("Expanded");\r
+        el.addComponent(tf);\r
+        el.expand(tf);\r
+        tf.setSizeFull();\r
+\r
+        tf = new TextField("Vertical bottom");\r
+        // tf.setComponentError(new UserError("Error"));\r
+        tf.setValue("Vertical bottom");\r
+        el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT,\r
+                ExpandLayout.ALIGNMENT_BOTTOM);\r
+        el.addComponent(tf);\r
+\r
+        tf = new TextField("Vertical top");\r
+        tf.setComponentError(new UserError("Error"));\r
+        el.addComponent(tf);\r
+        tf.setValue("Vertical top");\r
+        el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT,\r
+                ExpandLayout.ALIGNMENT_TOP);\r
+        tf = new TextField("Vertical center");\r
+        el.addComponent(tf);\r
+        tf.setValue("Vertical center");\r
+        // tf.setComponentError(new UserError("Error"));\r
+        el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT,\r
+                ExpandLayout.ALIGNMENT_VERTICAL_CENTER);\r
+\r
+        layout.addComponent(p);\r
+    }\r
+}\r