summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
committerArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
commit7b25b3886ea95bc6495506fbe9472e45fcbde684 (patch)
tree0b93cb65dab437feb46720659a63b8f1ef48f7f4 /uitest/src/com/vaadin/tests/tickets
parent8941056349e302e687e40e94c13709e75f256d73 (diff)
downloadvaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.tar.gz
vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.zip
Renamed tests -> uitest and tests/testbench -> uitest/src (#9299)
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets')
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1225.java69
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1230.java160
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket124.java94
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1245.java95
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1365.java48
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1368.java37
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1397.java161
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1435.java234
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1444.java31
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java85
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1506.java15
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java49
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java139
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java131
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1519.java25
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1572.java121
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1581.java72
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1589.java100
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1598.java133
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket161.java48
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1632.java65
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1659.java36
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1663.java22
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1673.java34
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1710.java403
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1737.java51
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1767.java30
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1772.java38
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1775.java50
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1804.java149
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1805.java58
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1806.java47
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1811.java81
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1819.java67
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java93
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1857.java115
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1868.java20
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1869.java53
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1878.java387
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1900.java74
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1904.java46
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1916.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1919.java59
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1921.java124
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1923.java79
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1925.java15
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1939.java37
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1940.java25
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1953.java114
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1966.java111
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java168
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java63
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1969.java110
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1970.java76
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1972.java30
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1973.java52
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java55
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1975.java63
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1982.java86
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1983.java143
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1986.java79
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1991.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1995.java68
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket20.java83
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2001.java38
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2002.java51
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2007.java29
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2009.java130
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2011.java26
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2014.java65
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2021.java143
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2022.java32
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2023.java53
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2024.java35
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2026.java35
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2029.java140
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2037.java49
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2038.java47
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2040.java87
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2042.java39
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2043.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2048.java105
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2051.java44
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2053.java71
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2060.java51
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2061.java129
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2061b.java202
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2061c.java150
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2062.java41
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2083.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2090.java62
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2095.java29
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2098.java37
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2099.java80
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2101.java21
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2103.java100
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2104.java133
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2106.java39
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2107.java59
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2117.java62
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2119.java97
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2125.java64
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2126.java63
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2151.java118
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2157.java109
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2178.java109
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2179.java54
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2180.java41
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2181.java106
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2186.java54
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2204.java180
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2208.java70
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2209.java43
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java50
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java56
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2215.java29
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2221.java92
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2222.java64
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java46
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2231.java42
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2232.java74
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2234.java43
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2235.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2240.java49
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2242.java82
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2244.java130
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2245.java17
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2267.java42
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2271.java35
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2282.java56
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2283.java29
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2287.java33
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2289.java101
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2292.java98
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2294.java56
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2296.java33
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2297.java41
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2303.java43
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2304.java31
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2310.java58
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2319.java66
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2323.java23
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2325.java30
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2329.java43
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2337.java46
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2339.java39
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2341.java47
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2344.java54
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2347.java50
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2364.java37
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2365.java60
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2398.java40
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2404.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2405.java79
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2406.java50
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2407.java21
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2411.java29
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2415.java42
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2420.java54
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2425.java24
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2426.java28
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2431.java54
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2432.java51
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2434.java30
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2436.java39
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2526.java24
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2742.java42
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2901.java34
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2998.java330
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket3146.java100
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket34.java106
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket5053.java35
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket5157.java53
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket5952.java30
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket6002.java91
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket677.java216
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket695.java42
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket736.java185
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket8291.java125
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket846.java51
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket932.java64
181 files changed, 13090 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java
new file mode 100644
index 0000000000..8c99fe6ebb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java
@@ -0,0 +1,69 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+
+/**
+ * With IE7 extra scrollbars appear in content area all though content fits
+ * properly. Scrollbars will disappear if "shaking" content a bit, like
+ * selecting tests in area.
+ */
+public class Ticket1225 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app to break layout fuction in IE7");
+ setMainWindow(mainWin);
+
+ VerticalSplitPanel sp = new VerticalSplitPanel();
+
+ sp.setFirstComponent(new Label("First"));
+
+ VerticalLayout el = new VerticalLayout();
+
+ sp.setSecondComponent(el);
+ el.setMargin(true);
+ el.setSizeFull();
+
+ el.addComponent(new Label("Top"));
+
+ Table testTable = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 50);
+ testTable.setSizeFull();
+
+ TabSheet ts = new TabSheet();
+ ts.setSizeFull();
+
+ Label red = new Label(
+ "<div style='background:red;width:100%;height:100%;'>??</div>",
+ ContentMode.XHTML);
+ // red.setCaption("cap");
+ // red.setSizeFull();
+
+ // el.addComponent(testTable);
+ // el.setExpandRatio(testTable,1);
+
+ el.addComponent(ts);
+ el.setExpandRatio(ts, 1);
+ ts.addComponent(red);
+ ts.getTab(red).setCaption("REd tab");
+
+ Label l = new Label("<div style='background:blue;'>sdf</div>",
+ ContentMode.XHTML);
+ el.addComponent(l);
+ el.setComponentAlignment(l, Alignment.MIDDLE_RIGHT);
+
+ mainWin.setContent(sp);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1230.java b/uitest/src/com/vaadin/tests/tickets/Ticket1230.java
new file mode 100644
index 0000000000..e11d6ea024
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1230.java
@@ -0,0 +1,160 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+
+public class Ticket1230 extends Application.LegacyApplication {
+
+ private static final Object PROPERTY_ID = new Object();
+ private static final Object NULL_ITEM_ID = new Object();
+ private Select selectWithoutNullItem;
+ private Select selectWithNullItem;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ GridLayout layout = new GridLayout(5, 5);
+ w.setContent(layout);
+
+ layout.setSpacing(true);
+
+ {
+ selectWithoutNullItem = createSelect();
+
+ layout.addComponent(selectWithoutNullItem);
+ Button b = new Button("Select NULL_PROPERTY", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithoutNullItem.select(NULL_ITEM_ID);
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+ b = new Button("Select 1", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithoutNullItem.select("1");
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+ b = new Button("Select 2", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithoutNullItem.select("2");
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+
+ b = new Button("Select null", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithoutNullItem.select(null);
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+ }
+
+ {
+ selectWithNullItem = createSelect();
+ Item nullItem = selectWithNullItem.addItem(NULL_ITEM_ID);
+ nullItem.getItemProperty(PROPERTY_ID).setValue("NULL");
+ selectWithNullItem.setNullSelectionItemId(NULL_ITEM_ID);
+
+ layout.addComponent(selectWithNullItem);
+ selectWithNullItem.setCaption("Select with null item id");
+ Button b = new Button("Select NULL_PROPERTY", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithNullItem.select(NULL_ITEM_ID);
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+
+ b = new Button("Select 1", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithNullItem.select("1");
+ printState();
+
+ }
+ });
+ layout.addComponent(b);
+ b = new Button("Select 2", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithNullItem.select("2");
+ printState();
+ }
+ });
+ layout.addComponent(b);
+
+ b = new Button("Select null", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ selectWithNullItem.select(null);
+ printState();
+ }
+ });
+ layout.addComponent(b);
+
+ }
+
+ w.addComponent(new Button("print select values",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ printState();
+ }
+ }));
+ }
+
+ @SuppressWarnings("deprecation")
+ private Select createSelect() {
+ Select select = new Select();
+ select.addContainerProperty(PROPERTY_ID, String.class, "");
+ select.setItemCaptionPropertyId(PROPERTY_ID);
+
+ Item item1 = select.addItem("1");
+ item1.getItemProperty(PROPERTY_ID).setValue("1");
+ Item item2 = select.addItem("2");
+ item2.getItemProperty(PROPERTY_ID).setValue("2");
+
+ select.setNullSelectionAllowed(true);
+
+ return select;
+ }
+
+ void printState() {
+ System.out.println(" Select without null item "
+ + selectWithoutNullItem.getValue());
+ System.out.println(" Select with null item "
+ + selectWithNullItem.getValue());
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket124.java b/uitest/src/com/vaadin/tests/tickets/Ticket124.java
new file mode 100644
index 0000000000..4bcf31a366
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket124.java
@@ -0,0 +1,94 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket124 extends Application.LegacyApplication {
+
+ private TextField tf;
+ private GridLayout gl;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(
+ "#124: Insert & remove row for GridLayout");
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ // gl = new GridLayout(4, 4);
+ gl = new GridLayout(2, 2);
+
+ tf = new TextField("Row nr");
+ Button insert = new Button("Insert row", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ insertRow();
+
+ }
+ });
+ Button delete = new Button("Delete row", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ deleteRow();
+
+ }
+ });
+
+ // gl.addComponent(new Label("0-0"), 0, 0);
+ // gl.addComponent(new Label("0-1"), 1, 0);
+ gl.addComponent(new Label("1-0"), 1, 0);
+ gl.addComponent(new Label("1-1"), 1, 1);
+ gl.addComponent(new Label("0,0-1,0"), 0, 0, 1, 0);
+ gl.addComponent(new Label("2,0-3,0"), 2, 0, 3, 0);
+ Label l = new Label("Large cell 0,1-2,2<br/>yadayada<br/>lorem ipsum");
+ l.setContentMode(ContentMode.XHTML);
+ gl.addComponent(l, 0, 1, 2, 2);
+ gl.addComponent(new Label("3-1"), 3, 1);
+ gl.addComponent(new Label("3,2-3,3"), 3, 2, 3, 3);
+ gl.addComponent(tf, 0, 3);
+ gl.addComponent(insert, 1, 3);
+ gl.addComponent(delete, 2, 3);
+
+ gl.setStyleName("border");
+ w.addComponent(gl);
+ }
+
+ protected void deleteRow() {
+ int pos = Integer.parseInt(tf.getValue().toString());
+ gl.removeRow(pos);
+
+ }
+
+ protected void clearRow() {
+ int pos = Integer.parseInt(tf.getValue().toString());
+ for (int col = 0; col < gl.getColumns(); col++) {
+ try {
+ gl.removeComponent(col, pos);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ protected void insertRow() {
+ int pos = Integer.parseInt(tf.getValue().toString());
+ gl.insertRow(pos);
+ try {
+ TextField t = new TextField("", "Newly added row");
+ t.setWidth("100%");
+ gl.addComponent(t, 0, pos, 3, pos);
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1245.java b/uitest/src/com/vaadin/tests/tickets/Ticket1245.java
new file mode 100644
index 0000000000..6aa1c1752a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1245.java
@@ -0,0 +1,95 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.ui.AbstractSelect;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Tree;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+public class Ticket1245 extends com.vaadin.Application.LegacyApplication {
+
+ TextField f = new TextField();
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.addComponent(new TreeExample());
+ }
+}
+
+class TreeExample extends CustomComponent {
+
+ // Id for the caption property
+ private static final Object CAPTION_PROPERTY = "caption";
+
+ private static final String desc = "non-first tree in non-sized orderedlayout seems to be the problem";
+
+ Tree tree;
+
+ public TreeExample() {
+ final VerticalLayout main = new VerticalLayout();
+ setCompositionRoot(main);
+
+ // Panel w/ Tree
+ main.setStyleName(Reindeer.PANEL_LIGHT);
+ main.setWidth("200px");
+ // // Description, this is needed. Works in first slot
+ main.addComponent(new Label(desc));
+
+ // setting either width or height fixes the issue
+ // p.setWidth(500);
+ // p.setHeight(800);
+
+ // Tree with a few items
+ tree = new Tree();
+ tree.setImmediate(true);
+ // we'll use a property for caption instead of the item id ("value"),
+ // so that multiple items can have the same caption
+ tree.addContainerProperty(CAPTION_PROPERTY, String.class, "");
+ tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
+ tree.setItemCaptionPropertyId(CAPTION_PROPERTY);
+ for (int i = 1; i <= 3; i++) {
+ final Object id = addCaptionedItem("Section " + i, null);
+ tree.expandItem(id);
+ addCaptionedItem("Team A", id);
+ addCaptionedItem("Team B", id);
+ }
+ main.addComponent(tree);
+ }
+
+ /**
+ * Helper to add an item with specified caption and (optional) parent.
+ *
+ * @param caption
+ * The item caption
+ * @param parent
+ * The (optional) parent item id
+ * @return the created item's id
+ */
+ private Object addCaptionedItem(String caption, Object parent) {
+ // add item, let tree decide id
+ final Object id = tree.addItem();
+ // get the created item
+ final Item item = tree.getItem(id);
+ // set our "caption" property
+ @SuppressWarnings("unchecked")
+ final Property<String> p = (Property<String>) item
+ .getItemProperty(CAPTION_PROPERTY);
+ p.setValue(caption);
+ if (parent != null) {
+ tree.setChildrenAllowed(parent, true);
+ tree.setParent(id, parent);
+ tree.setChildrenAllowed(id, false);
+ }
+ return id;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java
new file mode 100644
index 0000000000..c617b07248
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java
@@ -0,0 +1,48 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
+import com.vaadin.event.ShortcutAction;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1365 extends com.vaadin.Application.LegacyApplication
+ implements Handler {
+
+ TextField f = new TextField();
+
+ Label status = new Label("ENTER and CTRL-S fires shortcut action.");
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.addComponent(f);
+ main.addComponent(status);
+ main.addActionHandler(this);
+ f.focus();
+
+ }
+
+ final static private Action[] actions = new Action[] {
+ new ShortcutAction("Enter", ShortcutAction.KeyCode.ENTER,
+ new int[] {}),
+ new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S,
+ new int[] { ShortcutAction.ModifierKey.CTRL }), };
+
+ @Override
+ public Action[] getActions(Object target, Object sender) {
+ return actions;
+ }
+
+ @Override
+ public void handleAction(Action action, Object sender, Object target) {
+ status.setValue("Pressed " + action.getCaption()
+ + " to fire shortcut. Texfield value: " + f.getValue());
+ f.focus();
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java
new file mode 100644
index 0000000000..16b47a1f31
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+/**
+ */
+public class Ticket1368 extends Application.LegacyApplication {
+
+ private Table t;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
+ setMainWindow(mainWin);
+
+ t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5);
+
+ mainWin.addComponent(t);
+
+ ComboBox addColumn = new ComboBox();
+ addColumn.setImmediate(true);
+ addColumn.setNewItemsAllowed(true);
+ addColumn.setNewItemHandler(new ComboBox.NewItemHandler() {
+ @Override
+ public void addNewItem(String newItemCaption) {
+ t.addContainerProperty(newItemCaption, String.class, "-");
+ }
+ });
+ mainWin.addComponent(addColumn);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1397.java b/uitest/src/com/vaadin/tests/tickets/Ticket1397.java
new file mode 100644
index 0000000000..e162e96bfa
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1397.java
@@ -0,0 +1,161 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Date;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.InlineDateField;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.PopupView;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class Ticket1397 extends Application.LegacyApplication {
+
+ LegacyWindow main;
+
+ @Override
+ public void init() {
+ setTheme("runo");
+ main = new LegacyWindow("PopupView test");
+ setMainWindow(main);
+ Panel panel = new Panel("PopupTest");
+
+ // First test component
+ final ObjectProperty<String> prop = new ObjectProperty<String>(
+ "fooTextField");
+
+ PopupView.Content content = new PopupView.Content() {
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return String.valueOf(prop.getValue());
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return new TextField("Edit foo", prop);
+ }
+ };
+
+ PopupView pe = new PopupView(content);
+ pe.setDescription("Click to edit");
+ panel.addComponent(pe);
+
+ // Second test component
+ PopupView pe2 = new PopupView("fooLabel", new Label("Foooooooooo..."));
+ pe2.setDescription("Click to view");
+ panel.addComponent(pe2);
+
+ // Third test component
+ final ObjectProperty<StringBuffer> prop2 = new ObjectProperty<StringBuffer>(
+ new StringBuffer("Text for button"));
+
+ class myButton extends Button {
+ public myButton() {
+ super("Reverse the property");
+ this.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ StringBuffer getContents = prop2.getValue();
+ getContents.reverse();
+
+ }
+ });
+ }
+ }
+
+ final Panel panel2 = new Panel("Editor with a button");
+ panel2.addComponent(new myButton());
+ PopupView.Content content2 = new PopupView.Content() {
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return String.valueOf(prop2.getValue());
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return panel2;
+ }
+ };
+
+ PopupView p3 = new PopupView(content2);
+ panel.addComponent(p3);
+
+ // Fourth test component
+ final Panel panel3 = new Panel("Editor popup for a property");
+ TextField tf2 = new TextField("TextField for editing a property");
+ final ObjectProperty<String> op = new ObjectProperty<String>(
+ "This is property text.");
+ tf2.setPropertyDataSource(op);
+ panel3.addComponent(tf2);
+ PopupView.Content content3 = new PopupView.Content() {
+
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return String.valueOf(op.getValue());
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return panel3;
+ }
+
+ };
+ PopupView p4 = new PopupView(content3);
+ panel.addComponent(p4);
+
+ // Fifth test component
+ Table table = new Table("Table for testing purposes");
+ for (int i = 0; i < 5; i++) {
+ table.addContainerProperty("" + (i + 1), String.class, "");
+ }
+ table.addContainerProperty("" + 6, PopupView.class, null);
+ table.addContainerProperty("" + 7, PopupView.class, null);
+ table.setPageLength(20);
+ for (int i = 0; i < 1000; i++) {
+
+ final InlineDateField df = new InlineDateField("", new Date());
+ PopupView pp = new PopupView(new PopupView.Content() {
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return String.valueOf(df.getValue());
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return df;
+ }
+ });
+ final int lineNum = i;
+ PopupView pp2 = new PopupView(new PopupView.Content() {
+
+ TextField tf = new TextField("Editor for line " + lineNum,
+
+ "Try to edit the contents for this textfield on line "
+ + lineNum
+ + " and see how the overview-version changes.");
+
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return "" + String.valueOf(tf.getValue()).length()
+ + " characters of info";
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return tf;
+ }
+
+ });
+ table.addItem(new Object[] { "1 " + i, "2 " + i, "3 " + i,
+ "4 " + i, "5 " + i, pp, pp2 }, new Integer(i));
+ }
+
+ main.addComponent(table);
+ main.addComponent(panel);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java
new file mode 100644
index 0000000000..d46a56f73a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java
@@ -0,0 +1,234 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1435 extends Application.LegacyApplication {
+
+ private static final boolean useWorkaround = true;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
+ setMainWindow(mainWin);
+ ((AbstractOrderedLayout) mainWin.getContent()).setSpacing(true);
+
+ ButtonPanel dataCardView1 = buildButtonPanel("My Tickets");
+ ButtonPanel dataCardView2 = buildButtonPanel("My Tickets 2");
+
+ mainWin.addComponent(dataCardView1);
+ mainWin.addComponent(dataCardView2);
+
+ }
+
+ /**
+ * A ButtonPanel is a Panel, which has context specific Buttons in its
+ * header.
+ *
+ * ButtonPanel also provides buttons for controlling its visibility
+ * (collapse/expand).
+ */
+ public class ButtonPanel extends CustomComponent {
+
+ VerticalLayout root = new VerticalLayout();
+
+ // In header are the panel's title and the control buttons.
+ // Panel title is expanded by default.
+ HorizontalLayout header = new HorizontalLayout();
+
+ // This is where the actual data is put.
+ Panel container = new Panel();
+
+ // Last known height before the panel was collapsed
+ private float lastHeight = -1;
+ private Unit lastHeightUnit = null;
+
+ public ButtonPanel(String labelString) {
+ setCompositionRoot(root);
+ root.setSizeFull();
+
+ root.setStyleName("toolbarpanel");
+ header.setStyleName("toolbar");
+
+ initHeader(labelString);
+
+ initContainer();
+ }
+
+ private void initHeader(String labelString) {
+ root.addComponent(header);
+ header.setWidth("100%");
+ header.setHeight("26px");
+ Label label = new Label(labelString);
+ label.setStyleName("caption");
+ header.addComponent(label);
+
+ final Layout buttonContainer;
+ if (useWorkaround) {
+ buttonContainer = header;
+
+ } else {
+ buttonContainer = new HorizontalLayout();
+ header.addComponent(buttonContainer);
+
+ }
+
+ Button edit = new Button("Edit");
+ edit.setStyleName("link");
+ buttonContainer.addComponent(edit);
+
+ Button copy = new Button("Copy");
+ copy.setStyleName("link");
+ buttonContainer.addComponent(copy);
+
+ Button move = new Button("Move");
+ move.setStyleName("link");
+ buttonContainer.addComponent(move);
+
+ Button delete = new Button("Delete");
+ delete.setStyleName("link");
+ buttonContainer.addComponent(delete);
+
+ Button bind = new Button("Bind");
+ bind.setStyleName("link");
+ buttonContainer.addComponent(bind);
+
+ Button options = new Button("Options...");
+ options.setStyleName("link");
+ buttonContainer.addComponent(options);
+
+ final Button expand = new Button("Expand");
+
+ final Button collapse = new Button("Collapse");
+ buttonContainer.addComponent(collapse);
+
+ collapse.setStyleName("collapse");
+ collapse.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ if (useWorkaround) {
+ container.setVisible(false);
+ lastHeight = root.getHeight();
+ lastHeightUnit = root.getHeightUnits();
+ root.setHeight("26px");
+ buttonContainer.replaceComponent(collapse, expand);
+ } else {
+ boolean visible = container.isVisible();
+ container.setVisible(!visible);
+ if (visible) {
+ lastHeight = root.getHeight();
+ lastHeightUnit = root.getHeightUnits();
+ root.setHeight("26px");
+ } else {
+ root.setHeight(lastHeight, lastHeightUnit);
+ }
+ event.getButton().setCaption(
+ visible ? "Expand" : "Collapse");
+ }
+ }
+ });
+
+ if (useWorkaround) {
+ expand.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ container.setVisible(true);
+ root.setHeight(lastHeight, lastHeightUnit);
+ buttonContainer.replaceComponent(expand, collapse);
+ }
+ });
+ }
+
+ }
+
+ private void initContainer() {
+ container.setStyleName("custompanel");
+ container.setSizeFull();
+ ((MarginHandler) container.getContent()).setMargin(false);
+ container.getContent().setSizeFull();
+ root.addComponent(container);
+ root.setExpandRatio(container, 1);
+ }
+
+ public void setHeight(int height, Unit unit) {
+ root.setHeight(height, unit);
+ lastHeight = height;
+ lastHeightUnit = unit;
+ container.setHeight("100%");
+ }
+
+ @Override
+ public void setHeight(String height) {
+ root.setHeight(height);
+ lastHeight = root.getHeight();
+ lastHeightUnit = root.getHeightUnits();
+ container.setHeight("100%");
+ }
+
+ @Override
+ public void setWidth(String width) {
+ root.setWidth(width);
+ }
+
+ public void setWidth(int width, Unit unit) {
+ root.setWidth(width, unit);
+ }
+
+ @Override
+ public void setSizeFull() {
+ setWidth("100%");
+ setHeight("100%");
+ }
+
+ public void setPanelComponent(Component component) {
+ container.removeAllComponents();
+ container.addComponent(component);
+ }
+ }
+
+ public ButtonPanel buildButtonPanel(String caption) {
+ ButtonPanel panel = new ButtonPanel(caption);
+
+ panel.setHeight("250px");
+ panel.setWidth("500px");
+
+ Table table = new Table();
+
+ table.setSizeFull();
+
+ table.addContainerProperty("checkbox", CheckBox.class, new CheckBox());
+ table.setColumnWidth("checkbox", 30);
+ table.setColumnHeader("checkbox", "");
+
+ table.addContainerProperty("Tickets", String.class, null);
+ table.setColumnWidth("Tickets", 150);
+
+ table.addContainerProperty("Deadline", String.class, null);
+
+ for (int i = 0; i < 10; i++) {
+ String name = "Name " + i;
+ table.addItem(new Object[] { new CheckBox(), name,
+ "02-22-2007 13:37" }, new Integer(i));
+ }
+
+ panel.setPanelComponent(table);
+
+ return panel;
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java
new file mode 100644
index 0000000000..1da3b5c290
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java
@@ -0,0 +1,31 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1444 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app to break layout fuction in IE7");
+ setMainWindow(mainWin);
+
+ VerticalLayout ol = new VerticalLayout();
+ ol.setHeight("250px");
+ ol.setWidth("500px");
+
+ Label red = new Label(
+ "<div style='background:red;width:100%;height:100%;'>??</div>",
+ ContentMode.XHTML);
+ red.setSizeFull();
+
+ ol.addComponent(red);
+ mainWin.addComponent(ol);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
new file mode 100644
index 0000000000..3c766ef985
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
@@ -0,0 +1,85 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Window;
+
+public class Ticket1465ModalNotification extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
+ setMainWindow(mainWin);
+
+ final Window modal = new Window("Modal window");
+ modal.setModal(true);
+
+ Button b = new Button("click to show notification",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show(
+ "Try clicking the button in main window!",
+ Notification.TYPE_ERROR_MESSAGE);
+
+ }
+ });
+ modal.addComponent(b);
+
+ b = new Button("click to warning notification",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show(
+ "Try clicking the button in main window!",
+ Notification.TYPE_WARNING_MESSAGE);
+ }
+ });
+ modal.addComponent(b);
+
+ b = new Button("click to Humanized notification",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show(
+ "Try clicking the button in main window!",
+ Notification.TYPE_HUMANIZED_MESSAGE);
+ }
+ });
+ modal.addComponent(b);
+
+ b = new Button("click to test modality!", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ mainWin.addComponent(new Label("clicked"));
+
+ }
+ });
+
+ modal.addComponent(b);
+
+ mainWin.addWindow(modal);
+
+ b = new Button("click to test modality!", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ mainWin.addComponent(new Label("clicked"));
+
+ }
+ });
+
+ mainWin.addComponent(b);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506.java
new file mode 100644
index 0000000000..4788d27aad
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506.java
@@ -0,0 +1,15 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Panel;
+
+public class Ticket1506 extends CustomComponent {
+
+ Panel p;
+
+ public Ticket1506() {
+ p = new Ticket1506_Panel();
+ setCompositionRoot(p);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java
new file mode 100644
index 0000000000..9835e046dc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java
@@ -0,0 +1,49 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.Select;
+
+/**
+ * @author Efecte R&D
+ * @version $Revision$, $Date$
+ */
+public class Ticket1506_Panel extends Panel {
+
+ public Ticket1506_Panel() {
+ ObjectProperty<String> property1 = new ObjectProperty<String>(null,
+ String.class);
+ addComponent(initSelect(new Ticket1506_TestContainer(), "Test select",
+ property1));
+ addComponent(initButton(property1));
+ addComponent(initSelect(new Ticket1506_TestContainer2(),
+ "Test select 2", new ObjectProperty<String>(null, String.class)));
+ }
+
+ private Component initButton(final ObjectProperty<?> property) {
+ Button button = new Button("Clear select");
+ button.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ property.setValue(null);
+ }
+ });
+ return button;
+ }
+
+ private Component initSelect(Container containerDataSource, String caption,
+ ObjectProperty<?> property) {
+ Select select = new Select(caption);
+ select.setFilteringMode(Select.FILTERINGMODE_CONTAINS);
+ select.setImmediate(true);
+ select.setNullSelectionAllowed(false);
+ select.setItemCaptionPropertyId(Ticket1506_TestContainer.PROPERTY_2_ID);
+
+ select.setContainerDataSource(containerDataSource);
+ select.setPropertyDataSource(property);
+ return select;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
new file mode 100644
index 0000000000..d6b53db7c7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
@@ -0,0 +1,139 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.util.PropertysetItem;
+
+/**
+ * @author Efecte R&D
+ * @version $Revision$, $Date$
+ */
+public class Ticket1506_TestContainer implements Container {
+ private Map<String, PropertysetItem> items = new HashMap<String, PropertysetItem>();
+ public static final String ITEM_1_ID = "1";
+ public static final String ITEM_2_ID = "2";
+ public static final String PROPERTY_1_ID = "property 1";
+ public static final String PROPERTY_2_ID = "property 2";
+
+ private void loadItems() {
+ final PropertysetItem item1 = new PropertysetItem();
+ item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
+ "value 1", String.class));
+ item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
+ "name 1", String.class));
+ items.put(ITEM_1_ID, item1);
+
+ final PropertysetItem item2 = new PropertysetItem();
+ item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
+ "value 2", String.class));
+ item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
+ "name 2", String.class));
+ items.put(ITEM_2_ID, item2);
+ }
+
+ @Override
+ public Item getItem(Object itemId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.get(itemId);
+ }
+
+ @Override
+ public Collection<String> getContainerPropertyIds() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ ArrayList<String> a = new ArrayList<String>();
+ a.add(PROPERTY_1_ID);
+ a.add(PROPERTY_2_ID);
+ return a;
+ }
+
+ @Override
+ public Collection<String> getItemIds() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ ArrayList<String> a = new ArrayList<String>();
+ a.add(ITEM_1_ID);
+ a.add(ITEM_2_ID);
+ return a;
+ }
+
+ @Override
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ Item item = items.get(itemId);
+ if (item != null) {
+ return item.getItemProperty(propertyId);
+ }
+ return null;
+ }
+
+ @Override
+ public Class<String> getType(Object propertyId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return String.class;
+ }
+
+ @Override
+ public int size() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.size();
+ }
+
+ @Override
+ public boolean containsId(Object itemId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.containsKey(itemId);
+ }
+
+ @Override
+ public Item addItem(Object itemId) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public Object addItem() throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeItem(Object itemId)
+ throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean addContainerProperty(Object propertyId, Class<?> type,
+ Object defaultValue) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeContainerProperty(Object propertyId)
+ throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeAllItems() throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
new file mode 100644
index 0000000000..7ac34dcd2e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
@@ -0,0 +1,131 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.util.PropertysetItem;
+
+/**
+ * @author Efecte R&D
+ * @version $Revision$, $Date$
+ */
+public class Ticket1506_TestContainer2 implements Container {
+ private Map<String, PropertysetItem> items = new HashMap<String, PropertysetItem>();
+ public static final String ITEM_1_ID = "1";
+ public static final String ITEM_2_ID = "2";
+ public static final String PROPERTY_1_ID = "property 1";
+ public static final String PROPERTY_2_ID = "property 2";
+
+ private void loadItems() {
+ for (int i = 1; i < 15; i++) {
+ final PropertysetItem item = new PropertysetItem();
+ item.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>(
+ "value " + i, String.class));
+ item.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>(
+ "name " + i, String.class));
+ items.put(String.valueOf(i), item);
+ }
+ }
+
+ @Override
+ public Item getItem(Object itemId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.get(itemId);
+ }
+
+ @Override
+ public Collection<String> getContainerPropertyIds() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ ArrayList<String> a = new ArrayList<String>();
+ a.add(PROPERTY_1_ID);
+ a.add(PROPERTY_2_ID);
+ return a;
+ }
+
+ @Override
+ public Collection<String> getItemIds() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.keySet();
+ }
+
+ @Override
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ Item item = items.get(itemId);
+ if (item != null) {
+ return item.getItemProperty(propertyId);
+ }
+ return null;
+ }
+
+ @Override
+ public Class<String> getType(Object propertyId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return String.class;
+ }
+
+ @Override
+ public int size() {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.size();
+ }
+
+ @Override
+ public boolean containsId(Object itemId) {
+ if (items.isEmpty()) {
+ loadItems();
+ }
+ return items.containsKey(itemId);
+ }
+
+ @Override
+ public Item addItem(Object itemId) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public Object addItem() throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeItem(Object itemId)
+ throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean addContainerProperty(Object propertyId, Class<?> type,
+ Object defaultValue) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeContainerProperty(Object propertyId)
+ throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+
+ @Override
+ public boolean removeAllItems() throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java
new file mode 100644
index 0000000000..8b1736637b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java
@@ -0,0 +1,25 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+
+public class Ticket1519 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1519");
+ setMainWindow(mainWin);
+
+ setTheme("tests-tickets");
+ TabSheet ts = new TabSheet();
+
+ ts.addTab(new CustomLayout("Ticket1519_News"), "News", null);
+ ts.addTab(new CustomLayout("Ticket1519_Support"), "Support", null);
+
+ mainWin.addComponent(ts);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1572.java b/uitest/src/com/vaadin/tests/tickets/Ticket1572.java
new file mode 100644
index 0000000000..a511bae6d9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1572.java
@@ -0,0 +1,121 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1572 extends com.vaadin.Application.LegacyApplication {
+
+ private Label state;
+ private GridLayout gl;
+ private Label spacingstate;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ Panel p = new Panel("Test wrapper for gridlayout margin/spacing");
+
+ p.setContent(new HorizontalLayout());
+
+ gl = new GridLayout(3, 3);
+ gl.setMargin(true);
+ for (int i = 0; i < 3 * 3; i++) {
+ gl.addComponent(new Button("test"));
+ }
+ p.addComponent(gl);
+ p.addComponent(new Label("| next component"));
+
+ Button b = new Button("next margin state");
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ nextMarginState();
+ }
+
+ });
+
+ state = new Label();
+ state.setCaption("Current margin state:");
+ main.addComponent(state);
+ main.addComponent(b);
+
+ Button b2 = new Button("next spacing state");
+ b2.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ nextSpacingState();
+ }
+
+ });
+
+ spacingstate = new Label();
+ spacingstate.setCaption("Current Spacing State:");
+ main.addComponent(spacingstate);
+ main.addComponent(b2);
+
+ main.addComponent(p);
+
+ nextMarginState();
+ nextSpacingState();
+
+ }
+
+ private int stateCounter = -1;
+
+ private void nextMarginState() {
+ stateCounter++;
+ switch (stateCounter) {
+ case 0:
+ gl.setMargin(false);
+ state.setValue("Margin off");
+ break;
+ case 1:
+ gl.setMargin(true);
+ state.setValue("Margin on");
+ break;
+ case 2:
+ gl.setMargin(new MarginInfo(true, false, false, false));
+ state.setValue("Margin top");
+ break;
+ case 3:
+ gl.setMargin(new MarginInfo(false, true, false, false));
+ state.setValue("Margin right");
+ break;
+ case 4:
+ gl.setMargin(new MarginInfo(false, false, true, false));
+ state.setValue("Margin bottom");
+ break;
+ case 5:
+ gl.setMargin(new MarginInfo(false, false, false, true));
+ state.setValue("Margin left");
+ break;
+ default:
+ stateCounter = -1;
+ nextMarginState();
+ break;
+ }
+ }
+
+ private boolean spacing = true;
+
+ private void nextSpacingState() {
+ spacing = !spacing;
+ if (spacing) {
+ gl.setSpacing(true);
+ spacingstate.setValue("Spacing on");
+ } else {
+ gl.setSpacing(false);
+ spacingstate.setValue("Spacing off");
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1581.java b/uitest/src/com/vaadin/tests/tickets/Ticket1581.java
new file mode 100644
index 0000000000..5025605413
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1581.java
@@ -0,0 +1,72 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Date;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1581 extends com.vaadin.Application.LegacyApplication {
+
+ private Label time;
+ private ProgressIndicator poller;
+ private Thread thread;
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.addComponent(new Label("Test the second issue in ticket #1581"));
+
+ time = new Label();
+ poller = new ProgressIndicator();
+ poller.setPollingInterval(200);
+ main.addComponent(time);
+ main.addComponent(poller);
+
+ thread = new Thread() {
+
+ @Override
+ public void run() {
+ super.run();
+ while (true) {
+ time.setValue(new Date());
+ try {
+ sleep(200);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ };
+
+ thread.start();
+
+ final Button stop = new Button("Stop updating", new ClickListener() {
+ boolean active = true;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+
+ if (active) {
+ main.removeComponent(poller);
+ event.getButton().setCaption("Resume");
+ } else {
+ main.addComponent(poller);
+ event.getButton().setCaption("Stop updating");
+ }
+ active = !active;
+ }
+ });
+
+ main.addComponent(stop);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java
new file mode 100644
index 0000000000..37f9197285
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java
@@ -0,0 +1,100 @@
+package com.vaadin.tests.tickets;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Date;
+
+import javax.imageio.ImageIO;
+
+import com.vaadin.Application;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1589 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ MyDynamicResource res = new MyDynamicResource();
+
+ addRequestHandler(res);
+
+ w.addComponent(new Link(
+ "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)",
+ new ExternalResource("myresource")));
+
+ w.addComponent(new Link(
+ "Test (with Content-Disposition, should popup download dialog that suggests filename downloadedPNG.png)",
+ new ExternalResource("myresource_download")));
+ }
+}
+
+class MyDynamicResource implements RequestHandler {
+ String textToDisplay = (new Date()).toString();
+
+ /**
+ * Provides the dynamic resource if the URI matches the resource URI. The
+ * matching URI is "/myresource" under the application URI context.
+ *
+ * Returns null if the URI does not match. Otherwise returns a download
+ * stream that contains the response from the server.
+ */
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
+ // Catch the given URI that identifies the resource, otherwise let other
+ // URI handlers or the Application to handle the response.
+ if (!relativeUri.startsWith("myresource")) {
+ return false;
+ }
+
+ // Create an image and draw some background on it.
+ BufferedImage image = new BufferedImage(200, 200,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics drawable = image.getGraphics();
+ drawable.setColor(Color.lightGray);
+ drawable.fillRect(0, 0, 200, 200);
+ drawable.setColor(Color.yellow);
+ drawable.fillOval(25, 25, 150, 150);
+ drawable.setColor(Color.blue);
+ drawable.drawRect(0, 0, 199, 199);
+
+ // Use the parameter to create dynamic content.
+ drawable.setColor(Color.black);
+ drawable.drawString("Time: " + textToDisplay, 75, 100);
+
+ try {
+ // Write the image to a buffer.
+ ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream();
+ ImageIO.write(image, "png", imagebuffer);
+
+ // Return a stream from the buffer.
+ ByteArrayInputStream istream = new ByteArrayInputStream(
+ imagebuffer.toByteArray());
+ DownloadStream downloadStream = new DownloadStream(istream,
+ "image/png", "generatedFile.png");
+
+ if (relativeUri.startsWith("myresource_download")) {
+ downloadStream.setParameter("Content-Disposition",
+ "attachment; filename=\"downloadedPNG.png\"");
+ }
+ downloadStream.writeResponse(request, response);
+ return true;
+ } catch (IOException e) {
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java
new file mode 100644
index 0000000000..2f845a2264
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java
@@ -0,0 +1,133 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.Application;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.MenuBar.Command;
+import com.vaadin.ui.MenuBar.MenuItem;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1598 extends Application.LegacyApplication {
+
+ LegacyWindow main = new LegacyWindow("MenuBar test");
+
+ final MenuBar menuBar = new MenuBar();
+
+ @Override
+ public void init() {
+ setMainWindow(main);
+ setTheme("runo");
+
+ List<MenuItem> itemList = new ArrayList<MenuItem>();
+ // Populate the menu bar
+ for (int i = 0; i < 6; i++) {
+ itemList.add(menuBar.addItem(new String("Menu " + i), null, null));
+ }
+
+ MenuItem first = itemList.get(0);
+
+ for (int i = 0; i < 5; i++) {
+ first.addItem(new String("Submenu item" + i), null, new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action " + selected.getText());
+ }
+ });
+ }
+
+ MenuItem firstSubItem1 = first.getChildren().get(1);
+
+ for (int i = 0; i < 3; i++) {
+ firstSubItem1.addItem(new String("Subsubmenu item" + i), null,
+ new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
+ }
+ MenuItem firstSubItem2 = first.getChildren().get(3);
+
+ for (int i = 0; i < 3; i++) {
+ firstSubItem2.addItem(new String("Subsubmenu item" + i), null,
+ new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
+ }
+
+ MenuItem second = menuBar.getItems().get(1);
+
+ for (int i = 0; i < 5; i++) {
+ second.addItem(new String("Second submenu item" + i), null,
+ new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selected) {
+ main.showNotification("Action "
+ + selected.getText());
+ }
+ });
+ }
+
+ MenuItem third = menuBar.getItems().get(2);
+ third.setIcon(new ThemeResource("icons/16/document.png"));
+
+ for (int i = 2; i <= 3; i++) {
+ (menuBar.getItems().get(i)).setCommand(new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selectedItem) {
+ main.showNotification("Action " + selectedItem.getText());
+ }
+ });
+ }
+
+ final MenuItem fourth = menuBar.getItems().get(3);
+ fourth.setText("Add new item");
+
+ fourth.setCommand(new Command() {
+ @Override
+ public void menuSelected(MenuItem selected) {
+ menuBar.addItem("Newborn", null, null);
+ }
+ });
+
+ final MenuItem fifth = menuBar.getItems().get(4);
+ for (int i = 0; i < 5; i++) {
+ fifth.addItem("Another subitem " + i, null);
+ }
+
+ final MenuItem last = menuBar.getItems().get(menuBar.getSize() - 1);
+ last.setText("Remove me!");
+
+ // A command for removing the selected menuitem
+ Command removeCommand = new Command() {
+
+ @Override
+ public void menuSelected(MenuItem selected) {
+ MenuItem parent = selected.getParent();
+ if (parent != null) {
+ parent.removeChild(selected);
+ } else {
+ menuBar.removeItem(selected);
+ }
+ }
+ };
+
+ last.setCommand(removeCommand);
+
+ main.addComponent(menuBar);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket161.java b/uitest/src/com/vaadin/tests/tickets/Ticket161.java
new file mode 100644
index 0000000000..4da1b3a6b4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket161.java
@@ -0,0 +1,48 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Container;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+/**
+ */
+public class Ticket161 extends Application.LegacyApplication {
+
+ private Table t;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
+ setMainWindow(mainWin);
+
+ t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 100);
+ t.setCurrentPageFirstItemIndex(50);
+
+ mainWin.addComponent(t);
+
+ Button b = new Button("Truncate to 20 rows");
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+
+ Container containerDataSource = t.getContainerDataSource();
+ Object[] itemIds = containerDataSource.getItemIds().toArray();
+ @SuppressWarnings("unused")
+ int c = 0;
+ for (int i = 0; i < itemIds.length; i++) {
+ if (i > 19) {
+ containerDataSource.removeItem(itemIds[i]);
+ }
+ }
+ }
+ });
+
+ mainWin.addComponent(b);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java
new file mode 100644
index 0000000000..bca902a73f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java
@@ -0,0 +1,65 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+/**
+ */
+public class Ticket1632 extends Application.LegacyApplication {
+
+ private Table t;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app");
+ setMainWindow(mainWin);
+
+ t = new Table();
+
+ t.addContainerProperty("col1", String.class, "");
+ t.addContainerProperty("col2", String.class, "");
+ t.addContainerProperty("col3", String.class, "");
+
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "1");
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "2");
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "3");
+
+ t.setVisibleColumns(new Object[] { "col1", "col2" });
+
+ t.addItem(new Object[] { "foo", "bar" }, "4");
+
+ // workaround to add item with all values
+ Item i = t.addItem("5");
+ i.getItemProperty("col1").setValue("jep");
+ i.getItemProperty("col2").setValue("foo");
+ i.getItemProperty("col3").setValue("bar");
+
+ mainWin.addComponent(t);
+
+ Button b = new Button("Toggle col3");
+ b.addListener(new Button.ClickListener() {
+ boolean visible = false;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ visible = !visible;
+ if (visible) {
+ t.setVisibleColumns(new Object[] { "col1", "col2", "col3" });
+
+ } else {
+ t.setVisibleColumns(new Object[] { "col1", "col2" });
+
+ }
+
+ }
+ });
+
+ mainWin.addComponent(b);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1659.java b/uitest/src/com/vaadin/tests/tickets/Ticket1659.java
new file mode 100644
index 0000000000..57d2ad73e5
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1659.java
@@ -0,0 +1,36 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1659 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow mainWin = new LegacyWindow();
+ setMainWindow(mainWin);
+ mainWin.addComponent(new Button(
+ "Change URI using Application.getURL()",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ mainWin.open(new ExternalResource(getURL() + "#"
+ + System.currentTimeMillis()));
+ }
+ }));
+ mainWin.addComponent(new Button("Change URI uring Window.getURL()",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ mainWin.open(new ExternalResource(mainWin.getURL()
+ + "#" + System.currentTimeMillis()));
+ }
+ }));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1663.java b/uitest/src/com/vaadin/tests/tickets/Ticket1663.java
new file mode 100644
index 0000000000..1ef16afe95
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1663.java
@@ -0,0 +1,22 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.server.SystemError;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1663 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ LegacyWindow main = new LegacyWindow("#1663");
+ setMainWindow(main);
+
+ TextField tf = new TextField("First name");
+ tf.setDescription("The first name is used for the administration user interfaces only.");
+ tf.setComponentError(new SystemError(
+ "You must enter only one first name."));
+
+ main.addComponent(tf);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1673.java b/uitest/src/com/vaadin/tests/tickets/Ticket1673.java
new file mode 100644
index 0000000000..99f213541a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1673.java
@@ -0,0 +1,34 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1673 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#1673");
+ setMainWindow(main);
+
+ main.addComponent(new Button("close", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ close();
+ }
+ }));
+
+ }
+
+ public static Application.SystemMessages getSystemMessages() {
+ Application.CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages();
+
+ msgs.setSessionExpiredURL("http://www.vaadin.com/");
+ msgs.setSessionExpiredCaption("Foo");
+ msgs.setSessionExpiredMessage("Bar");
+
+ return msgs;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1710.java b/uitest/src/com/vaadin/tests/tickets/Ticket1710.java
new file mode 100644
index 0000000000..c00e2f32eb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1710.java
@@ -0,0 +1,403 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Iterator;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.server.SystemError;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.shared.ui.AlignmentInfo.Bits;
+import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1710 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ setTheme("tests-tickets");
+
+ VerticalLayout lo = new VerticalLayout();
+ setMainWindow(new LegacyWindow("#1710", lo));
+ lo.setMargin(true);
+ lo.setSpacing(true);
+ lo.setWidth("100%");
+
+ // Hiding controls
+ HorizontalLayout hidingControls = new HorizontalLayout();
+ lo.addComponent(hidingControls);
+
+ // OrderedLayout
+ final VerticalLayout orderedLayout = new VerticalLayout();
+ LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout",
+ orderedLayout);
+ CheckBox cb = new CheckBox("OrderedLayout",
+ new MethodProperty<Boolean>(oltp, "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ lo.addComponent(oltp);
+ orderedLayout.setSpacing(false);
+ addFields(orderedLayout);
+
+ // GridLayout
+ GridLayout grid = new GridLayout(1, 1);
+ Panel g1tp = new LayoutTestingPanel("Gridlayout with 1 column", grid);
+ cb = new CheckBox("GridLayout (1col)", new MethodProperty<Boolean>(
+ g1tp, "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ g1tp.setVisible(false);
+ lo.addComponent(g1tp);
+ grid.setSpacing(true);
+ addFields(grid);
+ GridLayout grid2 = new GridLayout(2, 1);
+ Panel g2tp = new LayoutTestingPanel("Gridlayout with 2 columns", grid2);
+ cb = new CheckBox("GridLayout (2cols)", new MethodProperty<Boolean>(
+ g2tp, "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ g2tp.setVisible(false);
+ lo.addComponent(g2tp);
+ grid2.setSpacing(true);
+ addFields(grid2);
+
+ // ExpandLayout
+ VerticalLayout el = new VerticalLayout();
+ Panel elp = new LayoutTestingPanel(
+ "ExpandLayout width first component expanded", el);
+ cb = new CheckBox("ExpandLayout (vertical)",
+ new MethodProperty<Boolean>(elp, "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ elp.setVisible(false);
+ el.setHeight("700px");
+ addFields(el);
+ Component firstComponent = el.getComponentIterator().next();
+ firstComponent.setSizeFull();
+ el.setExpandRatio(firstComponent, 1);
+ lo.addComponent(elp);
+ HorizontalLayout elh = new HorizontalLayout();
+ Panel elhp = new LayoutTestingPanel(
+ "ExpandLayout width first component expanded; horizontal", elh);
+ cb = new CheckBox("ExpandLayout (horizontal)",
+ new MethodProperty<Boolean>(elhp, "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ elhp.setVisible(false);
+ elh.setWidth("2000px");
+ elh.setHeight("100px");
+ addFields(elh);
+ Component firstComponentElh = elh.getComponentIterator().next();
+ firstComponentElh.setSizeFull();
+ elh.setExpandRatio(firstComponentElh, 1);
+ lo.addComponent(elhp);
+
+ // CustomLayout
+ VerticalLayout cl = new VerticalLayout();
+ Panel clp = new LayoutTestingPanel("CustomLayout", cl);
+ cb = new CheckBox("CustomLayout", new MethodProperty<Boolean>(clp,
+ "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ clp.setVisible(false);
+ lo.addComponent(clp);
+ cl.addComponent(new Label("<<< Add customlayout testcase here >>>"));
+
+ // Form
+ Panel formPanel = new Panel("Form");
+ cb = new CheckBox("Form", new MethodProperty<Boolean>(formPanel,
+ "visible"));
+ cb.setImmediate(true);
+ hidingControls.addComponent(cb);
+ formPanel.setVisible(false);
+ formPanel.addComponent(getFormPanelExample());
+ lo.addComponent(formPanel);
+
+ for (Iterator<Component> i = hidingControls.getComponentIterator(); i
+ .hasNext();) {
+ ((AbstractComponent) i.next()).setImmediate(true);
+ }
+
+ }
+
+ private Form getFormPanelExample() {
+ Form f = new Form();
+ f.setCaption("Test form");
+ CheckBox fb2 = new CheckBox("Test button", true);
+ fb2.setComponentError(new SystemError("Test error"));
+ f.addField("fb2", fb2);
+ TextField ft1 = new TextField("With caption");
+ ft1.setComponentError(new SystemError("Error"));
+ f.addField("ft1", ft1);
+ TextField ft2 = new TextField();
+ ft2.setComponentError(new SystemError("Error"));
+ ft2.setValue("Without caption");
+ f.addField("ft2", ft2);
+ TextField ft3 = new TextField("With caption and required");
+ ft3.setComponentError(new SystemError("Error"));
+ ft3.setRequired(true);
+ f.addField("ft3", ft3);
+ return f;
+ }
+
+ private void addFields(ComponentContainer lo) {
+ Button button = new Button("Test button");
+ button.setComponentError(new SystemError("Test error"));
+ lo.addComponent(button);
+
+ CheckBox b2 = new CheckBox("Test button");
+ b2.setComponentError(new SystemError("Test error"));
+ lo.addComponent(b2);
+
+ TextField t1 = new TextField("With caption");
+ t1.setComponentError(new SystemError("Error"));
+ lo.addComponent(t1);
+
+ TextField t2 = new TextField("With caption and required");
+ t2.setComponentError(new SystemError("Error"));
+ t2.setRequired(true);
+ lo.addComponent(t2);
+
+ TextField t3 = new TextField();
+ t3.setValue("Without caption");
+ t3.setComponentError(new SystemError("Error"));
+ lo.addComponent(t3);
+
+ lo.addComponent(new TextField("Textfield with no error in it"));
+
+ TextField tt1 = new TextField("100% wide Textfield with no error in it");
+ tt1.setWidth("100%");
+ lo.addComponent(tt1);
+
+ TextField tt2 = new TextField();
+ tt2.setWidth("100%");
+ tt2.setValue("100% wide Textfield with no error in it and no caption");
+ lo.addComponent(tt2);
+
+ TextField t4 = new TextField();
+ t4.setValue("Without caption, With required");
+ t4.setComponentError(new SystemError("Error"));
+ t4.setRequired(true);
+ lo.addComponent(t4);
+
+ TextField t5 = new TextField();
+ t5.setValue("Without caption, WIDE");
+ t5.setComponentError(new SystemError("Error"));
+ t5.setWidth("100%");
+ lo.addComponent(t5);
+
+ TextField t6 = new TextField();
+ t6.setValue("Without caption, With required, WIDE");
+ t6.setComponentError(new SystemError("Error"));
+ t6.setRequired(true);
+ t6.setWidth("100%");
+ lo.addComponent(t6);
+
+ TextField t7 = new TextField();
+ t7.setValue("With icon and required and icon");
+ t7.setComponentError(new SystemError("Error"));
+ t7.setRequired(true);
+ t7.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
+ lo.addComponent(t7);
+
+ DateField d1 = new DateField(
+ "Datefield with caption and icon, next one without caption");
+ d1.setComponentError(new SystemError("Error"));
+ d1.setRequired(true);
+ d1.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
+ lo.addComponent(d1);
+
+ DateField d2 = new DateField();
+ d2.setComponentError(new SystemError("Error"));
+ d2.setRequired(true);
+ lo.addComponent(d2);
+ }
+
+ public class LayoutTestingPanel extends Panel {
+
+ Layout testedLayout;
+
+ HorizontalLayout controls = new HorizontalLayout();
+ CheckBox marginLeft = new CheckBox("m-left", false);
+ CheckBox marginRight = new CheckBox("m-right", false);
+ CheckBox marginTop = new CheckBox("m-top", false);
+ CheckBox marginBottom = new CheckBox("m-bottom", false);
+ CheckBox spacing = new CheckBox("spacing", false);
+ VerticalLayout testPanelLayout = new VerticalLayout();
+
+ LayoutTestingPanel(String caption, Layout layout) {
+ super(caption);
+ VerticalLayout internalLayout = new VerticalLayout();
+ internalLayout.setWidth("100%");
+ setContent(internalLayout);
+ testedLayout = layout;
+ testPanelLayout.setWidth("100%");
+ Panel controlWrapper = new Panel();
+ controlWrapper.addComponent(controls);
+ controlWrapper.setWidth("100%");
+ controlWrapper.setStyleName("controls");
+ internalLayout.addComponent(controlWrapper);
+ Panel testPanel = new Panel(testPanelLayout);
+ testPanel.setStyleName("testarea");
+ testPanelLayout.addComponent(testedLayout);
+ internalLayout.addComponent(testPanel);
+ internalLayout.setMargin(true);
+ internalLayout.setSpacing(true);
+ controls.setSpacing(true);
+ controls.setMargin(false);
+ controls.addComponent(new Label("width"));
+ controls.addComponent(new TextField(new MethodProperty<Float>(
+ testedLayout, "width")));
+ controls.addComponent(new CheckBox("%",
+ new MethodProperty<Boolean>(this, "widthPercents")));
+ controls.addComponent(new Label("height"));
+ controls.addComponent(new TextField(new MethodProperty<Float>(
+ testedLayout, "height")));
+ controls.addComponent(new CheckBox("%",
+ new MethodProperty<Boolean>(this, "heightPercents")));
+ controls.addComponent(marginLeft);
+ controls.addComponent(marginRight);
+ controls.addComponent(marginTop);
+ controls.addComponent(marginBottom);
+ if (testedLayout instanceof Layout.SpacingHandler) {
+ controls.addComponent(spacing);
+ }
+
+ Property.ValueChangeListener marginSpacingListener = new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ updateMarginsAndSpacing();
+ }
+ };
+
+ marginBottom.addListener(marginSpacingListener);
+ marginTop.addListener(marginSpacingListener);
+ marginLeft.addListener(marginSpacingListener);
+ marginRight.addListener(marginSpacingListener);
+ spacing.addListener(marginSpacingListener);
+ updateMarginsAndSpacing();
+
+ addAlignmentControls();
+
+ testedLayout.setStyleName("tested-layout");
+ setStyleName("layout-testing-panel");
+
+ for (Iterator<Component> i = controls.getComponentIterator(); i
+ .hasNext();) {
+ ((AbstractComponent) i.next()).setImmediate(true);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ private void addAlignmentControls() {
+ if (!(testedLayout instanceof Layout.AlignmentHandler)) {
+ return;
+ }
+ @SuppressWarnings("unused")
+ final Layout.AlignmentHandler ah = (AlignmentHandler) testedLayout;
+
+ final NativeSelect vAlign = new NativeSelect();
+ final NativeSelect hAlign = new NativeSelect();
+ controls.addComponent(new Label("component alignment"));
+ controls.addComponent(hAlign);
+ controls.addComponent(vAlign);
+ hAlign.setNullSelectionAllowed(false);
+ vAlign.setNullSelectionAllowed(false);
+
+ vAlign.addItem(new Integer(Bits.ALIGNMENT_TOP));
+ vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_TOP), "top");
+ vAlign.addItem(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER));
+ vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER),
+ "center");
+ vAlign.addItem(new Integer(Bits.ALIGNMENT_BOTTOM));
+ vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_BOTTOM), "bottom");
+
+ hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
+ hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
+ hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
+ hAlign.setItemCaption(
+ new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
+ hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
+ hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");
+
+ Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ Integer h = ((Integer) hAlign.getValue()).intValue();
+ int v = ((Integer) vAlign.getValue()).intValue();
+
+ updateAlignments(new Alignment(h + v));
+ }
+
+ };
+
+ hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT));
+ vAlign.addListener(alignmentChangeListener);
+ hAlign.addListener(alignmentChangeListener);
+ vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP));
+
+ controls.addComponent(new Label("layout alignment"));
+ final NativeSelect lAlign = new NativeSelect();
+ controls.addComponent(lAlign);
+ lAlign.setNullSelectionAllowed(false);
+ lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
+ lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
+ lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
+ lAlign.setItemCaption(
+ new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
+ lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
+ lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");
+
+ lAlign.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ testPanelLayout.setComponentAlignment(
+ testedLayout,
+ new Alignment(((Integer) lAlign.getValue())
+ .intValue() + Bits.ALIGNMENT_TOP));
+ }
+ });
+ }
+
+ private void updateAlignments(Alignment a) {
+ for (Iterator<Component> i = testedLayout.getComponentIterator(); i
+ .hasNext();) {
+ ((Layout.AlignmentHandler) testedLayout).setComponentAlignment(
+ i.next(), a);
+ }
+ }
+
+ private void updateMarginsAndSpacing() {
+ if (testedLayout instanceof Layout.MarginHandler) {
+ ((Layout.MarginHandler) testedLayout).setMargin(new MarginInfo(
+ marginTop.getValue().booleanValue(), marginRight
+ .getValue().booleanValue(), marginBottom
+ .getValue().booleanValue(), marginLeft
+ .getValue().booleanValue()));
+ }
+ if (testedLayout instanceof Layout.SpacingHandler) {
+ ((Layout.SpacingHandler) testedLayout).setSpacing(spacing
+ .getValue().booleanValue());
+ }
+ }
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java
new file mode 100644
index 0000000000..caf44865f9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.Resource;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1737 extends Application.LegacyApplication {
+
+ Resource slowRes = new ClassResource(Ticket1737.class, "m-bullet-blue.gif") {
+ @Override
+ public DownloadStream getStream() {
+ try {
+ Thread.sleep(4000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ return super.getStream();
+ }
+ };
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ VerticalLayout el = new VerticalLayout();
+ main.setContent(el);
+
+ Panel p = new Panel("Test panel");
+ p.setSizeFull();
+
+ p.addComponent(new Label(
+ "Second component is embedded with a slow resource "
+ + "and thus should break layout if Embedded cannot"
+ + " request re-layout after load."));
+
+ Embedded em = new Embedded("TestEmbedded", slowRes);
+
+ el.addComponent(p);
+ el.addComponent(em);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1767.java b/uitest/src/com/vaadin/tests/tickets/Ticket1767.java
new file mode 100644
index 0000000000..eca0c0f833
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1767.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1767 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ ComboBox cb = new ComboBox(" '<' item is not seen in populist?");
+ cb.addItem("Te<strong>st</strong> < jep >");
+ cb.addItem("<");
+ cb.addItem(">");
+
+ cb.addItem("< dsf");
+ cb.addItem("> sdf");
+
+ cb.addItem("dsfs <");
+ cb.addItem("sdfsd >");
+
+ main.addComponent(cb);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1772.java b/uitest/src/com/vaadin/tests/tickets/Ticket1772.java
new file mode 100644
index 0000000000..a269acc1e0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1772.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1772 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ Button b = new Button("Add content");
+ main.addComponent(b);
+
+ final GridLayout gridLayout = new GridLayout(2, 2);
+ main.addComponent(gridLayout);
+
+ b.addListener(new Button.ClickListener() {
+ int counter = 0;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+
+ gridLayout
+ .addComponent(new TextField("Content " + (++counter)));
+
+ }
+ });
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1775.java b/uitest/src/com/vaadin/tests/tickets/Ticket1775.java
new file mode 100644
index 0000000000..ec28a957bb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1775.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1775 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#1775");
+ setMainWindow(main);
+ setTheme("tests-tickets");
+ String layoutName = "Ticket1775";
+ final CustomLayout layout = new CustomLayout(layoutName);
+
+ main.addComponent(layout);
+
+ Button button2 = new Button("Populate content");
+ main.addComponent(button2);
+
+ final Button button = new Button("Change content");
+ main.addComponent(button);
+
+ button2.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Label mainComponent = new Label("Main");
+ Label header = new Label("Header");
+ final Label anotherComponent = new Label("another");
+ layout.addComponent(mainComponent, "body");
+ layout.addComponent(header, "loginUser");
+ button.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ layout.addComponent(anotherComponent, "body");
+ layout.removeComponent("loginUser");
+ }
+ });
+
+ }
+ });
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1804.java b/uitest/src/com/vaadin/tests/tickets/Ticket1804.java
new file mode 100644
index 0000000000..a77e6e843a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1804.java
@@ -0,0 +1,149 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import com.vaadin.data.Validator;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.server.SystemError;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.Window;
+
+public class Ticket1804 extends com.vaadin.Application.LegacyApplication {
+
+ LinkedList<Select> listOfAllFields = new LinkedList<Select>();
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#1804");
+ setMainWindow(main);
+
+ com.vaadin.ui.Select s;
+
+ s = new Select("Select with null selection allowed; required=true");
+ s.setNullSelectionAllowed(true);
+ s.setRequired(true);
+ listOfAllFields.add(s);
+
+ s = new Select("Select with null selection NOT allowed; required=true");
+ s.setNullSelectionAllowed(false);
+ s.setRequired(true);
+ listOfAllFields.add(s);
+
+ s = new Select("Testcase from the ticket #1804");
+ s.setNullSelectionAllowed(false);
+ s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
+ s.addValidator(new EmptyStringValidator(
+ "Selection required for test-field"));
+ s.setRequired(true);
+ listOfAllFields.add(s);
+
+ s = new Select("Testcase from the ticket #1804, but without validator");
+ s.setNullSelectionAllowed(false);
+ s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
+ s.setRequired(true);
+ listOfAllFields.add(s);
+
+ s = new Select(
+ "Testcase from the ticket #1804, but with required=false");
+ s.setNullSelectionAllowed(false);
+ s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
+ s.addValidator(new EmptyStringValidator(
+ "Selection required for test-field"));
+ listOfAllFields.add(s);
+
+ s = new Select(
+ "Testcase from the ticket #1804, but without validator and with required=false");
+ s.setNullSelectionAllowed(false);
+ s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
+ listOfAllFields.add(s);
+
+ s = new Select(
+ "Required=true, custom error message, null selection not allowed");
+ s.setRequired(true);
+ s.setNullSelectionAllowed(false);
+ s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id"));
+ s.setValue(null);
+ s.setComponentError(new SystemError("Test error message"));
+ listOfAllFields.add(s);
+
+ for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) {
+ s = i.next();
+ main.addComponent(s);
+ s.addItem("foo");
+ s.addItem("");
+ s.addItem("bar");
+ if (s.isNullSelectionAllowed()) {
+ s.addItem("<null>");
+ s.setNullSelectionItemId("<null>");
+ }
+ s.setImmediate(true);
+ }
+
+ Button checkValidity = new Button("Check validity of the fields");
+ main.addComponent(checkValidity);
+ checkValidity.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ StringBuffer msg = new StringBuffer();
+ for (Iterator<Select> i = listOfAllFields.iterator(); i
+ .hasNext();) {
+ AbstractField<?> af = i.next();
+ msg.append("<h1>" + af.getCaption() + "</h1>\n");
+ msg.append("Value=" + af.getValue() + "<br/>\n");
+ if (af.isValid()) {
+ msg.append("VALID\n<hr/>");
+ } else {
+ msg.append("INVALID<br/><i>" + af.getErrorMessage()
+ + "</i><hr/>");
+ }
+ }
+ Window w = new Window("Status of the fields");
+ w.setModal(true);
+ w.setHeight("80%");
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
+ main.addWindow(w);
+ }
+ });
+ }
+
+ public class TestPojo {
+ String id = "";
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ }
+
+ /** Throws an exception when the string is empty or null. */
+ static class EmptyStringValidator implements Validator {
+
+ String msg;
+
+ EmptyStringValidator(String msg) {
+ this.msg = msg;
+ }
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (value == null || value.toString().length() == 0) {
+ throw new InvalidValueException(msg);
+ }
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1805.java b/uitest/src/com/vaadin/tests/tickets/Ticket1805.java
new file mode 100644
index 0000000000..7f5c684479
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1805.java
@@ -0,0 +1,58 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1805 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+ ((MarginHandler) main.getContent()).setMargin(false);
+
+ Label description = new Label(
+ "GridLayout with 100% (no height), is wanted to "
+ + "share all available width with columns "
+ + "relatively to their natural width. And it "
+ + "should still work with margins and spacings");
+ main.addComponent(description);
+
+ final GridLayout grid = new GridLayout(4, 1);
+
+ final TextField size = new TextField("Grid width in css unit");
+ size.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ String width = size.getValue().toString();
+ if (width == null || width.equals("")) {
+ grid.setSizeUndefined();
+ } else {
+ grid.setWidth(width);
+ }
+ }
+ });
+ main.addComponent(size);
+ main.addComponent(new Button("set size"));
+
+ grid.setMargin(true);
+ grid.setSpacing(true);
+
+ grid.addComponent(new Label("WIDE"));
+ grid.addComponent(new Label("_I_"));
+ grid.addComponent(new Label("VEEEEEEEEEEERY_WIDE"));
+ Label label = new Label("|");
+ grid.addComponent(label);
+ grid.setComponentAlignment(label, Alignment.TOP_RIGHT);
+ main.addComponent(grid);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java
new file mode 100644
index 0000000000..8359b024aa
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1806 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ final ObjectProperty<String> prop = new ObjectProperty<String>("");
+ final TextField tf1 = new TextField(
+ "Buffered TextField bound to ObjectProperty");
+ tf1.setBuffered(true);
+ tf1.setPropertyDataSource(prop);
+ main.addComponent(tf1);
+ main.addComponent(new Button(
+ "This button does nothing (but flushes queued variable changes)"));
+ main.addComponent(new Button("Commit the field to property",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ tf1.commit();
+ }
+ }));
+ main.addComponent(new Button("Show property value",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ main.showNotification("'" + prop.getValue() + "'");
+ }
+ }));
+ main.addComponent(new Button("Show field value",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ main.showNotification("'" + tf1.getValue() + "'");
+ }
+ }));
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1811.java b/uitest/src/com/vaadin/tests/tickets/Ticket1811.java
new file mode 100644
index 0000000000..824c58436f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1811.java
@@ -0,0 +1,81 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import com.vaadin.data.Validator;
+import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Window;
+
+public class Ticket1811 extends com.vaadin.Application.LegacyApplication {
+
+ LinkedList<TextField> listOfAllFields = new LinkedList<TextField>();
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#1811");
+ setMainWindow(main);
+
+ Validator strLenValidator = new StringLengthValidator(
+ "String must be at least 3 chars long and non-null", 3, -1,
+ false);
+
+ TextField tf1 = new TextField(
+ "Text field with default settings (required=false)");
+ listOfAllFields.add(tf1);
+
+ TextField tf2 = new TextField("Text field with required=true");
+ tf2.setRequired(true);
+ listOfAllFields.add(tf2);
+
+ TextField tf3 = new TextField(
+ "Text field with required=true and strlen >= 3");
+ tf3.setRequired(true);
+ tf3.addValidator(strLenValidator);
+ listOfAllFields.add(tf3);
+
+ TextField tf4 = new TextField(
+ "Text field with required=false (default) and strlen >= 3");
+ tf4.addValidator(strLenValidator);
+ listOfAllFields.add(tf4);
+
+ for (Iterator<TextField> i = listOfAllFields.iterator(); i.hasNext();) {
+ TextField tf = i.next();
+ main.addComponent(tf);
+ tf.setImmediate(true);
+ }
+
+ Button checkValidity = new Button("Check validity of the fields");
+ main.addComponent(checkValidity);
+ checkValidity.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ StringBuffer msg = new StringBuffer();
+ for (Iterator<TextField> i = listOfAllFields.iterator(); i
+ .hasNext();) {
+ TextField tf = i.next();
+ msg.append("<h1>" + tf.getCaption() + "</h1>\n");
+ if (tf.isValid()) {
+ msg.append("VALID\n<hr/>");
+ } else {
+ msg.append("INVALID<br/><i>" + tf.getErrorMessage()
+ + "</i><hr/>");
+ }
+ }
+ Window w = new Window("Status of the fields");
+ w.setModal(true);
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
+ main.addWindow(w);
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1819.java b/uitest/src/com/vaadin/tests/tickets/Ticket1819.java
new file mode 100644
index 0000000000..e16b2c2774
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1819.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.Window;
+
+public class Ticket1819 extends com.vaadin.Application.LegacyApplication {
+
+ LinkedList<Select> listOfAllFields = new LinkedList<Select>();
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#1819");
+ setMainWindow(main);
+
+ com.vaadin.ui.Select s;
+
+ s = new Select("Select with null selection allowed");
+ s.setNullSelectionAllowed(true);
+ listOfAllFields.add(s);
+
+ s = new Select("Select with null selection NOT allowed");
+ s.setNullSelectionAllowed(false);
+ listOfAllFields.add(s);
+
+ for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) {
+ s = i.next();
+ main.addComponent(s);
+ s.addItem("-null-");
+ s.addItem("");
+ s.addItem("foo");
+ s.addItem("bar");
+ s.setNullSelectionItemId("-null-");
+ s.setImmediate(true);
+ }
+
+ Button checkValidity = new Button("Check validity of the fields");
+ main.addComponent(checkValidity);
+ checkValidity.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ StringBuffer msg = new StringBuffer();
+ for (Iterator<Select> i = listOfAllFields.iterator(); i
+ .hasNext();) {
+ AbstractField<?> af = i.next();
+ msg.append("<h1>" + af.getCaption() + "</h1>\n");
+ msg.append("Value=" + af.getValue() + "<br/>\n");
+ }
+ Window w = new Window("Status of the fields");
+ w.setModal(true);
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
+ main.addWindow(w);
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
new file mode 100644
index 0000000000..f7329037cc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
@@ -0,0 +1,93 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1834PanelScrolling extends
+ com.vaadin.Application.LegacyApplication {
+
+ private static final int ROWS = 50;
+
+ private Label state = new Label("State");
+
+ private Panel p;
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ HorizontalLayout currentState = new HorizontalLayout();
+
+ currentState.addComponent(state);
+ Button b = new Button("update");
+ currentState.addComponent(b);
+ b.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ state.setValue("ScrollTop: " + p.getScrollTop()
+ + " ScrollLeft: " + p.getScrollLeft());
+ }
+ });
+ main.addComponent(currentState);
+
+ b = new Button("ScrollBy 50px");
+ b.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ p.setScrollLeft(p.getScrollLeft() + 50);
+ p.setScrollTop(p.getScrollTop() + 50);
+ state.setValue("ScrollTop: " + p.getScrollTop()
+ + " ScrollLeft: " + p.getScrollLeft());
+ }
+ });
+
+ main.addComponent(b);
+
+ b = new Button("Add row");
+ b.addListener(new ClickListener() {
+ int i = 0;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ p.addComponent(new Label("new Row" + ++i));
+ }
+ });
+
+ main.addComponent(b);
+
+ b = new Button("Repaint Panel");
+ b.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ p.markAsDirty();
+ }
+ });
+
+ main.addComponent(b);
+
+ p = new Panel("TestPanel");
+
+ for (int i = 0; i < ROWS; i++) {
+ p.addComponent(new Label(
+ "Label"
+ + i
+ + "................................................................................................................."));
+ }
+
+ p.setHeight("300px");
+ p.setWidth("250px");
+
+ p.setScrollTop(100);
+ p.setScrollLeft(100);
+
+ main.addComponent(p);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java
new file mode 100644
index 0000000000..039f867fff
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java
@@ -0,0 +1,115 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1857 extends Application.LegacyApplication implements
+ Handler {
+
+ @Override
+ public void init() {
+
+ setTheme("tests-tickets");
+
+ VerticalLayout el = new VerticalLayout();
+ LegacyWindow main = new LegacyWindow("Testcase for #1857", el);
+ setMainWindow(main);
+ el.setMargin(true);
+ el.setSpacing(true);
+
+ final Table t = new Table();
+ el.addComponent(t);
+ el.setExpandRatio(t, 1);
+ t.setSizeFull();
+ addContentsToTable(t);
+ t.setStyleName("foo");
+
+ HorizontalLayout footer = new HorizontalLayout();
+ el.addComponent(footer);
+ footer.setSpacing(true);
+
+ final CheckBox actionHandlerEnabler = new CheckBox("Action handlers",
+ false);
+ footer.addComponent(actionHandlerEnabler);
+ actionHandlerEnabler.setImmediate(true);
+ actionHandlerEnabler.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (actionHandlerEnabler.getValue().booleanValue()) {
+ t.addActionHandler(Ticket1857.this);
+ } else {
+ t.removeActionHandler(Ticket1857.this);
+ }
+ }
+ });
+
+ final CheckBox cellStylesEnabler = new CheckBox("Cell styles", false);
+ footer.addComponent(cellStylesEnabler);
+ cellStylesEnabler.setImmediate(true);
+ cellStylesEnabler.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (cellStylesEnabler.getValue().booleanValue()) {
+ t.setCellStyleGenerator(new Table.CellStyleGenerator() {
+ @Override
+ public String getStyle(Object itemId, Object propertyId) {
+ Object cell = t.getContainerProperty(itemId,
+ propertyId).getValue();
+ if (!(cell instanceof Integer)) {
+ return null;
+ }
+ int age = ((Integer) cell).intValue();
+ return age > 65 ? "old" : (age < 18 ? "young"
+ : null);
+ }
+ });
+ } else {
+ t.setCellStyleGenerator(null);
+ }
+ }
+ });
+ cellStylesEnabler.setValue(Boolean.TRUE);
+
+ }
+
+ private void addContentsToTable(Table t) {
+
+ t.addContainerProperty("First name", String.class, "");
+ t.addContainerProperty("Last name", String.class, "");
+ t.addContainerProperty("Age", Integer.class, "");
+
+ String firstNames[] = { "Quentin", "Marc", "Peter", "David", "Mary",
+ "Jani", "Jane", "Brita" };
+ String lastNames[] = { "Heiskanen", "Bjorn", "Torwalds", "Autere",
+ "Smith", "Lindström" };
+
+ for (int i = 0; i < 1000; i++) {
+ t.addItem(new Object[] {
+ firstNames[((int) (Math.random() * firstNames.length))],
+ lastNames[((int) (Math.random() * lastNames.length))],
+ new Integer((int) (Math.random() * 100) + 10) },
+ new Integer(i));
+ }
+ }
+
+ private final Action removeAction = new Action("Remove");
+
+ @Override
+ public Action[] getActions(Object target, Object sender) {
+ return new Action[] { removeAction };
+ }
+
+ @Override
+ public void handleAction(Action action, Object sender, Object target) {
+ getMainWindow().showNotification("Removing row number:" + target);
+ ((Table) sender).removeItem(target);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java
new file mode 100644
index 0000000000..8bd4a77204
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java
@@ -0,0 +1,20 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1868 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ setMainWindow(new LegacyWindow("#1868"));
+
+ Panel p = new Panel(
+ "This is a really long caption for the panel, too long in fact!");
+ p.setWidth("300px");
+ p.setHeight("300px");
+
+ getMainWindow().addComponent(p);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1869.java b/uitest/src/com/vaadin/tests/tickets/Ticket1869.java
new file mode 100644
index 0000000000..741adecae4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1869.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1869 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ GridLayout lo = new GridLayout(2, 1);
+ setMainWindow(new LegacyWindow("#1869", lo));
+ lo.setMargin(true);
+ lo.setSpacing(true);
+
+ VerticalLayout el = new VerticalLayout();
+ Panel elp = new Panel(
+ "Vertical ExpandLayout /w first component expanded", el);
+ el.setHeight("1000px");
+ for (int i = 0; i < 3; i++) {
+ Button b = new Button("x");
+ el.addComponent(b);
+ if (i == 0) {
+ b.setSizeFull();
+ el.setExpandRatio(b, 1);
+ }
+ }
+ lo.addComponent(elp);
+ elp.setWidth("300px");
+ elp.setHeight("300px");
+
+ HorizontalLayout elh = new HorizontalLayout();
+ Panel elph = new Panel(
+ "Horizontal ExpandLayout /w first component expanded", elh);
+ elh.setWidth("1000px");
+ for (int i = 0; i < 3; i++) {
+ Button b = new Button("x");
+ elh.addComponent(b);
+ if (i == 0) {
+ b.setSizeFull();
+ elh.setExpandRatio(b, 1);
+ }
+ }
+ lo.addComponent(elph);
+ elph.setWidth("300px");
+ elph.setHeight("300px");
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1878.java b/uitest/src/com/vaadin/tests/tickets/Ticket1878.java
new file mode 100644
index 0000000000..90a96ba0f1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1878.java
@@ -0,0 +1,387 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Random;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1878 extends Application.LegacyApplication {
+
+ private Layout orderedLayout;
+ private Layout gridLayout;
+ private Layout formLayout;
+ private GridLayout mainLayout;
+ private Button switchToGridButton;
+ private Button switchToOrderedButton;
+ private Button switchToFormsButton;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+
+ mainLayout = new GridLayout(1, 2);
+ w.setContent(mainLayout);
+ orderedLayout = createOL();
+ gridLayout = createGL();
+ formLayout = createForms();
+
+ switchToGridButton = new Button("Switch to GridLayout",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ changeLayout(switchToGridButton, gridLayout);
+ }
+
+ });
+ switchToOrderedButton = new Button("Switch to OrderedLayout",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ changeLayout(switchToOrderedButton, orderedLayout);
+ }
+
+ });
+ switchToOrderedButton.setEnabled(false);
+
+ switchToFormsButton = new Button("Switch to Form", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ changeLayout(switchToFormsButton, formLayout);
+ }
+
+ });
+
+ HorizontalLayout buttonLayout = new HorizontalLayout();
+ buttonLayout.addComponent(switchToOrderedButton);
+ buttonLayout.addComponent(switchToGridButton);
+ buttonLayout.addComponent(switchToFormsButton);
+
+ mainLayout.addComponent(buttonLayout);
+ mainLayout.addComponent(orderedLayout);
+ // w.setContent(orderedLayout);
+ }
+
+ private static Layout createOL() {
+ GridLayout layout = new GridLayout(1, 5);
+
+ GridLayout l1 = new GridLayout(1, 3);
+ createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%",
+ null, true);
+ createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px",
+ null, false);
+ GridLayout l2 = new GridLayout(6, 1);
+ createLayout(l2, new VerticalLayout(), "200px", "500px", true);
+ createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null,
+ true);
+ createLayout(l2, new VerticalLayout(), "150px", "500px", true);
+ createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null,
+ true);
+ createLayout(l2, new VerticalLayout(), "100px", "500px", true);
+ createLayout(l2, new VerticalLayout(), "100px", "500px", "100%", null,
+ true);
+ layout.addComponent(l1);
+ layout.addComponent(l2);
+
+ return layout;
+ }
+
+ private static Layout createGL() {
+ GridLayout layout = new GridLayout(1, 5);
+
+ GridLayout l1 = new GridLayout(1, 3);
+ createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null,
+ true);
+ createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null,
+ false);
+ GridLayout l2 = new GridLayout(6, 1);
+ createLayout(l2, new GridLayout(1, 8), "200px", "500px", true);
+ createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null,
+ true);
+ createLayout(l2, new GridLayout(1, 8), "150px", "500px", true);
+ createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null,
+ true);
+ createLayout(l2, new GridLayout(1, 8), "100px", "500px", true);
+ createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null,
+ true);
+ layout.addComponent(l1);
+ layout.addComponent(l2);
+
+ return layout;
+ }
+
+ public class FormObject {
+ private String stringValue = "abc";
+ private int intValue = 1;
+ private long longValue = 2L;
+ private Date dateValue = new Date(34587034750L);
+
+ public String getStringValue() {
+ return stringValue;
+ }
+
+ public void setStringValue(String stringValue) {
+ this.stringValue = stringValue;
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public long getLongValue() {
+ return longValue;
+ }
+
+ public void setLongValue(long longValue) {
+ this.longValue = longValue;
+ }
+
+ public Date getDateValue() {
+ return dateValue;
+ }
+
+ public void setDateValue(Date dateValue) {
+ this.dateValue = dateValue;
+ }
+
+ }
+
+ private Layout createForms() {
+ GridLayout layout = new GridLayout(1, 5);
+ Form form;
+
+ Random r = new Random();
+ GridLayout l1 = new GridLayout(1, 3);
+ form = createForm(l1, "200px", "500px");
+ BeanItem<FormObject> item = new BeanItem<FormObject>(new FormObject());
+ form.setItemDataSource(item);
+ for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) {
+ Object property = i.next();
+ Field<?> f = form.getField(property);
+
+ f.setRequired(r.nextBoolean());
+ if (r.nextBoolean()) {
+ f.setIcon(new ThemeResource("icons/16/document-add.png"));
+ }
+ if (r.nextBoolean()) {
+ f.setCaption(null);
+ }
+
+ f.addValidator(new StringLengthValidator("Error", 10, 8, false));
+ }
+ // createLayout(l1, new
+ // ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL),
+ // "1000px", "150px", "50px", null, false);
+
+ // GridLayout l2 = new GridLayout(6, 1);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "200px", "500px", true);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "200px", "500px", "100%", null, true);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "150px", "500px", true);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "150px", "500px", "100%", null, true);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "100px", "500px", true);
+ // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),
+ // "100px", "500px", "100%", null, true);
+ layout.addComponent(l1);
+ // layout.addComponent(l2);
+
+ return layout;
+ }
+
+ private Form createForm(GridLayout parentLayout, String w, String h) {
+ FormLayout formLayout = new FormLayout();
+ Form form = new Form(formLayout);
+
+ Panel p = new Panel("Form " + w + "x" + h);
+
+ p.setWidth(w);
+ p.setHeight(h);
+
+ p.getContent().setSizeFull();
+
+ parentLayout.addComponent(p);
+ p.addComponent(form);
+ formLayout.setSizeFull();
+
+ return form;
+ }
+
+ protected void changeLayout(Button b, Layout newLayout) {
+ switchToOrderedButton.setEnabled(true);
+ switchToGridButton.setEnabled(true);
+ switchToFormsButton.setEnabled(true);
+
+ b.setEnabled(false);
+ Iterator<Component> i = mainLayout.getComponentIterator();
+ i.next();
+ Layout l = (Layout) i.next();
+
+ mainLayout.replaceComponent(l, newLayout);
+ }
+
+ private static void createLayout(GridLayout parentLayout, Layout newLayout,
+ String w, String h, boolean align) {
+ createLayout(parentLayout, newLayout, w, h, null, null, align);
+ }
+
+ private static void createLayout(GridLayout parentLayout, Layout newLayout,
+ String w, String h, String componentWidth, String componentHeight,
+ boolean align) {
+ String dirText = "V";
+ String type;
+ if (newLayout instanceof VerticalLayout) {
+ type = "OL";
+ } else if (newLayout instanceof HorizontalLayout) {
+ dirText = "H";
+ type = "OL";
+ } else {
+ if (((GridLayout) newLayout).getColumns() != 1) {
+ dirText = "H";
+ }
+ type = "GL";
+ }
+ String alignText = align ? "-A" : "";
+ String cWidth = componentWidth == null ? "" : " - " + componentWidth;
+ Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x"
+ + h + cWidth, newLayout);
+
+ p.setWidth(w);
+ p.setHeight(h);
+
+ newLayout.setSizeFull();
+
+ String captions[] = new String[] { "TextField with caption", null };
+ Resource icons[] = new Resource[] {
+ new ThemeResource("icons/16/document-delete.png"), null };
+ boolean required[] = new boolean[] { true, false };
+ TextField fields[][] = new TextField[captions.length][icons.length];
+ for (int caption = 0; caption < captions.length; caption++) {
+ for (int icon = 0; icon < icons.length; icon++) {
+ for (int req = 0; req < required.length; req++) {
+ TextField tf = createTextFieldWithError(captions[caption],
+ icons[icon], required[req]);
+
+ fields[caption][icon] = tf;
+ if (componentWidth != null) {
+ tf.setWidth(componentWidth);
+ tf.setValue(tf.getValue() + " w:" + componentWidth);
+ }
+
+ if (componentHeight != null) {
+ tf.setHeight(componentWidth);
+ tf.setValue(tf.getValue() + " h:" + componentHeight);
+ }
+
+ p.addComponent(tf);
+
+ if (align) {
+ ((AlignmentHandler) newLayout).setComponentAlignment(
+ tf, Alignment.BOTTOM_RIGHT);
+ }
+ }
+ }
+ }
+
+ parentLayout.addComponent(p);
+
+ }
+
+ // private static void createGridLayout(GridLayout parentLayout, int dir,
+ // String w, String h) {
+ // createGridLayout(parentLayout, dir, w, h, null, null);
+ // }
+
+ // private static void createGridLayout(GridLayout parentLayout, int dir,
+ // String w, String h, String componentWidth, String componentHeight) {
+ // GridLayout gl;
+ // if (dir == OrderedLayout.ORIENTATION_HORIZONTAL) {
+ // gl = new GridLayout(8, 1);
+ // } else {
+ // gl = new GridLayout(1, 8);
+ // }
+ //
+ // String dirText = (dir == OrderedLayout.ORIENTATION_HORIZONTAL ? "H"
+ // : "V");
+ // String cWidth = componentWidth == null ? "" : " - " + componentWidth;
+ // Panel p = new Panel("GL/" + dirText + " " + w + "x" + h + cWidth, gl);
+ //
+ // p.setWidth(w);
+ // p.setHeight(h);
+ //
+ // gl.setSizeFull();
+ //
+ // String captions[] = new String[] { "TextField with caption", null };
+ // Resource icons[] = new Resource[] {
+ // new ThemeResource("icons/16/document-delete.png"), null };
+ // boolean required[] = new boolean[] { true, false };
+ // TextField fields[][] = new TextField[captions.length][icons.length];
+ // for (int caption = 0; caption < captions.length; caption++) {
+ // for (int icon = 0; icon < icons.length; icon++) {
+ // for (int req = 0; req < required.length; req++) {
+ // TextField tf = createTextFieldWithError(captions[caption],
+ // icons[icon], required[req]);
+ //
+ // fields[caption][icon] = tf;
+ // if (componentWidth != null) {
+ // tf.setWidth(componentWidth);
+ // }
+ //
+ // if (componentHeight != null) {
+ // tf.setHeight(componentWidth);
+ // }
+ //
+ // p.addComponent(tf);
+ // gl.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT,
+ // OrderedLayout.ALIGNMENT_BOTTOM);
+ // }
+ // }
+ // }
+ //
+ // parentLayout.addComponent(p);
+ //
+ // }
+
+ private static TextField createTextFieldWithError(String caption,
+ Resource icon, boolean required) {
+ TextField tf = new TextField();
+ tf.setCaption(caption);
+ tf.setIcon(icon);
+ tf.setRequired(required);
+ tf.setComponentError(new UserError("Test error message"));
+ return tf;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1900.java b/uitest/src/com/vaadin/tests/tickets/Ticket1900.java
new file mode 100644
index 0000000000..136af23474
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1900.java
@@ -0,0 +1,74 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Validator;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1900 extends Application.LegacyApplication {
+
+ TextField f[] = new TextField[5];
+ LegacyWindow main = new LegacyWindow("#1900 test");
+
+ @Override
+ public void init() {
+
+ setMainWindow(main);
+
+ for (int i = 0; i < 5; i++) {
+ final int j = i;
+ f[i] = new TextField("Testcase " + i);
+ f[i].setImmediate(true);
+ f[i].setRequired(true);
+ main.addComponent(f[i]);
+ f[i].addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ main.showNotification("Validity test", "Testcase " + j
+ + " is " + (f[j].isValid() ? "valid" : "invalid"));
+ }
+ });
+ f[i].addValidator(new ContainsValidator("1"));
+ f[i].addValidator(new ContainsValidator("2"));
+
+ }
+
+ f[0].setDescription("Field is empty, requiredError(null): *");
+
+ f[1].setDescription("Field is empty, requiredError(\"foo\"): * (popup shows the validation error)");
+ f[1].setRequiredError("The field must not be empty");
+
+ f[2].setDescription("Field is non-empty, validators do not give validation error: *");
+ f[2].setValue("valid 12");
+
+ f[3].setDescription("Field is non-empty, requiredError(null), validators "
+ + "give validation error: * ! (popup shows the validation error)");
+ f[3].setValue("invalid");
+
+ f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators "
+ + "give validation error: * ! (popup shows the validation error)");
+ f[4].setValue("invalid");
+ f[4].setRequiredError("The field must not be empty");
+
+ }
+
+ static class ContainsValidator implements Validator {
+ private final String c;
+
+ public ContainsValidator(String c) {
+ this.c = c;
+ }
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (value == null || !value.toString().contains(c)) {
+ throw new InvalidValueException("Value does not contain " + c);
+ }
+
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1904.java b/uitest/src/com/vaadin/tests/tickets/Ticket1904.java
new file mode 100644
index 0000000000..f35463f6a8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1904.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1904 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow("#1904"));
+ setTheme("tests-tickets");
+
+ addOL("defaults", null, false);
+ addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", false);
+ addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", true);
+ }
+
+ private void addOL(String descr, String style, boolean horizontal) {
+ AbstractOrderedLayout ol;
+ if (horizontal) {
+ ol = new HorizontalLayout();
+ } else {
+ ol = new VerticalLayout();
+ }
+ ol.setMargin(true);
+ ol.setSpacing(true);
+ if (style != null) {
+ ol.setStyleName(style);
+ }
+ ol.addComponent(new Label(descr));
+ for (int i = 0; i < 3; i++) {
+ Button b = new Button("Row " + (i + 1));
+ if (!horizontal) {
+ b.setWidth("500px");
+ }
+ ol.addComponent(b);
+ }
+ getMainWindow().addComponent(ol);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1916.java b/uitest/src/com/vaadin/tests/tickets/Ticket1916.java
new file mode 100644
index 0000000000..92102426ca
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1916.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket1916 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ HorizontalLayout test = new HorizontalLayout();
+ test.setSizeFull();
+
+ TextField tf = new TextField();
+ tf.setComponentError(new UserError("Error message"));
+
+ test.addComponent(tf);
+ test.setComponentAlignment(tf, Alignment.MIDDLE_CENTER);
+
+ LegacyWindow w = new LegacyWindow("Test #1916", test);
+ setMainWindow(w);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1919.java b/uitest/src/com/vaadin/tests/tickets/Ticket1919.java
new file mode 100644
index 0000000000..8e9e0cb0ba
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1919.java
@@ -0,0 +1,59 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1919 extends com.vaadin.Application.LegacyApplication {
+
+ private GridLayout lo;
+ private boolean on = true;
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ setTheme("tests-tickets");
+
+ lo = new GridLayout(2, 2);
+ lo.setSizeFull();
+ lo.setMargin(true);
+ lo.setSpacing(true);
+
+ lo.addComponent(getTestComponent());
+ lo.addComponent(getTestComponent());
+ lo.addComponent(getTestComponent());
+ lo.addComponent(getTestComponent());
+
+ main.setContent(lo);
+
+ }
+
+ public void toggleStyleName() {
+ if (on) {
+ lo.setStyleName("test");
+ } else {
+ lo.setStyleName("");
+ }
+ on = !on;
+ }
+
+ private Component getTestComponent() {
+ Panel p = new Panel();
+ p.setSizeFull();
+
+ Button b = new Button("toggle Values", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggleStyleName();
+ }
+ });
+ p.addComponent(b);
+ return p;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java
new file mode 100644
index 0000000000..ac5f990915
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java
@@ -0,0 +1,124 @@
+package com.vaadin.tests.tickets;
+
+import java.io.IOException;
+import java.util.Map;
+
+import com.vaadin.Application;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1921 extends Application.LegacyApplication implements
+ RequestHandler {
+
+ int state = -1;
+ int round = 1;
+ Button button;
+ VerticalLayout outer, inner;
+
+ @Override
+ public void init() {
+
+ outer = new VerticalLayout();
+ setMainWindow(new LegacyWindow("#1921", outer));
+ setTheme("tests-tickets");
+ inner = new VerticalLayout();
+ outer.addComponent(inner);
+ button = new Button("foo", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ newState();
+ }
+ });
+ inner.addComponent(button);
+
+ outer.setStyleName("red");
+ inner.setStyleName("blue");
+
+ newState();
+
+ addRequestHandler(this);
+ }
+
+ public void newState() {
+
+ if (state >= 6) {
+ state = 0;
+ round++;
+ } else {
+ state++;
+ }
+
+ button.setCaption("state " + round + "." + state);
+
+ switch (state) {
+
+ case 0:
+ outer.setMargin(true);
+ inner.setMargin(true);
+ inner.setSizeFull();
+ outer.setSizeFull();
+ button.setSizeFull();
+ break;
+
+ case 1:
+ button.setSizeUndefined();
+ break;
+
+ case 2:
+ inner.setMargin(false);
+ break;
+
+ case 3:
+ outer.setMargin(false);
+ break;
+
+ case 4:
+ inner.setMargin(true);
+ break;
+
+ case 5:
+ inner.addComponent(new Label("Added at " + button.getCaption()));
+ break;
+
+ case 6:
+ outer.addComponent(new Label("Added at " + button.getCaption()));
+ break;
+
+ }
+ }
+
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ Map<String, String[]> parameters = request.getParameterMap();
+ String[] s = parameters.get("state");
+ if (s == null || s.length != 1) {
+ return false;
+ }
+ String v[] = s[0].split("\\.");
+ if (v == null || v.length != 2) {
+ return false;
+ }
+ try {
+ int rr = Integer.parseInt(v[0]);
+ int rs = Integer.parseInt(v[1]);
+ if (rr < round || (rr == round && rs < state)) {
+ getMainWindow().showNotification(
+ "Already past requested " + s[0]);
+ return false;
+ }
+ while (round < rr || state < rs) {
+ newState();
+ }
+ } catch (NumberFormatException ignored) {
+ }
+ return false;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java
new file mode 100644
index 0000000000..2bde4c95ec
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java
@@ -0,0 +1,79 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1923 extends com.vaadin.Application.LegacyApplication {
+
+ private static final int ROWS = 50;
+
+ private Panel p;
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ p = new Panel("TestPanel 250x300");
+ // p.getLayout().setWidth("100%");
+ // p.setContent(new GridLayout(1, 100));
+ for (int i = 0; i < ROWS; i++) {
+ p.addComponent(new Label(
+ "Label"
+ + i
+ + " 5067w09adsfasdjfahlsdfjhalfjhaldjfhalsjdfhlajdhflajhdfljahdslfjahldsjfhaljdfhaljfdhlajsdhflajshdflkajhsdlfkjahsldfkjahsldfhalskjfdhlksjfdh857idifhaljsdfhlajsdhflajhdflajhdfljahldfjhaljdfhalsjdfhalkjdhflkajhdfljahsdlfjahlsdjfhaldjfhaljfdhlajdhflajshdfljahsdlfjhalsjdfhalskjhfdlhusfglksuhdflgjshflgjhslfghslfjghsljfglsjhfglsjhfgljshfgljshflgjhslfghsljfgsljdfglsdjhfglsjhflgkjshfldjgh"));
+ }
+ // main.getLayout().setSizeFull();
+
+ p.setHeight("300px");
+ p.setWidth("250px");
+ // p.setWidth("50%");
+
+ p.setScrollTop(100);
+ p.setScrollLeft(100);
+
+ main.addComponent(p);
+
+ VerticalLayout ol = new VerticalLayout();
+ p = new Panel("a");
+ p.addComponent(new Label("Longer than caption"));
+ ol.addComponent(p);
+
+ main.addComponent(ol);
+
+ ol = new VerticalLayout();
+ p = new Panel("captionasdfjahsdjfh this should be clipped god damn it");
+ // p.getLayout().setSizeFull();
+ p.setWidth("50px");
+ p.setHeight("100px");
+ p.addComponent(new Label(
+ "aasdfaasdfja dslkfj lakfdj lakjdf lkaj dflkaj ldfkj alsdfj laksdj flkajs dflkj sdfsadfasdfasd"));
+ ol.addComponent(p);
+
+ main.addComponent(ol);
+
+ ol = new VerticalLayout();
+ p = new Panel("300x-1");
+ // p.getLayout().setSizeFull();
+ p.setWidth("300px");
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ p.addComponent(new Label("Short"));
+ ol.addComponent(p);
+
+ main.addComponent(ol);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1925.java b/uitest/src/com/vaadin/tests/tickets/Ticket1925.java
new file mode 100644
index 0000000000..b5d938dbed
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1925.java
@@ -0,0 +1,15 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1925 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow mainWindow = new LegacyWindow("Test åäö");
+ setMainWindow(mainWindow);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1939.java b/uitest/src/com/vaadin/tests/tickets/Ticket1939.java
new file mode 100644
index 0000000000..f65fbf9852
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1939.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1939 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ final VerticalLayout l = new VerticalLayout();
+ l.setWidth("400px");
+ l.setHeight("100px");
+ l.addComponent(new TextField("This one works fine"));
+ TextField t = new TextField();
+ t.setRequired(true);
+ t.setValue("This one bugs");
+ l.addComponent(t);
+ w.addComponent(l);
+
+ w.addComponent(new Button("show me the bug",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ l.setWidth(null);
+ }
+ }));
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1940.java b/uitest/src/com/vaadin/tests/tickets/Ticket1940.java
new file mode 100644
index 0000000000..1a27e1ad28
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1940.java
@@ -0,0 +1,25 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1940 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ final VerticalLayout l = new VerticalLayout();
+ l.setWidth("200px");
+ l.setHeight(null);
+ TextField t = new TextField();
+ l.addComponent(t);
+ t.setRequired(true);
+ w.addComponent(l);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java
new file mode 100644
index 0000000000..9bf4ddee51
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java
@@ -0,0 +1,114 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1953 extends Application.LegacyApplication {
+ public static final String cellStyle = "test-cell";
+ public static final String colHeadStyle = "test-col-head";
+ public static final String headingStyle = "test-heading";
+ public static final String spacerStyle = "test-spacer";
+ public static final String pageButtonStyle = "test-page-change";
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ setTheme("tests-tickets");
+ GridLayout gl = new GridLayout(5, 5);
+
+ gl.setStyleName("borders");
+
+ gl.addComponent(new Label("0,0"), 0, 0);
+ gl.addComponent(new Label("0,1"), 0, 1);
+ gl.addComponent(new Label("0,2"), 0, 2);
+ gl.addComponent(new Label("0,3"), 0, 3);
+ gl.addComponent(new Label("0,4"), 0, 4);
+ gl.addComponent(new Label("1,0"), 1, 0);
+ gl.addComponent(new Label("2,0"), 2, 0);
+ gl.addComponent(new Label("3,0"), 3, 0);
+ gl.addComponent(new Label("4,0"), 4, 0);
+
+ gl.addComponent(new Label("1,4"), 1, 4);
+ gl.addComponent(new Label("2,4"), 2, 4);
+ gl.addComponent(new Label("3,4"), 3, 4);
+ gl.addComponent(new Label("4,4"), 4, 4);
+
+ gl.addComponent(new Label("1-1 -> 2-2"), 1, 1, 2, 2);
+ gl.addComponent(new Label("3,1"), 3, 1);
+ gl.addComponent(new Label("3,2"), 3, 2);
+ gl.addComponent(new Label("3,3"), 3, 3);
+
+ main.addComponent(gl);
+
+ // create grid
+ GridLayout grid = new GridLayout(7, 7);
+
+ grid.setStyleName("borders");
+
+ // add upper row
+ Button up = new Button("UP");
+
+ up.setStyleName(pageButtonStyle);
+ grid.addComponent(up, 0, 0);
+
+ Label space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, 1, 0);
+
+ Button single = null;
+ String headingStyle = "foo";
+ for (int i = 1; i < grid.getColumns() - 2; i++) {
+ single = new Button(Integer.toString(i));
+ single.setStyleName(headingStyle);
+ grid.addComponent(single, i + 1, 0);
+ }
+
+ space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, grid.getColumns() - 1, 0);
+
+ // middle rows
+ char rowChar = 'A';
+ for (int i = 1; i < grid.getRows() - 1; i++) {
+ space = new Label(Character.toString(rowChar++));
+ space.setStyleName(colHeadStyle);
+ grid.addComponent(space, 0, i);
+
+ space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, 1, i);
+
+ space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, grid.getColumns() - 1, i);
+ }
+
+ // bottom row
+ Button dn = new Button("DOWN");
+ dn.setStyleName(pageButtonStyle);
+ grid.addComponent(dn, 0, grid.getRows() - 1);
+
+ space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, 1, grid.getRows() - 1);
+
+ for (int i = 1; i < grid.getColumns() - 2; i++) {
+ single = new Button(Integer.toString(i));
+ single.setStyleName(headingStyle);
+ grid.addComponent(single, i + 1, grid.getRows() - 1);
+ }
+
+ space = new Label();
+ space.setStyleName(spacerStyle);
+ grid.addComponent(space, grid.getColumns() - 1, grid.getRows() - 1);
+
+ main.addComponent(grid);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966.java
new file mode 100644
index 0000000000..9440855bbe
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1966.java
@@ -0,0 +1,111 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1966 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ w.setContent(new GridLayout(2, 2));
+ // w.getLayout().setSizeFull();
+ createUI((Layout) w.getContent());
+ }
+
+ private void createUI(Layout layout) {
+ orderedLayout(layout);
+ gridLayout(layout);
+ }
+
+ private void gridLayout(Layout layout) {
+ Panel p = new Panel("GridLayout");
+ layout.addComponent(p);
+
+ GridLayout gl = new GridLayout(1, 4);
+ gl.setCaption("Horizontal");
+ Button b;
+
+ b = new Button("Wide button");
+ b.setWidth("500px");
+ gl.addComponent(b);
+
+ addButtons(gl);
+
+ p.addComponent(gl);
+
+ /* VERTICAL */
+
+ gl = new GridLayout(4, 1);
+ gl.setCaption("Vertical");
+
+ addButtons(gl);
+
+ b = new Button("High button");
+ b.setHeight("200px");
+ gl.addComponent(b);
+
+ p.addComponent(gl);
+
+ }
+
+ private void orderedLayout(Layout layout) {
+ Panel p = new Panel("OrderedLayout");
+ layout.addComponent(p);
+
+ AbstractOrderedLayout ol = new VerticalLayout();
+ ol.setCaption("Horizontal");
+ // ol.setWidth("100%");
+
+ Button b;
+
+ b = new Button("Wide button");
+ b.setWidth("500px");
+ ol.addComponent(b);
+
+ addButtons(ol);
+ p.addComponent(ol);
+
+ /* VERTICAL */
+
+ ol = new HorizontalLayout();
+ ol.setCaption("Vertical");
+
+ addButtons(ol);
+ b = new Button("High button");
+ b.setHeight("200px");
+ ol.addComponent(b);
+
+ p.addComponent(ol);
+
+ }
+
+ private void addButtons(Layout ol) {
+ ol.addComponent(getButton(ol, Alignment.TOP_LEFT));
+ ol.addComponent(getButton(ol, Alignment.MIDDLE_CENTER));
+ ol.addComponent(getButton(ol, Alignment.BOTTOM_RIGHT));
+
+ }
+
+ private Button getButton(Layout l, Alignment align) {
+ Button b = new Button("Narrow Button - "
+ + align.getHorizontalAlignment() + " - "
+ + align.getVerticalAlignment());
+ b.setWidth("100px");
+ ((AlignmentHandler) l).setComponentAlignment(b, align);
+
+ return b;
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java
new file mode 100644
index 0000000000..c5442e6473
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java
@@ -0,0 +1,168 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1966_2 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ w.setContent(new GridLayout(2, 2));
+
+ // Panel p = new Panel("test");
+ // p.setWidth(500);
+ // p.setHeight(500);
+ // p.setContent(new GridLayout(1, 2));
+ // p.getLayout().setSizeFull();
+ //
+ // p.addComponent(new Button("asjkdfhakshdf"));
+ // p.addComponent(new Button("öalijgto8aq5"));
+
+ // GridLayout gl = new GridLayout(4, 1);
+ // // gl.setCaption("Vertical");
+ // gl.setWidth("100%");
+ // gl.setHeight(500);
+
+ // addButtons(gl);
+ // gl.addComponent(new Label("abc"));
+ // p.addComponent(gl);
+
+ // w.getLayout().addComponent(p);
+ createUI((Layout) w.getContent());
+ }
+
+ private void createUI(Layout layout) {
+ orderedLayout(layout);
+ gridLayout(layout);
+ expandLayout(layout);
+ }
+
+ private void gridLayout(Layout layout) {
+ Panel p = new Panel("GridLayout");
+ p.setWidth("500px");
+ p.setHeight("500px");
+ p.getContent().setSizeFull();
+ layout.addComponent(p);
+
+ GridLayout gl = new GridLayout(1, 4);
+ gl.setCaption("Horizontal");
+ gl.setWidth("100%");
+
+ // Button b;
+
+ // b = new Button("Wide button");
+ // b.setWidth("500");
+ // gl.addComponent(b);
+
+ addButtons(gl);
+
+ p.addComponent(gl);
+
+ /* VERTICAL */
+
+ gl = new GridLayout(4, 1);
+ // gl.setCaption("Vertical");
+ gl.setHeight("100%");
+ addButtons(gl);
+
+ // Button b = new Button("High button");
+ // b.setHeight(200);
+ // gl.addComponent(b);
+
+ p.addComponent(gl);
+
+ }
+
+ private void orderedLayout(Layout layout) {
+ Panel p = new Panel("OrderedLayout");
+ p.setWidth("500px");
+ p.setHeight("500px");
+ p.getContent().setWidth("100%");
+ layout.addComponent(p);
+
+ AbstractOrderedLayout ol = new VerticalLayout();
+ // ol.setCaption("Horizontal");
+ ol.setWidth("100%");
+ addButtons(ol);
+ p.addComponent(ol);
+
+ /* VERTICAL */
+
+ ol = new HorizontalLayout();
+ // ol.setCaption("Vertical");
+ ol.setHeight("200px");
+ addButtons(ol);
+ // Button b = new Button("High button");
+ // b.setHeight(200);
+ // ol.addComponent(b);
+ p.addComponent(ol);
+
+ }
+
+ private void expandLayout(Layout layout) {
+ Panel p = new Panel("ExpandLayout");
+ layout.addComponent(p);
+ p.getContent().setWidth("500");
+ p.getContent().setHeight("400");
+
+ AbstractOrderedLayout el = new VerticalLayout();
+ // el.setCaption("Horizontal");
+ // el.setSizeUndefined();
+ // el.setWidth("100%");
+ // ol.setWidth("100%");
+ Button b;
+
+ b = new Button("Wide button");
+ b.setWidth("100%");
+ // b.setHeight(200);
+ // el.setExpandRatio(b,1);
+ // el.addComponent(b);
+
+ addButtons(el);
+ p.addComponent(el);
+
+ /* VERTICAL */
+
+ el = new HorizontalLayout();
+ // el.setHeight(400);
+ // el.setWidth("100%");
+ // el.setCaption("Vertical");
+
+ addButtons(el);
+ // b = new Button("High button");
+ // el.setExpandRatio(b,1);
+ // b.setHeight(100);
+ // el.addComponent(b);
+
+ p.addComponent(el);
+
+ }
+
+ private void addButtons(Layout ol) {
+ ol.addComponent(getButton(ol, Alignment.TOP_LEFT));
+ ol.addComponent(getButton(ol, Alignment.MIDDLE_CENTER));
+ ol.addComponent(getButton(ol, Alignment.BOTTOM_RIGHT));
+
+ }
+
+ private Button getButton(Layout l, Alignment align) {
+ Button b = new Button(align.getHorizontalAlignment() + " - "
+ + align.getVerticalAlignment());
+ // b.setWidth("100");
+ ((AlignmentHandler) l).setComponentAlignment(b, align);
+
+ return b;
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java
new file mode 100644
index 0000000000..7258971f50
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java
@@ -0,0 +1,63 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1966_3 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ VerticalLayout ol = new VerticalLayout();
+ Panel p = new Panel(ol);
+ p.setWidth("300px");
+ p.setHeight("300px");
+ p.getContent().setSizeFull();
+
+ TextField tf = new TextField("Long caption, longer than 100 pixels");
+ tf.setWidth("100px");
+
+ ol.addComponent(tf);
+ ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);
+
+ tf = new TextField("Short caption");
+ tf.setWidth("100px");
+
+ tf.setComponentError(new UserError("error message"));
+ ol.addComponent(tf);
+ ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);
+
+ tf = new TextField("Short caption");
+ tf.setComponentError(new UserError("error message"));
+ tf.setIcon(new ThemeResource("icons/16/calendar.png"));
+ tf.setWidth("100px");
+
+ tf.setComponentError(new UserError("error message"));
+ ol.addComponent(tf);
+ ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);
+
+ tf = new TextField();
+ tf.setValue("No caption");
+ tf.setWidth("100px");
+
+ ol.addComponent(tf);
+ ol.setComponentAlignment(tf, Alignment.TOP_RIGHT);
+
+ layout.addComponent(p);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java
new file mode 100644
index 0000000000..78c09d8914
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java
@@ -0,0 +1,110 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.server.UserError;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1969 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.getContent().setSizeFull();
+
+ TabSheet ts = new TabSheet();
+ ts.setSizeFull();
+
+ final Table t = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(7, 2000);
+ t.setSizeFull();
+ ts.addTab(t, "Table, scrollins should not flash", null);
+
+ final Label testContent = new Label(
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");
+
+ testContent.setCaption("Introduction to test");
+
+ ts.addTab(testContent);
+
+ final VerticalLayout actions = new VerticalLayout();
+
+ actions.setCaption("Test actions");
+
+ ts.addTab(actions);
+
+ Button b;
+
+ b = new Button(
+ "change introduction caption (should add * to tab name)",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ testContent.setCaption(testContent.getCaption() + "*");
+ }
+ });
+ actions.addComponent(b);
+
+ b = new Button("change tab caption (should add * to tab name)",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ actions.setCaption(actions.getCaption() + "*");
+ }
+ });
+
+ actions.addComponent(b);
+
+ final UserError e = new UserError("Test error");
+
+ b = new Button("Toggle error", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (testContent.getComponentError() == null) {
+ testContent.setComponentError(e);
+ } else {
+ testContent.setComponentError(null);
+ }
+ }
+ });
+ actions.addComponent(b);
+
+ b = new Button("Change table caption", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ t.setCaption(t.getCaption() + "*");
+ }
+ });
+ actions.addComponent(b);
+
+ b = new Button("Toggle Table error", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (t.getComponentError() == null) {
+ t.setComponentError(e);
+ } else {
+ t.setComponentError(null);
+ }
+ }
+ });
+
+ actions.addComponent(b);
+
+ for (int i = 0; i < 20; i++) {
+ Label l = new Label("Test Content");
+ l.setCaption("Extra tab " + i);
+ ts.addComponent(l);
+ }
+
+ main.addComponent(ts);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1970.java b/uitest/src/com/vaadin/tests/tickets/Ticket1970.java
new file mode 100644
index 0000000000..b07a997f8f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1970.java
@@ -0,0 +1,76 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Iterator;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1970 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(createWindow());
+ }
+
+ @Override
+ public LegacyWindow getWindow(String name) {
+
+ // If we already have the requested window, use it
+ LegacyWindow w = super.getWindow(name);
+ if (w == null) {
+
+ // If no window found, create it
+ w = createExtraWindow(name);
+ }
+ return w;
+ }
+
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
+ w.setName(name);
+ addWindow(w);
+ w.addComponent(new Label(
+ "This window has been created on fly for name: " + name));
+ w.addComponent(new Button("Show open windows",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String openWindows = "";
+ for (Iterator<LegacyWindow> i = getWindows().iterator(); i
+ .hasNext();) {
+ LegacyWindow t = i.next();
+ openWindows += (openWindows.length() > 0 ? "," : "")
+ + t.getName();
+ }
+ w.showNotification(openWindows);
+ }
+ }));
+
+ return w;
+ }
+
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
+ w.addComponent(new Button("Show the name of the application",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ w.showNotification("Name of this window = "
+ + w.getName());
+ }
+ }));
+ w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>"
+ + getURL().toExternalForm() + "</a>", ContentMode.XHTML));
+ w.addComponent(new Label(
+ "<h2>How to reproduce</h2>Open the above link in another browser"
+ + " window and then press the Show-button on this window.",
+ ContentMode.XHTML));
+
+ return w;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1972.java b/uitest/src/com/vaadin/tests/tickets/Ticket1972.java
new file mode 100644
index 0000000000..6b406a2f89
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1972.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1972 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ setTheme("tests-ticket");
+ GridLayout layout = new GridLayout(3, 3);
+ layout.setStyleName("borders");
+ layout.addComponent(new Label("1-1"));
+ layout.space();
+ layout.space();
+ layout.addComponent(new Label("2-1"));
+ layout.space();
+ layout.space();
+ layout.addComponent(new Label("3-1"));
+ layout.space();
+ layout.addComponent(new Label("3-3"));
+
+ w.setContent(layout);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java
new file mode 100644
index 0000000000..a3365bedcb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java
@@ -0,0 +1,52 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1973 extends com.vaadin.Application.LegacyApplication {
+
+ LegacyWindow main = new LegacyWindow();
+ Table table = new Table();
+
+ @Override
+ public void init() {
+ setMainWindow(main);
+
+ final IndexedContainer container1 = new IndexedContainer();
+ container1.addContainerProperty("layout", Component.class, null);
+
+ final IndexedContainer container2 = new IndexedContainer();
+ container2.addContainerProperty("layout", Component.class, null);
+
+ fill(container1, 100, "Testi 1 :");
+ fill(container2, 100, "Testi 2 :");
+
+ table.setContainerDataSource(container1);
+
+ Button refreshTable = new Button("Change table container");
+ refreshTable.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent e) {
+ table.setContainerDataSource(container2);
+ table.setContainerDataSource(container1);
+ }
+ });
+
+ main.addComponent(table);
+ main.addComponent(refreshTable);
+ }
+
+ public void fill(IndexedContainer container, int size, String prefix) {
+ for (int i = 0; i < size; i++) {
+ Item item = container.addItem(new Integer(i));
+ VerticalLayout layout = new VerticalLayout();
+ layout.addComponent(new Button(prefix + i));
+ item.getItemProperty("layout").setValue(layout);
+ }
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java
new file mode 100644
index 0000000000..27c3d4a8a7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket1973_2 extends Application.LegacyApplication {
+ LegacyWindow main = new LegacyWindow();
+ Table table = new Table();
+
+ @Override
+ public void init() {
+ setMainWindow(main);
+
+ final IndexedContainer container1 = new IndexedContainer();
+ container1.addContainerProperty("text", String.class, null);
+ container1.addContainerProperty("layout", Component.class, null);
+
+ final IndexedContainer container2 = new IndexedContainer();
+ container2.addContainerProperty("text", String.class, null);
+ container2.addContainerProperty("layout", Component.class, null);
+
+ fill(container1, 100);
+
+ table.setContainerDataSource(container1);
+
+ Button refreshTable = new Button("Change table container");
+ refreshTable.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent e) {
+ table.setContainerDataSource(container2);
+ table.setContainerDataSource(container1);
+ }
+ });
+
+ main.addComponent(table);
+ main.addComponent(refreshTable);
+ }
+
+ public void fill(IndexedContainer container, int size) {
+ for (int i = 0; i < size; i++) {
+ int randInt = i;
+ Item item = container.addItem(new Integer(i));
+ VerticalLayout layout = new VerticalLayout();
+ layout.setId("lo" + i);
+ layout.addComponent(new Button("Test " + randInt));
+ item.getItemProperty("layout").setValue(layout);
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1975.java b/uitest/src/com/vaadin/tests/tickets/Ticket1975.java
new file mode 100644
index 0000000000..9c6dd8c272
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1975.java
@@ -0,0 +1,63 @@
+package com.vaadin.tests.tickets;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+
+import com.vaadin.Application;
+import com.vaadin.server.WebApplicationContext;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1975 extends Application.LegacyApplication {
+
+ private CustomLayout cl1;
+ private CustomLayout cl2;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(1, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ String s = "<b>Blah</b><input type=\"text\" value='Lorem\" ipsum'/>";
+ try {
+ cl1 = new CustomLayout(new ByteArrayInputStream(s.getBytes()));
+ layout.addComponent(cl1);
+ WebApplicationContext wc = ((WebApplicationContext) getContext());
+
+ layout.addComponent(new Button("Disable/Enable",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ boolean e = cl1.isEnabled();
+
+ cl1.setEnabled(!e);
+ cl2.setEnabled(!e);
+ }
+
+ }));
+ File f = new File(wc.getBaseDirectory().getAbsoluteFile()
+ + "/VAADIN/themes/" + getTheme()
+ + "/layouts/Ticket1975.html");
+
+ cl2 = new CustomLayout(new FileInputStream(f));
+ layout.addComponent(cl2);
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1982.java b/uitest/src/com/vaadin/tests/tickets/Ticket1982.java
new file mode 100644
index 0000000000..a5953d22af
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1982.java
@@ -0,0 +1,86 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket1982 extends Application.LegacyApplication {
+
+ private List<TitleBar> components = new ArrayList<TitleBar>();
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ GridLayout gl = new GridLayout(2, 2);
+ gl.setSizeFull();
+ main.setContent(gl);
+ gl.setMargin(true);
+
+ TitleBar t1 = new TitleBar("Title 1", gl);
+ TitleBar t2 = new TitleBar("Title 2", gl);
+ TitleBar t3 = new TitleBar("Title 3", gl);
+ TitleBar t4 = new TitleBar("Title 4", gl);
+ components.add(t1);
+ components.add(t2);
+ components.add(t3);
+ components.add(t4);
+
+ restoreComponents(gl);
+
+ }
+
+ private void restoreComponents(GridLayout gl) {
+ gl.removeAllComponents();
+ gl.addComponent(components.get(0));
+ gl.addComponent(components.get(1));
+ gl.addComponent(components.get(2));
+ gl.addComponent(components.get(3));
+ }
+
+ private class TitleBar extends HorizontalLayout {
+
+ private Button max = new Button("Max");
+ private Button min = new Button("Min");
+ private GridLayout layout;
+
+ public TitleBar(String title, GridLayout layout) {
+ super();
+ this.layout = layout;
+ addComponent(new Label(title));
+ addComponent(max);
+ addComponent(min);
+ min.setVisible(false);
+
+ max.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ min.setVisible(true);
+ max.setVisible(false);
+ TitleBar.this.layout.removeAllComponents();
+ TitleBar.this.layout
+ .addComponent(TitleBar.this, 0, 0, 1, 1);
+ }
+ });
+ min.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ min.setVisible(false);
+ max.setVisible(true);
+ restoreComponents(TitleBar.this.layout);
+ }
+ });
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1983.java b/uitest/src/com/vaadin/tests/tickets/Ticket1983.java
new file mode 100644
index 0000000000..7b544ec9b0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1983.java
@@ -0,0 +1,143 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.server.Sizeable;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Test class for ticket 1983
+ */
+public class Ticket1983 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow("Test for ticket 1983");
+ main.setContent(new TestLayout());
+ setMainWindow(main);
+ }
+
+ private static class TestLayout extends HorizontalSplitPanel {
+ boolean isLong = true;
+ final Table table = new MyTable();
+ final String propId = "col";
+ final String propId2 = "col2";
+
+ public TestLayout() {
+
+ setSplitPosition(200, Sizeable.UNITS_PIXELS);
+ setLocked(true);
+
+ final HorizontalSplitPanel leftSide = initLeftSide();
+ setFirstComponent(leftSide);
+
+ final Layout rightSide = new VerticalLayout();
+ rightSide.setHeight("100%");
+ setSecondComponent(rightSide);
+ }
+
+ private HorizontalSplitPanel initLeftSide() {
+ final HorizontalSplitPanel leftSide = new HorizontalSplitPanel();
+ leftSide.setHeight("100%");
+
+ final IndexedContainer dataSource = new IndexedContainer();
+ dataSource.addContainerProperty(propId, String.class, null);
+ dataSource.addContainerProperty(propId2, String.class, null);
+ final Object itemId = dataSource.addItem();
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId2)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+
+ for (int i = 0; i < 150; i++) {
+ Object id = dataSource.addItem();
+ dataSource
+ .getItem(id)
+ .getItemProperty(propId)
+ .setValue(
+ (i == 100 ? "Very long value that makes a scrollbar appear for sure"
+ : "Short"));
+ dataSource.getItem(id).getItemProperty(propId2)
+ .setValue("Short");
+ }
+
+ table.setSizeFull();
+ table.setContainerDataSource(dataSource);
+ table.setVisibleColumns(new Object[] { propId });
+
+ leftSide.setSecondComponent(table);
+
+ Button button = new Button("Change col value to short");
+ button.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ // Change the column value to a short one --> Should remove
+ // the scrollbar
+ if (isLong) {
+ dataSource.getItem(itemId).getItemProperty(propId)
+ .setValue("Short value");
+ dataSource.getItem(itemId).getItemProperty(propId2)
+ .setValue("Short value");
+ isLong = false;
+ } else {
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId2)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ isLong = true;
+ }
+ // Works the same way with or without repaint request
+ table.markAsDirty();
+ }
+ });
+
+ VerticalLayout ol = new VerticalLayout();
+ ol.addComponent(button);
+ leftSide.setFirstComponent(ol);
+
+ CheckBox checkBox = new CheckBox("Two col");
+ checkBox.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
+ table.setVisibleColumns(new Object[] { propId, propId2 });
+ } else {
+ table.setVisibleColumns(new Object[] { propId });
+ }
+
+ }
+
+ });
+ ol.addComponent(checkBox);
+
+ return leftSide;
+ }
+ }
+
+ static class MyTable extends Table {
+ MyTable() {
+ alwaysRecalculateColumnWidths = true;
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1986.java b/uitest/src/com/vaadin/tests/tickets/Ticket1986.java
new file mode 100644
index 0000000000..fd6665b2fe
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1986.java
@@ -0,0 +1,79 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.ListSelect;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.TwinColSelect;
+
+public class Ticket1986 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ int index = 1;
+
+ GridLayout layout = new GridLayout(2, 2);
+ TextField f1 = new TextField("1");
+ f1.setTabIndex(index++);
+ TextField f2 = new TextField("2");
+ f2.setTabIndex(index++);
+
+ DateField f3 = new DateField("3");
+ f3.setTabIndex(index++);
+ ComboBox cb = new ComboBox("4");
+ cb.setTabIndex(index++);
+
+ ListSelect lss = new ListSelect("5");
+ lss.addItem("foo");
+ lss.addItem("Bar");
+ lss.setTabIndex(index++);
+
+ NativeSelect ns = new NativeSelect("6");
+ ns.addItem("foo");
+ ns.addItem("bar");
+ ns.setTabIndex(index++);
+
+ OptionGroup og = new OptionGroup("7");
+ og.addItem("foo");
+ og.addItem("bar");
+ og.setTabIndex(index++);
+
+ OptionGroup ogm = new OptionGroup("7");
+ ogm.setMultiSelect(true);
+ ogm.addItem("foo");
+ ogm.addItem("bar");
+ ogm.setTabIndex(index++);
+
+ TwinColSelect ts = new TwinColSelect("8");
+ ts.addItem("Foo");
+ ts.addItem("Bar");
+ ts.setTabIndex(index++);
+
+ Button b = new Button("9");
+ b.setTabIndex(index++);
+
+ layout.addComponent(b);
+ layout.addComponent(ts);
+ layout.addComponent(ogm);
+ layout.addComponent(og);
+ layout.addComponent(ns);
+ layout.addComponent(lss);
+ layout.addComponent(cb);
+ layout.addComponent(f3);
+ layout.addComponent(f2);
+ layout.addComponent(f1);
+
+ w.setContent(layout);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java
new file mode 100644
index 0000000000..ed60c89c16
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket1991 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ Table t = new Table("Test table");
+
+ t.addContainerProperty(" ", CheckBox.class, "");
+ t.addContainerProperty("Col1", String.class, "");
+ t.addContainerProperty("Col2", String.class, "");
+
+ t.setPageLength(5);
+
+ t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "1");
+ t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "2");
+
+ main.addComponent(t);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1995.java b/uitest/src/com/vaadin/tests/tickets/Ticket1995.java
new file mode 100644
index 0000000000..04ce9c712d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1995.java
@@ -0,0 +1,68 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Container;
+import com.vaadin.data.Container.Filterable;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.filter.SimpleStringFilter;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket1995 extends Application.LegacyApplication {
+
+ private static final Object PROPERTY_1 = "Test";
+ private Table table;
+
+ @Override
+ public void init() {
+ final LegacyWindow mainWin = new LegacyWindow(getClass().getName());
+ setMainWindow(mainWin);
+
+ table = new Table();
+ table.addContainerProperty(PROPERTY_1, String.class, "");
+ table.setPageLength(4);
+
+ Item item = table.addItem("1");
+ item.getItemProperty(PROPERTY_1).setValue("Row 1");
+ item = table.addItem("2");
+ item.getItemProperty(PROPERTY_1).setValue("Row 2");
+
+ Filterable filterable = (Container.Filterable) table
+ .getContainerDataSource();
+ filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row",
+ true, false));
+
+ table.setColumnHeader(PROPERTY_1, "Test (filter: Row)");
+
+ mainWin.addComponent(table);
+ mainWin.addComponent(new Button("Add item",
+ new com.vaadin.ui.Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ addItem();
+ }
+ }));
+ }
+
+ protected void addItem() {
+ Filterable filterable = (Container.Filterable) table
+ .getContainerDataSource();
+
+ Item i = table.addItem("abc");
+ String res = "";
+ if (i == null) {
+ res = "FAILED";
+ } else {
+ res = "OK!";
+ }
+
+ getMainWindow().showNotification("Tried to add item 'abc', " + res);
+
+ filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row",
+ true, false));
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket20.java b/uitest/src/com/vaadin/tests/tickets/Ticket20.java
new file mode 100644
index 0000000000..ea610a3db8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket20.java
@@ -0,0 +1,83 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Validator;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.CompositeValidator;
+import com.vaadin.data.validator.CompositeValidator.CombinationMode;
+import com.vaadin.data.validator.IntegerValidator;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket20 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #20");
+ setMainWindow(mainWin);
+
+ final TextField tx = new TextField("Integer");
+ mainWin.addComponent(tx);
+ tx.setImmediate(true);
+ CompositeValidator v = new CompositeValidator();
+ v.addValidator(new IntegerValidator("{0} is not a number"));
+ v.addValidator(new Validator() {
+
+ private boolean isValid(Object value) {
+ try {
+ int i = Integer.parseInt("" + value);
+ if (i < 0) {
+ return false;
+ }
+ return true;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (!isValid(value)) {
+ throw new InvalidValueException(value
+ + " is not a non-negative number");
+ }
+ }
+ });
+ CompositeValidator v2 = new CompositeValidator(CombinationMode.OR, null);
+ v2.addValidator(v);
+ v2.addValidator(new Validator() {
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (!"".equals("" + value)) {
+ throw new InvalidValueException("Value is not empty string");
+ }
+ }
+ });
+ tx.addValidator(v2);
+
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "invalidCommitted",
+ "validationVisible" };
+ for (int i = 0; i < visibleProps.length; i++) {
+ CheckBox b = new CheckBox(visibleProps[i],
+ new MethodProperty<Boolean>(tx, visibleProps[i]));
+ b.setImmediate(true);
+ mainWin.addComponent(b);
+ }
+
+ mainWin.addComponent(new Button("Validate integer",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(
+ com.vaadin.ui.Button.ClickEvent event) {
+ mainWin.showNotification("The field is "
+ + (tx.isValid() ? "" : "not ") + "valid");
+ };
+ }));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2001.java b/uitest/src/com/vaadin/tests/tickets/Ticket2001.java
new file mode 100644
index 0000000000..8ff3d952c4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2001.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2001 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ final VerticalLayout l = new VerticalLayout();
+ l.addComponent(new Label("row 1"));
+ l.addComponent(new Label("row 2"));
+ w.addComponent(l);
+
+ final CheckBox b = new CheckBox("fixed width: 30px", false);
+ b.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) b.getValue()) {
+ l.setWidth("30px");
+ } else {
+ l.setWidth(null);
+ }
+ }
+ });
+ b.setImmediate(true);
+ w.addComponent(b);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2002.java b/uitest/src/com/vaadin/tests/tickets/Ticket2002.java
new file mode 100644
index 0000000000..aeaf3bfb33
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2002.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2002 extends Application.LegacyApplication {
+ private Long long1 = new Long(1L);
+ private Long long2 = new Long(2L);
+
+ public Long getLong1() {
+ return long1;
+ }
+
+ public void setLong1(Long long1) {
+ this.long1 = long1;
+ }
+
+ public Long getLong2() {
+ return long2;
+ }
+
+ public void setLong2(Long long2) {
+ this.long2 = long2;
+ }
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+
+ GridLayout layout = new GridLayout(2, 2);
+ layout.setSpacing(true);
+
+ TextField f1 = new TextField("Non-immediate/Long text field",
+ new MethodProperty<Long>(this, "long1"));
+ f1.setImmediate(false);
+ f1.setNullSettingAllowed(true);
+ TextField f2 = new TextField("Immediate/Long text field",
+ new MethodProperty<Long>(this, "long2"));
+ f2.setImmediate(true);
+ f2.setNullSettingAllowed(true);
+
+ layout.addComponent(f1);
+ layout.addComponent(f2);
+
+ w.setContent(layout);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2007.java b/uitest/src/com/vaadin/tests/tickets/Ticket2007.java
new file mode 100644
index 0000000000..fcffbc01bf
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2007.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2007 extends Application.LegacyApplication {
+
+ int childs = 0;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("Main window for #2007");
+ setMainWindow(main);
+ main.addComponent(new Button("Open another (non-main) window",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ LegacyWindow c = new LegacyWindow(
+ "Non-main browser window " + (++childs));
+ addWindow(c);
+ main.open(new ExternalResource(c.getURL()), "_new");
+ }
+ }));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java
new file mode 100644
index 0000000000..e79ec8905e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java
@@ -0,0 +1,130 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Container;
+import com.vaadin.event.ItemClickEvent;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Tree;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class Ticket2009 extends com.vaadin.Application.LegacyApplication {
+
+ TextField f = new TextField();
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ HorizontalLayout ol = new HorizontalLayout();
+ main.setContent(ol);
+ ol.setSizeFull();
+
+ Panel p = new Panel("Tree test");
+ p.setSizeFull();
+
+ Tree t = new Tree();
+
+ t.addItem("Foo");
+ t.addItem("Bar");
+
+ final VerticalLayout events = new VerticalLayout();
+
+ t.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
+ public void itemClick(ItemClickEvent event) {
+ events.addComponent(new Label(new Label("Click:"
+ + (event.isDoubleClick() ? "double" : "single")
+ + " button:" + event.getButton() + " propertyId:"
+ + event.getPropertyId() + " itemID:"
+ + event.getItemId() + " item:" + event.getItem())));
+
+ }
+ });
+
+ main.addComponent(p);
+ p.addComponent(t);
+ p.addComponent(events);
+
+ Panel p2 = new Panel("Table test (try dbl click also)");
+ p2.setSizeFull();
+
+ final VerticalLayout events2 = new VerticalLayout();
+ Table table = TestForTablesInitialColumnWidthLogicRendering
+ .getTestTable(5, 100);
+ table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+ table.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
+ public void itemClick(ItemClickEvent event) {
+ events2.addComponent(new Label("Click:"
+ + (event.isDoubleClick() ? "double" : "single")
+ + " button:" + event.getButton() + " propertyId:"
+ + event.getPropertyId() + " itemID:"
+ + event.getItemId() + " item:" + event.getItem()));
+ if (event.isDoubleClick()) {
+ new PropertyEditor(event);
+ }
+
+ }
+ });
+ p2.addComponent(table);
+ p2.addComponent(events2);
+
+ main.addComponent(p2);
+
+ }
+
+ class PropertyEditor extends Window {
+
+ private static final int W = 300;
+ private static final int H = 150;
+
+ private Container c;
+ private Object itemid;
+ private Object propertyid;
+
+ TextField editor = new TextField();
+ Button done = new Button("Done");
+
+ PropertyEditor(ItemClickEvent event) {
+ c = (Container) event.getSource();
+
+ propertyid = event.getPropertyId();
+ itemid = event.getItemId();
+
+ setCaption("Editing " + itemid + " : " + propertyid);
+
+ editor.setPropertyDataSource(c.getContainerProperty(itemid,
+ propertyid));
+ addComponent(editor);
+ addComponent(done);
+
+ setWidth(W + "px");
+ setHeight(H + "px");
+
+ setPositionX(event.getClientX() - W / 2);
+ setPositionY(event.getClientY() - H / 2);
+
+ getMainWindow().addWindow(this);
+
+ done.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getMainWindow().removeWindow(PropertyEditor.this);
+ }
+ });
+
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2011.java b/uitest/src/com/vaadin/tests/tickets/Ticket2011.java
new file mode 100644
index 0000000000..754036cd5b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2011.java
@@ -0,0 +1,26 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+
+public class Ticket2011 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ // setTheme("tests-ticket");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ Select s = new Select("Select");
+ s.addItem("Item 1");
+ s.addItem("Item 2");
+ layout.addComponent(s);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2014.java b/uitest/src/com/vaadin/tests/tickets/Ticket2014.java
new file mode 100644
index 0000000000..bf909acb35
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2014.java
@@ -0,0 +1,65 @@
+package com.vaadin.tests.tickets;
+
+import java.util.UUID;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2014 extends Application.LegacyApplication {
+
+ private HorizontalLayout innerLayout1;
+ private Button b1;
+ private Panel panel;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getName());
+ setMainWindow(w);
+ // setTheme("tests-ticket");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ createPanel(layout);
+
+ layout.addComponent(new Button("Change class name",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ b1.setStyleName(UUID.randomUUID().toString());
+ }
+
+ }));
+
+ }
+
+ private void createPanel(GridLayout layout) {
+ panel = new Panel("panel caption");
+ layout.addComponent(panel);
+
+ innerLayout1 = new HorizontalLayout();
+ innerLayout1.setSpacing(true);
+ panel.addComponent(innerLayout1);
+
+ b1 = new Button("Button inside orderedLayout", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ System.out.println("Clicked " + event.getButton().getCaption());
+ }
+
+ });
+
+ innerLayout1.addComponent(b1);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2021.java b/uitest/src/com/vaadin/tests/tickets/Ticket2021.java
new file mode 100644
index 0000000000..c23f031a91
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2021.java
@@ -0,0 +1,143 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2021 extends Application.LegacyApplication {
+
+ private TextArea tf1, tf2, tf3;
+
+ private String contents = "This TextField SHOULD FILL the panel and NOT CAUSE any scrollbars to appear in the Panel. Scrollbars SHOULD appear in the TextField AND the whole scrollbars (includinc arrow down) SHOULD be visible.\n\n"
+ + ""
+ + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent quis justo. Vivamus nec mi eu libero convallis auctor. Mauris et arcu. Nunc luctus justo. Aenean convallis, odio in vehicula scelerisque, est magna condimentum pede, a aliquam elit eros vitae diam. Phasellus porttitor convallis tellus. Nullam elementum, ligula nec viverra malesuada, risus tortor bibendum dui, eget hendrerit sem enim at massa. Nam eu pede sed nulla congue fermentum. Vestibulum malesuada libero non nunc. Proin rutrum. Fusce erat pede, volutpat vitae, aliquam ut, sagittis vel, augue. Fusce dui pede, convallis nec, accumsan tincidunt, consectetuer ac, purus. Nulla facilisi. Ut nisi. Sed orci risus, lacinia eu, sodales molestie, gravida quis, neque. Vestibulum pharetra ornare elit. Nulla porttitor molestie mauris. Morbi fringilla tellus sed risus. Curabitur varius massa."
+ + "Nulla nisi. Sed blandit, ante vitae sagittis volutpat, arcu mauris vehicula risus, vitae posuere felis lectus sit amet purus. Donec nec magna et leo eleifend scelerisque. Suspendisse condimentum pharetra ligula. Curabitur lorem. Pellentesque a augue sit amet enim fermentum placerat. Phasellus ante risus, molestie at, iaculis at, pellentesque non, tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non urna eget risus tempus imperdiet. Integer est diam, sagittis sit amet, posuere sit amet, bibendum sed, lacus. Aenean adipiscing cursus ipsum. Quisque at elit. Vestibulum vitae nunc. Praesent placerat metus viverra lorem. Cras nec elit congue nisi faucibus feugiat. Nam eget mi. Vestibulum condimentum. Nunc nisl ante, cursus in, dictum ac, lobortis rutrum, mi. Nulla eu nisi. In ultricies vehicula magna."
+ + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra.";
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ w.setContent(new GridLayout(2, 2));
+ setMainWindow(w);
+
+ Panel p = new Panel();
+ p.setCaption("ExpandLayout");
+ p.setWidth("500px");
+ p.setHeight("500px");
+ p.setContent(new VerticalLayout());
+ p.getContent().setSizeFull();
+
+ w.getContent().addComponent(p);
+
+ tf1 = new TextArea();
+ tf1.setRows(5);
+ tf1.setSizeFull();
+ tf1.setValue(contents);
+ tf1.setCaption("TextField caption");
+ p.getContent().addComponent(tf1);
+
+ /*
+ *
+ * OrderedLayout
+ */
+
+ Panel p2 = new Panel();
+ p2.setCaption("OrderedLayout");
+ p2.setWidth("500px");
+ p2.setHeight("500px");
+ p2.setContent(new VerticalLayout());
+ p2.getContent().setSizeFull();
+
+ w.getContent().addComponent(p2);
+
+ tf2 = new TextArea();
+ tf2.setRows(5);
+ tf2.setSizeFull();
+ tf2.setValue(contents);
+ tf2.setCaption("TextField caption");
+ p2.getContent().addComponent(tf2);
+
+ /*
+ *
+ * GridLayout
+ */
+
+ Panel p3 = new Panel();
+ p3.setCaption("GridLayout");
+ p3.setWidth("500px");
+ p3.setHeight("500px");
+ // p3.setContent(new GridLayout());
+ p3.getContent().setSizeFull();
+ ((MarginHandler) p3.getContent()).setMargin(false);
+
+ GridLayout gl = new GridLayout();
+ gl.setSizeFull();
+ gl.setMargin(false);
+ p3.getContent().addComponent(gl);
+ w.getContent().addComponent(p3);
+
+ tf3 = new TextArea();
+ tf3.setRows(5);
+ tf3.setSizeFull();
+ tf3.setValue(contents);
+ tf3.setCaption("TextField caption");
+ // p3.getContent().addComponent(tf3);
+ gl.addComponent(tf3);
+
+ // Panel pp = new Panel();
+ // pp.setCaption("OrderedLayout");
+ // pp.setWidth("500px");
+ // pp.setHeight("500px");
+ // pp.getContent().setSizeFull();
+ // orderedLayout = new VerticalLayout();
+ // pp.getContent().addComponent(orderedLayout);
+ // w.getContent().addComponent(pp);
+ // createUI(orderedLayout);
+ }
+
+ @SuppressWarnings("unused")
+ private void createUI(Layout layout) {
+ Label l = new Label("Label");
+ Button b = new Button("Enable/disable caption and watch button move",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ System.out.println("Enable/disable caption");
+ for (AbstractComponent l : new AbstractComponent[] {
+ tf1, tf2, tf3 }) {
+ // AbstractComponent l = tf2;
+ // Layout l = (Layout) event.getButton().getData();
+ if (l.getCaption() == null) {
+ l.setCaption("Expand layout caption");
+ } else {
+ l.setCaption(null);
+ }
+ }
+ }
+
+ });
+ b.setData(layout);
+ Label l2 = new Label("This should always be visible");
+
+ layout.addComponent(l);
+ layout.addComponent(b);
+ layout.addComponent(l2);
+
+ if (layout instanceof AbstractOrderedLayout) {
+ ((AbstractOrderedLayout) layout).setExpandRatio(l, 1);
+
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2022.java b/uitest/src/com/vaadin/tests/tickets/Ticket2022.java
new file mode 100644
index 0000000000..ea142b7e9e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2022.java
@@ -0,0 +1,32 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2022 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ CustomLayout l;
+
+ // WebApplicationContext wac = ((WebApplicationContext) getContext());
+ // File f = new File(wac.getBaseDirectory().getAbsoluteFile()
+ // + "/VAADIN/themes/" + getTheme() + "/layouts/Ticket2022.html");
+
+ l = new CustomLayout("Ticket2022");
+ // try {
+ // l = new CustomLayout(new FileInputStream(f));
+ w.setContent(l);
+ // } catch (FileNotFoundException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // } catch (IOException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2023.java b/uitest/src/com/vaadin/tests/tickets/Ticket2023.java
new file mode 100644
index 0000000000..c6b2c0f28a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2023.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2023 extends com.vaadin.Application.LegacyApplication
+ implements Button.ClickListener {
+
+ AbstractComponent c = new Button();
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ String[] sizes = { "20", "100", "1", "0", "-1", "", "z" };
+ String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc",
+ "", "p", "zyx" };
+
+ GridLayout gl = new GridLayout(units.length, sizes.length);
+ main.addComponent(gl);
+ for (int i = 0; i < sizes.length; i++) {
+ for (int j = 0; j < units.length; j++) {
+ String s = sizes[i] + units[j];
+ gl.addComponent(new Button(s, this));
+ }
+ }
+
+ gl.addComponent(new Button("null", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setWidth(null);
+ c.setHeight(null);
+
+ }
+
+ }));
+
+ main.addComponent(c);
+
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ c.setWidth(event.getButton().getCaption());
+ c.setHeight(event.getButton().getCaption());
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2024.java b/uitest/src/com/vaadin/tests/tickets/Ticket2024.java
new file mode 100644
index 0000000000..b1a8b64931
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2024.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2024 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(2, 2);
+ layout.setHeight("100%");
+ layout.setWidth("700");
+ w.getContent().setSizeFull();
+ w.getContent().setHeight("2000");
+ w.getContent().addComponent(layout);
+
+ layout.addComponent(new Label(
+ "This should NOT get stuck when scrolling down"));
+ layout.addComponent(new TextField("This should not get stuck either..."));
+
+ VerticalLayout ol = new VerticalLayout();
+ ol.setHeight("1000");
+ ol.setWidth("200");
+ w.getContent().addComponent(ol);
+ ol.addComponent(new Label("Just a label to enable the scrollbar"));
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2026.java b/uitest/src/com/vaadin/tests/tickets/Ticket2026.java
new file mode 100644
index 0000000000..0b72073bec
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2026.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2026 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ GridLayout layout = new GridLayout(2, 2);
+ layout.setSpacing(true);
+
+ @SuppressWarnings("unused")
+ int nr = 5;
+ TextField tf;
+ tf = new TextField("TextField (tabIndex 1)");
+ tf.setTabIndex(1);
+ tf.focus();
+ layout.addComponent(tf);
+ layout.addComponent(new TextField("TextField without tab index"));
+ layout.addComponent(new TextField("TextField without tab index"));
+ layout.addComponent(new TextField("TextField without tab index"));
+ layout.addComponent(new TextField("TextField without tab index"));
+ tf = new TextField("TextField (tabIndex 2)");
+ tf.setTabIndex(2);
+ layout.addComponent(tf);
+
+ w.setContent(layout);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2029.java b/uitest/src/com/vaadin/tests/tickets/Ticket2029.java
new file mode 100644
index 0000000000..5900c76706
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2029.java
@@ -0,0 +1,140 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Random;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2029 extends Application.LegacyApplication {
+
+ int COMPONENTS;
+ int DIM1, DIM2;
+ Random r = new Random();
+
+ @Override
+ public void init() {
+ COMPONENTS = 5;
+ DIM1 = 504;
+ DIM2 = 100;
+
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ Panel p = createPanel();
+ w.getContent().addComponent(p);
+ // w.getLayout().addComponent(createGLPanel());
+ w.getContent().addComponent(createPanelV());
+ }
+
+ private Panel createPanel() {
+ Panel p = new Panel(DIM1 + "x" + DIM2 + " OrderedLayout");
+ p.setWidth(DIM1 + "px");
+ p.setHeight(DIM2 + "px");
+
+ HorizontalLayout layout = new HorizontalLayout();
+ p.setContent(layout);
+ p.getContent().setSizeFull();
+
+ for (int i = 0; i < COMPONENTS; i++) {
+ TextField tf = new TextField();
+ if (r.nextBoolean()) {
+ tf.setCaption("Caption");
+ }
+ if (r.nextBoolean()) {
+ tf.setRequired(true);
+ }
+ if (r.nextBoolean()) {
+ tf.setComponentError(new UserError("Error"));
+ }
+ tf.setWidth("100%");
+ layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);
+ p.addComponent(tf);
+
+ }
+
+ return p;
+ }
+
+ @SuppressWarnings("unused")
+ private Panel createGLPanel() {
+ Panel p = new Panel("" + DIM1 + "x" + DIM2 + " GridLayout");
+ p.setWidth("" + DIM1 + "px");
+ p.setHeight("" + DIM2 + "px");
+
+ GridLayout layout = new GridLayout(COMPONENTS, 1);
+ p.setContent(layout);
+ p.getContent().setSizeFull();
+
+ for (int i = 0; i < COMPONENTS; i++) {
+ TextField tf = new TextField();
+ tf.setImmediate(true);
+ tf.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ Component c = ((Component) event.getProperty());
+ c.setCaption("askfdj");
+
+ }
+ });
+ if (r.nextBoolean()) {
+ tf.setCaption("Caption");
+ }
+ if (r.nextBoolean()) {
+ tf.setRequired(true);
+ }
+ if (r.nextBoolean()) {
+ tf.setComponentError(new UserError("Error"));
+ }
+ tf.setWidth("100%");
+ layout.setComponentAlignment(tf, Alignment.MIDDLE_LEFT);
+ p.addComponent(tf);
+
+ }
+
+ return p;
+ }
+
+ private Panel createPanelV() {
+ Panel p = new Panel("" + DIM1 + "x" + DIM2 + " OrderedLayout");
+ p.setWidth("" + DIM2 + "px");
+ p.setHeight("" + DIM1 + "px");
+
+ VerticalLayout layout = new VerticalLayout();
+ p.setContent(layout);
+ p.getContent().setSizeFull();
+
+ for (int i = 0; i < COMPONENTS; i++) {
+ TextArea tf = new TextArea();
+ if (r.nextBoolean()) {
+ tf.setCaption("Caption");
+ }
+ if (r.nextBoolean()) {
+ tf.setRequired(true);
+ }
+ if (r.nextBoolean()) {
+ tf.setComponentError(new UserError("Error"));
+ }
+
+ tf.setRows(2);
+ tf.setSizeFull();
+
+ layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);
+ p.addComponent(tf);
+
+ }
+
+ return p;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java
new file mode 100644
index 0000000000..da47f796a5
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java
@@ -0,0 +1,49 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2037 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ main.addComponent(new Label(
+ "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks."));
+
+ final Layout lo = new VerticalLayout();
+
+ Button b = new Button("b");
+
+ main.addComponent(b);
+ main.addComponent(lo);
+ b.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+
+ repopupate(lo);
+
+ }
+ });
+
+ }
+
+ int counter = 0;
+
+ protected void repopupate(Layout lo) {
+ lo.removeAllComponents();
+
+ for (int i = 0; i < 20; i++) {
+ lo.addComponent(new Label("tc" + (counter++)));
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2038.java b/uitest/src/com/vaadin/tests/tickets/Ticket2038.java
new file mode 100644
index 0000000000..c4714783a0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2038.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2038 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow w = new LegacyWindow("Testing for #2038");
+ setMainWindow(w);
+
+ final TextField tf = new TextField(
+ "Test-field, enter someting and click outside the field to activate");
+ tf.setRequired(true);
+ tf.setImmediate(true);
+ tf.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ + "valid, with error: " + tf.getErrorMessage(),
+ Notification.TYPE_WARNING_MESSAGE);
+ }
+ });
+ w.addComponent(tf);
+
+ final CheckBox b = new CheckBox(
+ "Field should use error message. (!) should be shown when invalid.",
+ false);
+ w.addComponent(b);
+ b.setImmediate(true);
+ b.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ tf.setRequiredError((Boolean) b.getValue() ? "Field must not be empty"
+ : null);
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java
new file mode 100644
index 0000000000..a7ca7b179f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java
@@ -0,0 +1,87 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class Ticket2040 extends com.vaadin.Application.LegacyApplication {
+
+ TextField f = new TextField();
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ main.getContent().setSizeFull();
+ ((MarginHandler) main.getContent()).setMargin(true);
+
+ setTheme("tests-tickets");
+
+ Accordion ts;
+
+ ts = new Accordion();
+ ts.setSizeFull();
+ ts.setWidth("300px");
+
+ TextArea l = new TextArea("DSFS");
+ l.setRows(2);
+ l.setStyleName("red");
+ l.setSizeFull();
+ ts.addTab(l, "100% h component", null);
+
+ Label testContent = new Label(
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");
+
+ testContent.setCaption("Introduction to test");
+
+ ts.addTab(testContent);
+
+ // main.addComponent(ts);
+
+ ts = new Accordion();
+ ts.setSizeFull();
+ ts.setHeight("200px");
+ ts.setWidth("300px");
+
+ l = new TextArea("DSFS");
+ l.setRows(2);
+ l.setStyleName("red");
+ l.setSizeFull();
+ ts.addTab(l, "200px h component", null);
+
+ testContent = new Label(
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");
+
+ testContent.setCaption("Introduction to test");
+
+ ts.addTab(testContent);
+
+ main.addComponent(ts);
+
+ ts = new Accordion();
+ ts.setSizeFull();
+ ts.setHeight("50%");
+ ts.setWidth("300px");
+
+ l = new TextArea("DSFS");
+ l.setRows(2);
+ l.setStyleName("red");
+ l.setSizeFull();
+ ts.addTab(l, "50% h component", null);
+
+ testContent = new Label(
+ "TabSheet by default uses caption, icon, errors etc. from Components. ");
+
+ testContent.setCaption("Introduction to test");
+
+ ts.addTab(testContent);
+
+ // main.addComponent(ts);
+
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2042.java b/uitest/src/com/vaadin/tests/tickets/Ticket2042.java
new file mode 100644
index 0000000000..49e999a601
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2042.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2042 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(1, 2);
+ layout.setHeight("2000px");
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ layout.addComponent(new Label("abc"));
+ layout.addComponent(new Button("B", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification n = new Notification("Test");
+ getMainWindow().showNotification(n);
+ }
+
+ }));
+
+ layout.addComponent(new Label("abc"));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2043.java b/uitest/src/com/vaadin/tests/tickets/Ticket2043.java
new file mode 100644
index 0000000000..8a10067455
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2043.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2043 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ Link l = new Link("Vaadin home (new 200x200 window, no decor, icon)",
+ new ExternalResource("http://www.vaadin.com"), "_blank", 200,
+ 200, Link.TARGET_BORDER_NONE);
+
+ layout.addComponent(l);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2048.java b/uitest/src/com/vaadin/tests/tickets/Ticket2048.java
new file mode 100644
index 0000000000..5ac0480fe2
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2048.java
@@ -0,0 +1,105 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2048 extends Application.LegacyApplication {
+
+ private Embedded embedded;
+ private Panel p;
+ private VerticalLayout orderedLayout;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ // splitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
+ // getMainWindow().setContent(splitPanel);
+
+ // GridLayout layout = new GridLayout(10, 10);
+ // w.setContent(layout);
+ // gridLayout = new GridLayout(1, 1);
+ orderedLayout = new VerticalLayout();
+
+ getMainWindow().setContent(orderedLayout);
+ // getMainWindow().setContent(new GridLayout(1, 1));
+ getMainWindow().setSizeFull();
+ getMainWindow().getContent().setSizeFull();
+
+ createUI(orderedLayout);
+ // createUI(gridLayout);
+
+ }
+
+ private void createUI(Layout layout) {
+ // Button sw = new Button("Switch", new ClickListener() {
+ //
+ // public void buttonClick(ClickEvent event) {
+ // Layout l = getMainWindow().getLayout();
+ // if (l == orderedLayout) {
+ // getMainWindow().setContent(gridLayout);
+ // } else {
+ // getMainWindow().setContent(orderedLayout);
+ // }
+ //
+ // }
+ // });
+ // layout.addComponent(sw);
+
+ Layout ol = new GridLayout(1, 2);
+ p = new Panel("Panel", ol);
+ p.setSizeFull();
+ Label l = new Label("Spacer");
+ l.setHeight("400px");
+ p.addComponent(l);
+
+ embedded = new Embedded(null, new ThemeResource(
+ "icons/64/folder-add.png"));
+ layout.addComponent(embedded);
+ Button b = new Button(
+ "Replace image with new embedded component (flashes)",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Embedded newEmbedded = new Embedded(null,
+ new ThemeResource("icons/64/folder-add.png"));
+ getMainWindow().getContent().replaceComponent(embedded,
+ newEmbedded);
+ embedded = newEmbedded;
+
+ }
+
+ });
+ p.addComponent(b);
+
+ b = new Button("Change image source (is fine)", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String img = "folder-add";
+ if (((ThemeResource) embedded.getSource()).getResourceId()
+ .contains("folder-add")) {
+ img = "folder-delete";
+ }
+ embedded.setSource(new ThemeResource("icons/64/" + img + ".png"));
+
+ }
+
+ });
+
+ p.addComponent(b);
+ layout.addComponent(p);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2051.java b/uitest/src/com/vaadin/tests/tickets/Ticket2051.java
new file mode 100644
index 0000000000..1660f00d88
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2051.java
@@ -0,0 +1,44 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class Ticket2051 extends Application.LegacyApplication {
+
+ private static final Object P1 = new Object();
+ private static final Object P2 = new Object();
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ Table t = new Table("This is a table");
+ t.addContainerProperty(P1, Component.class, null);
+ t.addContainerProperty(P2, Component.class, null);
+ t.setColumnHeaders(new String[] { "Col1", "Col2" });
+
+ Item i = t.addItem("1");
+ i.getItemProperty(P1).setValue(new TextField("abc"));
+ i.getItemProperty(P2).setValue(new Label("label"));
+ Item i2 = t.addItem("2");
+ i2.getItemProperty(P1).setValue(new Button("def"));
+ i2.getItemProperty(P2).setValue(new DateField());
+
+ layout.addComponent(t);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2053.java b/uitest/src/com/vaadin/tests/tickets/Ticket2053.java
new file mode 100644
index 0000000000..31973e4c92
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2053.java
@@ -0,0 +1,71 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2053 extends Application.LegacyApplication {
+
+ int childs = 0;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow main = new LegacyWindow("#2053");
+ setMainWindow(main);
+ Button nothing = new Button("Do nothing");
+ main.addComponent(nothing);
+ nothing.setDescription("Even though no action is taked, this window is refreshed to "
+ + "draw changes not originating from this window. Such changes include changes "
+ + "made by other browser-windows.");
+ Button add = new Button("Add a window", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ final String name = "Child " + (++childs);
+ LegacyWindow c = new LegacyWindow(name);
+
+ addWindow(c);
+ main.open(new ExternalResource(c.getURL()), "_new");
+ main.addComponent(new Label(name + " opened"));
+ final TextField tf = new TextField("Non immediate textfield");
+ c.addComponent(tf);
+ tf.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ main.addComponent(new Label(name + " send text:"
+ + tf.getValue()));
+ }
+ });
+ for (int i = 0; i < 3; i++) {
+ final String caption = "Slow button " + i;
+ c.addComponent(new Button(caption,
+ new Button.ClickListener() {
+ @Override
+ public synchronized void buttonClick(
+ ClickEvent event) {
+ try {
+ this.wait(2000);
+ } catch (InterruptedException e) {
+ }
+ main.addComponent(new Label(caption
+ + " pressed"));
+ }
+ }));
+ }
+
+ }
+ });
+ main.addComponent(add);
+ add.setDescription("This button opens a new browser window. Closing the browser "
+ + "window should do two things: 1) submit all unsubmitted state to server "
+ + "(print any changes to textfield to main window) and 2) call window.close()"
+ + " on the child window (print closed on the main window)");
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2060.java b/uitest/src/com/vaadin/tests/tickets/Ticket2060.java
new file mode 100644
index 0000000000..c9e91930bf
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2060.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2060 extends Application.LegacyApplication {
+
+ private Button button1;
+ private Button button2;
+ private Button button3;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ HorizontalLayout buttonLayout = new HorizontalLayout();
+ button1 = new Button("Button which is 50px wide");
+ button1.setWidth("50px");
+ button2 = new Button("Button without width");
+ button3 = new Button("Click to repaint buttons", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ button1.markAsDirty();
+ button2.markAsDirty();
+ button3.markAsDirty();
+
+ }
+
+ });
+
+ buttonLayout.addComponent(button1);
+ buttonLayout.addComponent(button2);
+ buttonLayout.addComponent(button3);
+
+ layout.addComponent(buttonLayout);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061.java
new file mode 100644
index 0000000000..4d6549bfbf
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2061.java
@@ -0,0 +1,129 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.HierarchicalContainer;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2061 extends Application.LegacyApplication {
+
+ private LegacyWindow mainWindow;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow("Ticket 2061");
+ mainWindow.setSizeFull();
+ mainWindow.getContent().setSizeFull();
+ setMainWindow(mainWindow);
+
+ MyTable table1 = new MyTable(24, "table1");
+ table1.loadTable(1000);
+
+ MyTable table2 = new MyTable(24, "table2");
+ table2.loadTable(1000);
+
+ MyTable table3 = new MyTable(24, "table3");
+ table3.loadTable(1000);
+
+ MyAccordion accordion = new MyAccordion(new Component[] { table1,
+ table2 }, "Test");
+
+ Tabs tab = new Tabs(new Component[] { accordion, table3 });
+
+ mainWindow.addComponent(tab);
+
+ }
+
+ public class MyTable extends CustomComponent implements ValueChangeListener {
+
+ private Table table = new Table();
+ private String[] columns;
+ private VerticalLayout layout = new VerticalLayout();
+
+ public MyTable(int columnNumber, String id) {
+ setId(id);
+ setCompositionRoot(layout);
+ setSizeFull();
+ columns = initializeColumns(columnNumber);
+ table.setWidth("100%");
+ table.setHeight("100%");
+ table.setColumnReorderingAllowed(true);
+ table.setColumnCollapsingAllowed(true);
+ table.setSelectable(true);
+ table.setMultiSelect(false);
+ table.setNullSelectionAllowed(false);
+ // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+ table.addListener(this);
+ table.setContainerDataSource(createContainer());
+ layout.addComponent(table);
+ }
+
+ public void loadTable(int itemNumber) {
+ table.removeAllItems();
+ for (int j = 0; j < itemNumber; j++) {
+ Item rowItem = table.addItem(j);
+ if (rowItem != null) {
+ for (int i = 0; i < columns.length; i++) {
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
+ }
+ }
+ }
+ }
+
+ private HierarchicalContainer createContainer() {
+ final HierarchicalContainer c = new HierarchicalContainer();
+ for (int i = 0; i < columns.length; i++) {
+ c.addContainerProperty(columns[i], String.class, null);
+ }
+ return c;
+ }
+
+ private String[] initializeColumns(int number) {
+ String[] columns = new String[number];
+ for (int i = 0; i < number; i++) {
+ columns[i] = "Column" + i;
+ }
+ return columns;
+ }
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+
+ }
+
+ }
+
+ public class Tabs extends TabSheet {
+
+ public Tabs(Component[] components) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+
+ }
+ }
+
+ public class MyAccordion extends Accordion {
+
+ public MyAccordion(Component[] components, String id) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ setId(id);
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java
new file mode 100644
index 0000000000..87d92ad9f6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java
@@ -0,0 +1,202 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.HierarchicalContainer;
+import com.vaadin.server.Sizeable;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
+import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+
+public class Ticket2061b extends Application.LegacyApplication implements
+ SelectedTabChangeListener {
+
+ private LegacyWindow mainWindow;
+ private Panel p;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow("Ticket 2061b");
+ mainWindow.setSizeFull();
+ AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow
+ .getContent();
+ mainLayout.setSizeFull();
+ mainLayout.setMargin(false);
+ setMainWindow(mainWindow);
+
+ VerticalSplitPanel sp = new VerticalSplitPanel();
+ sp.setSizeFull();
+ sp.setSplitPosition(20, Sizeable.UNITS_PIXELS);
+
+ p = new Panel("This is a panel");
+ p.setSizeFull();
+ Label label1 = new Label("This is a table!");
+ label1.setHeight("1500px");
+ label1.setWidth("1500px");
+ p.addComponent(label1);
+ p.setScrollTop(50);
+ // MyTable table1 = new MyTable(24, "table1");
+ // table1.loadTable(1000);
+
+ // MyTable table2 = new MyTable(24, "table2");
+ // table2.loadTable(1000);
+
+ // MyTable table3 = new MyTable(24, "table3");
+ // table3.loadTable(1000);
+
+ // MyAccordion accordion = new MyAccordion(new Component[] { table1,
+ // table2 }, "Test");
+
+ Label a = new Label("abc123");
+ TextField tf = new TextField("A large textfield");
+ tf.setHeight("2500px");
+ tf.setWidth("2500px");
+
+ TabsAcc tab = new TabsAcc(new Component[] { p, a, tf });
+ tab.addListener(this);
+
+ mainLayout.addComponent(sp);
+ sp.addComponent(new Label("C 1"));
+ // sp.addComponent(new Label("C 2"));
+ // sp.setHeight("100px");
+
+ sp.addComponent(tab);
+ // mainLayout.addComponent(new Label("Filler"));
+ // mainLayout.addComponent(tab);
+ // mainLayout.setExpandRatio(tab, 1.0f);
+ // sp.addComponent(new Label("Filler"));
+ // sp.addComponent(tab);
+
+ p = new Panel("This is a panel");
+ p.setWidth("2000px");
+ p.setHeight("2000px");
+ Panel p2 = new Panel("This is another panel");
+ p2.setWidth("2500px");
+ p2.setHeight("2500px");
+ label1 = new Label("This is a table!");
+ label1.setHeight("1500px");
+ label1.setWidth("1500px");
+ p2.addComponent(label1);
+ p.addComponent(p2);
+
+ tab.addTab(p, "Panel with panel", null);
+ }
+
+ public class MyTable extends CustomComponent implements ValueChangeListener {
+
+ private Table table = new Table();
+ private String[] columns;
+ private VerticalLayout layout = new VerticalLayout();
+
+ public MyTable(int columnNumber, String id) {
+ setId(id);
+ setCompositionRoot(layout);
+ setSizeFull();
+ columns = initializeColumns(columnNumber);
+ table.setWidth("100%");
+ table.setHeight("100%");
+ table.setColumnReorderingAllowed(true);
+ table.setColumnCollapsingAllowed(true);
+ table.setSelectable(true);
+ table.setMultiSelect(false);
+ table.setNullSelectionAllowed(false);
+ // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+ table.addListener(this);
+ table.setContainerDataSource(createContainer());
+ layout.addComponent(table);
+ }
+
+ public void loadTable(int itemNumber) {
+ table.removeAllItems();
+ for (int j = 0; j < itemNumber; j++) {
+ Item rowItem = table.addItem(j);
+ if (rowItem != null) {
+ for (int i = 0; i < columns.length; i++) {
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
+ }
+ }
+ }
+ }
+
+ private HierarchicalContainer createContainer() {
+ final HierarchicalContainer c = new HierarchicalContainer();
+ for (int i = 0; i < columns.length; i++) {
+ c.addContainerProperty(columns[i], String.class, null);
+ }
+ return c;
+ }
+
+ private String[] initializeColumns(int number) {
+ String[] columns = new String[number];
+ for (int i = 0; i < number; i++) {
+ columns[i] = "Column" + i;
+ }
+ return columns;
+ }
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+
+ }
+
+ }
+
+ public class Tabs extends TabSheet {
+
+ public Tabs(Component[] components) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+
+ }
+
+ }
+
+ public class TabsAcc extends Accordion {
+
+ public TabsAcc(Component[] components) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+
+ }
+
+ }
+
+ public class MyAccordion extends Accordion {
+
+ public MyAccordion(Component[] components, String id) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ setId(id);
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+ }
+ }
+
+ @Override
+ public void selectedTabChange(SelectedTabChangeEvent event) {
+ p.setScrollTop(10);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java
new file mode 100644
index 0000000000..5cb041788b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java
@@ -0,0 +1,150 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.HierarchicalContainer;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
+import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2061c extends Application.LegacyApplication implements
+ SelectedTabChangeListener {
+
+ private LegacyWindow mainWindow;
+ private Panel p;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow("Vaadin");
+ mainWindow.setSizeFull();
+ mainWindow.getContent().setSizeFull();
+ setMainWindow(mainWindow);
+
+ VerticalLayout ol = new VerticalLayout();
+ ol.setWidth("200px");
+ ol.setHeight("200px");
+
+ VerticalLayout ol2 = new VerticalLayout();
+ ol2.setSizeFull();
+
+ p = new Panel("This is a panel");
+ p.setSizeFull();
+
+ Label label1 = new Label("This is a table!");
+ label1.setHeight("1500px");
+ label1.setWidth("1500px");
+ p.setScrollTop(50);
+
+ p.addComponent(label1);
+ ol2.addComponent(p);
+ ol.addComponent(ol2);
+
+ Label a = new Label("abc123");
+ a.setCaption("Label a");
+ ol.setCaption("OL");
+ Tabs tab = new Tabs(new Component[] { a, ol });
+ tab.addListener(this);
+ mainWindow.addComponent(tab);
+
+ }
+
+ public class MyTable extends CustomComponent implements ValueChangeListener {
+
+ private Table table = new Table();
+ private String[] columns;
+ private VerticalLayout layout = new VerticalLayout();
+
+ public MyTable(int columnNumber, String id) {
+ setId(id);
+ setCompositionRoot(layout);
+ setSizeFull();
+ columns = initializeColumns(columnNumber);
+ table.setWidth("100%");
+ table.setHeight("100%");
+ table.setColumnReorderingAllowed(true);
+ table.setColumnCollapsingAllowed(true);
+ table.setSelectable(true);
+ table.setMultiSelect(false);
+ table.setNullSelectionAllowed(false);
+ // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+ table.addListener(this);
+ table.setContainerDataSource(createContainer());
+ layout.addComponent(table);
+ }
+
+ public void loadTable(int itemNumber) {
+ table.removeAllItems();
+ for (int j = 0; j < itemNumber; j++) {
+ Item rowItem = table.addItem(j);
+ if (rowItem != null) {
+ for (int i = 0; i < columns.length; i++) {
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
+ }
+ }
+ }
+ }
+
+ private HierarchicalContainer createContainer() {
+ final HierarchicalContainer c = new HierarchicalContainer();
+ for (int i = 0; i < columns.length; i++) {
+ c.addContainerProperty(columns[i], String.class, null);
+ }
+ return c;
+ }
+
+ private String[] initializeColumns(int number) {
+ String[] columns = new String[number];
+ for (int i = 0; i < number; i++) {
+ columns[i] = "Column" + i;
+ }
+ return columns;
+ }
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+
+ }
+
+ }
+
+ public class Tabs extends TabSheet {
+
+ public Tabs(Component[] components) {
+ this.setWidth("100%");
+ // this.setHeight("100%");
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+ }
+ }
+
+ public class MyAccordion extends Accordion {
+
+ public MyAccordion(Component[] components, String id) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ setId(id);
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+ }
+ }
+
+ @Override
+ public void selectedTabChange(SelectedTabChangeEvent event) {
+ p.setScrollTop(10);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java
new file mode 100644
index 0000000000..9b2fe05514
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class Ticket2062 extends Application.LegacyApplication {
+ private static final Object P1 = new Object();
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow("Ticket2062"));
+ getMainWindow().setSizeFull();
+
+ HorizontalSplitPanel p = new HorizontalSplitPanel();
+ p.setSizeFull();
+ getMainWindow().setContent(p);
+
+ TextField tf1 = new TextField("Tab 1");
+ tf1.setValue("Field 1");
+ tf1.setSizeFull();
+
+ Table t = new Table("Table");
+ t.addContainerProperty(P1, String.class, "");
+ t.setSizeFull();
+
+ TabSheet tabSheet = new TabSheet();
+ tabSheet.setWidth("300px");
+ tabSheet.setHeight("300px");
+
+ tabSheet.addComponent(tf1);
+ tabSheet.addComponent(t);
+
+ getMainWindow().addComponent(tabSheet);
+
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2083.java b/uitest/src/com/vaadin/tests/tickets/Ticket2083.java
new file mode 100644
index 0000000000..87bea00023
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2083.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2083 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ Panel p = new Panel(
+ "This is a panel with a longer caption than it should have");
+ p.setWidth("100px");
+ p.getContent().addComponent(new Label("Contents"));
+ layout.addComponent(p);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2090.java b/uitest/src/com/vaadin/tests/tickets/Ticket2090.java
new file mode 100644
index 0000000000..2f311b9428
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2090.java
@@ -0,0 +1,62 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2090 extends Application.LegacyApplication {
+
+ Label label = new Label();
+ Button target = new Button();
+ LegacyWindow w = new LegacyWindow("#2090");
+
+ @Override
+ public void init() {
+ setMainWindow(w);
+ final TextField width = new TextField("Width");
+ width.setImmediate(true);
+ final TextField height = new TextField("Height");
+ height.setImmediate(true);
+ w.addComponent(width);
+ w.addComponent(height);
+ w.addComponent(label);
+ w.addComponent(target);
+ height.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ target.setHeight(height.getValue());
+ height.setComponentError(null);
+ updateLabel();
+ } catch (Exception e) {
+ height.setComponentError(new UserError(e.getMessage()));
+ }
+ }
+ });
+ width.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ target.setWidth(width.getValue());
+ width.setComponentError(null);
+ updateLabel();
+ } catch (Exception e) {
+ width.setComponentError(new UserError(e.getMessage()));
+ }
+ }
+ });
+
+ }
+
+ private void updateLabel() {
+ label.setValue("width: " + target.getWidth()
+ + target.getWidthUnits().getSymbol() + ", height: "
+ + target.getHeight() + target.getHeightUnits().getSymbol());
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2095.java b/uitest/src/com/vaadin/tests/tickets/Ticket2095.java
new file mode 100644
index 0000000000..53f2aac79e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2095.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2095 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ // uncomment to workaround iorderedlayout bug in current trunk
+ // w.setContent(new ExpandLayout());
+ w.getContent().setSizeFull();
+
+ Embedded em = new Embedded();
+ em.setType(Embedded.TYPE_BROWSER);
+ em.setSource(new ExternalResource("../statictestfiles/ticket2095.html"));
+ em.setId("MYIFRAME");
+
+ em.setSizeFull();
+
+ w.addComponent(em);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2098.java b/uitest/src/com/vaadin/tests/tickets/Ticket2098.java
new file mode 100644
index 0000000000..a8a3e22d2b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2098.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+
+public class Ticket2098 extends Application.LegacyApplication {
+
+ private static final String info = "First tab hidden, second should initially be selected";
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ w.addComponent(new Label(info));
+ createUI(w);
+ }
+
+ private void createUI(LegacyWindow w) {
+ TabSheet ts = new TabSheet();
+ Label l1 = new Label("111");
+ Label l2 = new Label("222");
+ Label l3 = new Label("333");
+ Label l4 = new Label("444");
+
+ ts.addTab(l1, "1", null);
+ ts.addTab(l2, "2", null);
+ ts.addTab(l3, "3", null);
+ ts.addTab(l4, "4", null);
+
+ l1.setVisible(false);
+
+ w.addComponent(ts);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2099.java b/uitest/src/com/vaadin/tests/tickets/Ticket2099.java
new file mode 100644
index 0000000000..2bba0504a5
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2099.java
@@ -0,0 +1,80 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class Ticket2099 extends Application.LegacyApplication {
+
+ private Label l1, l2, l3;
+ private VerticalLayout ol1, ol2, ol3;
+ private Window popup;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout layout = new GridLayout(10, 10);
+ w.setContent(layout);
+ createUI(layout);
+ }
+
+ private void createUI(GridLayout layout) {
+ Button b = new Button("Show popup", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getMainWindow().addWindow(popup);
+ // popup.setVisible(true);
+ }
+
+ });
+ popup = createPopup();
+ getMainWindow().addWindow(popup);
+
+ layout.addComponent(b);
+ layout.addComponent(new Button("Hide label '222'", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ l2.setVisible(!l2.isVisible());
+ }
+
+ }));
+
+ }
+
+ private Window createPopup() {
+ Window w = new Window("Popup");
+ TabSheet ts = new TabSheet();
+ ol1 = new VerticalLayout();
+ ol2 = new VerticalLayout();
+ ol3 = new VerticalLayout();
+ l1 = new Label("111");
+ l2 = new Label("222");
+ l3 = new Label("333");
+
+ ol1.addComponent(l1);
+ ol2.addComponent(l2);
+ ol3.addComponent(l3);
+
+ ts.addTab(ol1, "1", null);
+ ts.addTab(ol2, "2", null);
+ ts.addTab(ol3, "3", null);
+
+ // l1.setVisible(false);
+ // ts.setSelectedTab(l3);
+
+ w.addComponent(ts);
+
+ return w;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2101.java b/uitest/src/com/vaadin/tests/tickets/Ticket2101.java
new file mode 100644
index 0000000000..c29eaaf453
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2101.java
@@ -0,0 +1,21 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2101 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ Button b = new Button(
+ "Button with a long text which will not fit on 50 pixels");
+ b.setWidth("50px");
+
+ w.getContent().addComponent(b);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2103.java b/uitest/src/com/vaadin/tests/tickets/Ticket2103.java
new file mode 100644
index 0000000000..576fe03d87
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2103.java
@@ -0,0 +1,100 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.HierarchicalContainer;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2103 extends Application.LegacyApplication {
+ private LegacyWindow mainWindow;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow(getClass().getSimpleName());
+ mainWindow.setContent(new VerticalLayout());
+ mainWindow.setSizeFull();
+ mainWindow.getContent().setSizeFull();
+
+ MyTable table1 = new MyTable(4, "table1");
+ table1.loadTable(100);
+ MyTable table2 = new MyTable(4, "table2");
+ table2.loadTable(100);
+
+ MyAccordion a = new MyAccordion(new Component[] { table1, table2 },
+ "FDSF");
+ mainWindow.addComponent(a);
+ setMainWindow(mainWindow);
+ // mainWindow.addComponent(table1);
+
+ }
+
+ public class MyAccordion extends Accordion {
+
+ public MyAccordion(Component[] components, String id) {
+ this.setWidth("100%");
+ this.setHeight("100%");
+ setId(id);
+ for (int i = 0; i < components.length; i++) {
+ this.addTab(components[i], components[i].getId(), null);
+ }
+ }
+ }
+
+ public class MyTable extends Table {
+
+ private Table table = this;
+ private String[] columns;
+ private VerticalLayout layout = new VerticalLayout();
+
+ public MyTable(int columnNumber, String id) {
+ setId(id);
+ setSizeFull();
+ columns = initializeColumns(columnNumber);
+ table.setWidth("100%");
+ table.setHeight("100%");
+ table.setColumnReorderingAllowed(true);
+ table.setColumnCollapsingAllowed(true);
+ table.setSelectable(true);
+ table.setMultiSelect(false);
+ table.setNullSelectionAllowed(false);
+ // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+ table.setContainerDataSource(createContainer());
+ layout.addComponent(table);
+ }
+
+ public void loadTable(int itemNumber) {
+ table.removeAllItems();
+ for (int j = 0; j < itemNumber; j++) {
+ Item rowItem = table.addItem(j);
+ if (rowItem != null) {
+ for (int i = 0; i < columns.length; i++) {
+ rowItem.getItemProperty(columns[i]).setValue(
+ "Value" + j);
+ }
+ }
+ }
+ }
+
+ private HierarchicalContainer createContainer() {
+ final HierarchicalContainer c = new HierarchicalContainer();
+ for (int i = 0; i < columns.length; i++) {
+ c.addContainerProperty(columns[i], String.class, null);
+ }
+ return c;
+ }
+
+ private String[] initializeColumns(int number) {
+ String[] columns = new String[number];
+ for (int i = 0; i < number; i++) {
+ columns[i] = "Column" + i;
+ }
+ return columns;
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2104.java b/uitest/src/com/vaadin/tests/tickets/Ticket2104.java
new file mode 100644
index 0000000000..0dba639712
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2104.java
@@ -0,0 +1,133 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.event.ItemClickEvent;
+import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Tree;
+
+public class Ticket2104 extends Application.LegacyApplication {
+
+ private static final Label info = new Label(
+ "Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)",
+ ContentMode.RAW);
+
+ Tree tree = new Tree();
+ Table table = new Table();
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ main.addComponent(info);
+
+ HorizontalLayout ol = new HorizontalLayout();
+ main.addComponent(ol);
+ CheckBox cb = new CheckBox("immediate", new MethodProperty<Boolean>(
+ tree, "immediate"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("selectable", new MethodProperty<Boolean>(tree,
+ "selectable"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("nullsel", new MethodProperty<Boolean>(tree,
+ "nullSelectionAllowed"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("multi", new MethodProperty<Boolean>(tree,
+ "multiSelect"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("icon");
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (tree.getItemIconPropertyId() == null) {
+ tree.setItemIconPropertyId("icon");
+ } else {
+ tree.setItemIconPropertyId(null);
+ }
+
+ }
+ });
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+
+ main.addComponent(tree);
+ tree.setImmediate(true);
+ tree.setNullSelectionAllowed(false);
+ tree.addItem("UI 1");
+ tree.addItem("1. Child 1");
+ tree.setParent("1. Child 1", "UI 1");
+ tree.addItem("1. Child 2");
+ tree.setParent("1. Child 2", "UI 1");
+ tree.addItem("UI 2");
+ tree.addItem("2. Child 1");
+ tree.setParent("2. Child 1", "UI 2");
+ tree.addItem("2. Child 2");
+ tree.setParent("2. Child 2", "UI 2");
+ tree.addContainerProperty("icon", ExternalResource.class,
+ new ExternalResource(
+ "http://www.itmill.com/res/images/itmill_logo.gif"));
+
+ tree.addListener(new ItemClickListener() {
+ @Override
+ public void itemClick(ItemClickEvent event) {
+ getMainWindow().addComponent(
+ new Label(event.toString() + " // " + event.getItemId()
+ + "//" + event.getSource()));
+
+ }
+ });
+
+ ol = new HorizontalLayout();
+ main.addComponent(ol);
+ cb = new CheckBox("immediate", new MethodProperty<Boolean>(table,
+ "immediate"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("selectable", new MethodProperty<Boolean>(table,
+ "selectable"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("nullsel", new MethodProperty<Boolean>(table,
+ "nullSelectionAllowed"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ cb = new CheckBox("multi", new MethodProperty<Boolean>(table,
+ "multiSelect"));
+ cb.setImmediate(true);
+ ol.addComponent(cb);
+ main.addComponent(table);
+ table.setWidth("150px");
+ table.setImmediate(true);
+ table.setSelectable(true);
+ table.setNullSelectionAllowed(false);
+ for (int i = 0; i < 10; i++) {
+ table.addItem("Item " + i);
+ }
+ table.addListener(new ItemClickListener() {
+ @Override
+ public void itemClick(ItemClickEvent event) {
+ getMainWindow().addComponent(
+ new Label(event.toString() + " // " + event.getItemId()
+ + "//" + event.getSource()));
+
+ }
+ });
+ table.addContainerProperty("Column", String.class, "value");
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2106.java b/uitest/src/com/vaadin/tests/tickets/Ticket2106.java
new file mode 100644
index 0000000000..9d6e198f03
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2106.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Date;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2106 extends Application.LegacyApplication {
+
+ private static CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages();
+ static {
+ // We will forward the user to www.vaadin.com when the session expires
+ msgs.setSessionExpiredURL("http://www.vaadin.com");
+ msgs.setSessionExpiredMessage(null);
+ msgs.setSessionExpiredCaption(null);
+ }
+
+ public static Application.SystemMessages getSystemMessages() {
+ return msgs;
+ }
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow("#2106"));
+ getMainWindow().addComponent(
+ new Button("Do nothing", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getMainWindow().addComponent(
+ new Label("Last time did nothing: "
+ + new Date()));
+ }
+ }));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2107.java b/uitest/src/com/vaadin/tests/tickets/Ticket2107.java
new file mode 100644
index 0000000000..37d570546b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2107.java
@@ -0,0 +1,59 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Validator;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2107 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow w = new LegacyWindow("Testing for #2107");
+ setMainWindow(w);
+
+ final TextField tf = new TextField(
+ "Required field that validated the input");
+ tf.setDescription("Enter someting and click outside the field to activate");
+ tf.setRequired(true);
+ tf.setImmediate(true);
+ tf.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ + "valid, with error: " + tf.getErrorMessage(),
+ Notification.TYPE_WARNING_MESSAGE);
+ }
+ });
+ tf.addValidator(new Validator() {
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (value == null || value.toString().length() <= 3) {
+ throw new InvalidValueException(
+ "Text length must exceed 3 characters");
+ }
+ }
+ });
+ w.addComponent(tf);
+
+ final CheckBox b = new CheckBox(
+ "Field should use error message. (!) should be shown when empty.",
+ false);
+ w.addComponent(b);
+ b.setImmediate(true);
+ b.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ tf.setRequiredError(b.getValue() ? "Field must not be empty"
+ : null);
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2117.java b/uitest/src/com/vaadin/tests/tickets/Ticket2117.java
new file mode 100644
index 0000000000..fb0d62ba85
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2117.java
@@ -0,0 +1,62 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2117 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(createWindow());
+ }
+
+ @Override
+ public LegacyWindow getWindow(String name) {
+
+ // If we already have the requested window, use it
+ LegacyWindow w = super.getWindow(name);
+ if (w == null) {
+
+ // If no window found, create it
+ w = createExtraWindow(name);
+ w.open(new ExternalResource(w.getURL()));
+ }
+ return w;
+ }
+
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
+ w.setName(name);
+ addWindow(w);
+ w.addComponent(new Label(
+ "This window has been created on fly for name: " + name));
+ w.addComponent(new Label("It has also been redirected to " + w.getURL()
+ + " to support reloading"));
+ w.addComponent(new Button("button", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ w.showNotification("Button clicked");
+ w.addComponent(new Label("clicked"));
+ }
+ }));
+ return w;
+ }
+
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
+ w.addComponent(new Label(
+ "Click this link: <a target=\"_blank\" href='"
+ + getURL().toExternalForm()
+ + "'>"
+ + getURL().toExternalForm()
+ + "</a> which opens new windows to this uri. They should end up having a separate Window and URL.",
+ ContentMode.XHTML));
+ return w;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2119.java b/uitest/src/com/vaadin/tests/tickets/Ticket2119.java
new file mode 100644
index 0000000000..38cc567295
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2119.java
@@ -0,0 +1,97 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Test case for Ticket 2119.
+ */
+public class Ticket2119 extends Application.LegacyApplication {
+
+ private ObjectProperty<String> globalValue;
+
+ @Override
+ public void init() {
+ globalValue = new ObjectProperty<String>(null, String.class);
+ LegacyWindow main = createWindow();
+ setMainWindow(main);
+ }
+
+ @Override
+ public LegacyWindow getWindow(String name) {
+ if (!isRunning()) {
+ return null;
+ }
+ // If we already have the requested window, use it
+ LegacyWindow w = super.getWindow(name);
+ if (w == null) {
+ // If no window found, create it
+ w = createWindow();
+ addWindow(w);
+ w.open(new ExternalResource(w.getURL()));
+ }
+ return w;
+ }
+
+ private LegacyWindow createWindow() {
+ LegacyWindow main = new LegacyWindow("Test for ticket XXX");
+ main.setContent(testLayout());
+ return main;
+ }
+
+ private Layout testLayout() {
+ final Layout layout = new VerticalLayout();
+ final Label label = new Label(
+ "Instructions to reproduce:\n"
+ + " - Open this application in two browser windows\n"
+ + " - Click the Button in first Window\n"
+ + " - Go to the second Window\n"
+ + " - Click the arrow in the Select\n"
+ + " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
+ label.setContentMode(ContentMode.PREFORMATTED);
+ layout.addComponent(label);
+
+ final Select select = new Select("Test Select");
+ select.setWidth("100px");
+ select.setImmediate(true);
+ select.setNullSelectionAllowed(false);
+ select.addItem("1");
+ select.addItem("2");
+ select.addItem("3");
+
+ final ObjectProperty<String> valueProperty = new ObjectProperty<String>(
+ "1", String.class);
+ select.setPropertyDataSource(valueProperty);
+ layout.addComponent(select);
+
+ globalValue.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(Property.ValueChangeEvent event) {
+ Object value = event.getProperty().getValue();
+ valueProperty.setValue((null != value) ? value.toString()
+ : null);
+ }
+ });
+
+ final Button changeValueButton = new Button("Change Value to 2");
+ changeValueButton.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ globalValue.setValue("2");
+ }
+ });
+
+ layout.addComponent(changeValueButton);
+
+ return layout;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2125.java b/uitest/src/com/vaadin/tests/tickets/Ticket2125.java
new file mode 100644
index 0000000000..bc1f886418
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2125.java
@@ -0,0 +1,64 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.CellStyleGenerator;
+import com.vaadin.ui.Table.ColumnGenerator;
+
+public class Ticket2125 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(new MainWindow("Ticket2125"));
+
+ }
+
+ class MainWindow extends LegacyWindow {
+ MainWindow(String caption) {
+ super(caption);
+
+ addComponent(new Label(
+ "Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells"));
+
+ Table table = new Table();
+ table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
+ addComponent(table);
+ for (int i = 0; i < 50; i++) {
+ table.addItem(new Integer(i));
+ }
+ table.addContainerProperty("String", String.class, "a string");
+ table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE);
+ table.addGeneratedColumn("Generated", new ColumnGenerator() {
+ @Override
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ return new Label("Item " + itemId);
+ }
+ });
+ table.setCellStyleGenerator(new CellStyleGenerator() {
+ @Override
+ public String getStyle(Object itemId, Object propertyId) {
+ if (new Integer(4).equals(itemId)) {
+ if (propertyId == null) {
+ return "MYROW";
+ } else {
+ return "MYCELL";
+ }
+ }
+ return null;
+ }
+
+ });
+ CheckBox b = new CheckBox("editmode", new MethodProperty<Boolean>(
+ table, "editable"));
+ b.setImmediate(true);
+ addComponent(b);
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java
new file mode 100644
index 0000000000..d49c73ea5f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java
@@ -0,0 +1,63 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+/**
+ *
+ * Toggling container with an empty one may result duplicate header cell in
+ * client.
+ *
+ */
+public class Ticket2126 extends com.vaadin.Application.LegacyApplication {
+
+ LegacyWindow main = new LegacyWindow();
+ Table table = new Table();
+
+ @Override
+ public void init() {
+ setMainWindow(main);
+
+ final IndexedContainer container1 = new IndexedContainer();
+ container1.addContainerProperty("text", Component.class, null);
+ final IndexedContainer container2 = new IndexedContainer();
+
+ // Case #2 Try to comment the following line for another type of strange
+ // behaviour
+ container2.addContainerProperty("text", Component.class, null);
+
+ for (int i = 0; i < 100; i++) {
+ Item item = container1.addItem(i);
+ item.getItemProperty("text").setValue(new Label("Test " + i));
+ }
+
+ table.setContainerDataSource(container1);
+
+ // workaround for case #2
+ // table.setWidth("300px");
+ // table.setHeight("300px");
+
+ Button refreshTable = new Button("Switch table container");
+ refreshTable.addListener(new Button.ClickListener() {
+ boolean full = true;
+
+ @Override
+ public void buttonClick(Button.ClickEvent e) {
+ if (full) {
+ table.setContainerDataSource(container2);
+ } else {
+ table.setContainerDataSource(container1);
+ }
+ full = !full;
+ }
+ });
+
+ main.addComponent(table);
+ main.addComponent(refreshTable);
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2151.java b/uitest/src/com/vaadin/tests/tickets/Ticket2151.java
new file mode 100644
index 0000000000..721bdf3c9f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2151.java
@@ -0,0 +1,118 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2151 extends Application.LegacyApplication {
+
+ private Label status;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ Button b = new Button("This is a button");
+ CheckBox cb = new CheckBox("This is a checkbox");
+ cb.setImmediate(true);
+ setTheme("tests-tickets");
+ layout.setStyleName("mylayout");
+ status = new Label("Result:");
+ layout.addComponent(status);
+ layout.setSpacing(true);
+ layout.setMargin(true);
+
+ layout.addComponent(b);
+ layout.addComponent(cb);
+
+ layout.addComponent(new Label("a"));
+ layout.addComponent(new Label("b"));
+ layout.addComponent(new Label("c"));
+
+ checkButton(Button.class);
+ checkCheckBox(CheckBox.class);
+ checkDataBinding(CheckBox.class);
+
+ }
+
+ private void checkButton(Class<? extends Button> class1) {
+ boolean ok = false;
+ AbstractComponent b;
+ try {
+ b = class1.newInstance();
+ b.setCaption("Button of type " + class1.getSimpleName());
+ ok = true;
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+
+ if (ok) {
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": OK");
+ } else {
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": FAILED");
+ }
+
+ }
+
+ private void checkCheckBox(Class<? extends CheckBox> class1) {
+ boolean ok = false;
+ CheckBox b;
+ try {
+ b = class1.newInstance();
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ return;
+ }
+
+ b.setCaption("Button of type " + class1.getSimpleName());
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": OK");
+
+ }
+
+ private void checkDataBinding(Class<? extends AbstractField> class1) {
+ boolean ok = false;
+ AbstractField b;
+ try {
+ b = class1.newInstance();
+ b.setCaption("Button of type " + class1.getSimpleName());
+ try {
+ b.setBuffered(false);
+ ObjectProperty<String> prop = new ObjectProperty<String>(
+ "ABC 123");
+ /*
+ * This should throw an exception or somehow tell that the
+ * property was invalid (wrong type). See #2223.
+ */
+ b.setPropertyDataSource(prop);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ return;
+ }
+
+ if (ok) {
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + "/DB: OK");
+ } else {
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + "/DB: FAILED");
+ }
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2157.java b/uitest/src/com/vaadin/tests/tickets/Ticket2157.java
new file mode 100644
index 0000000000..b8f75fc279
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2157.java
@@ -0,0 +1,109 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2157 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ VerticalLayout ol;
+ Panel p;
+ ComboBox cb;
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox without width");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ // cb.setWidth("100%");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox without width with caption");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ // cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ //
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100px wide");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100px wide with caption");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 500px wide");
+ // p.setWidth("500px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("500px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 500px wide with caption");
+ // p.setWidth("500px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("500px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100% wide");
+ p.setWidth("200px");
+ ol.setWidth("100%");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("100%");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100% wide with caption");
+ p.setWidth("200px");
+ ol.setWidth("100%");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("100%");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2178.java b/uitest/src/com/vaadin/tests/tickets/Ticket2178.java
new file mode 100644
index 0000000000..e64db69ced
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2178.java
@@ -0,0 +1,109 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2178 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ VerticalLayout ol;
+ Panel p;
+ ComboBox cb;
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox without width");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ // cb.setWidth("100%");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox without width with caption");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ // cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100px wide");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100px wide with caption");
+ // p.setWidth("100px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("100px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 500px wide");
+ // p.setWidth("500px");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("500px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 500px wide with caption");
+ // p.setWidth("500px");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("500px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100% wide inside 200px panel");
+ p.setWidth("200px");
+ ol.setWidth("100%");
+ cb = new ComboBox();
+ // cb.setCaption("A combobox");
+ cb.setWidth("100%");
+ // cb.setWidth("500px");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ ol = new VerticalLayout();
+ p = new Panel(ol);
+ p.setCaption("Combobox 100% wide inside 200px panel with caption");
+ p.setWidth("200px");
+ ol.setWidth("100%");
+ cb = new ComboBox();
+ cb.setCaption("A combobox");
+ cb.setWidth("100%");
+ p.addComponent(cb);
+ layout.addComponent(p);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2179.java b/uitest/src/com/vaadin/tests/tickets/Ticket2179.java
new file mode 100644
index 0000000000..622488dc0f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2179.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Validator;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2179 extends Application.LegacyApplication {
+
+ TextField f = new TextField("Test fiel ( must contain 1 & 2 )");
+ LegacyWindow main = new LegacyWindow("Dual validator test");
+
+ @Override
+ public void init() {
+
+ f.setImmediate(true);
+ f.setRequired(true);
+ f.addValidator(new ContainsValidator("1"));
+ f.addValidator(new ContainsValidator("2"));
+
+ setMainWindow(main);
+ main.addComponent(f);
+
+ f.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ main.showNotification("Test field is "
+ + (f.isValid() ? "valid" : "invalid"));
+ }
+ });
+
+ }
+
+ static class ContainsValidator implements Validator {
+ private final String c;
+
+ public ContainsValidator(String c) {
+ this.c = c;
+ }
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ if (value == null || !value.toString().contains(c)) {
+ throw new InvalidValueException("Value does not contain " + c);
+ }
+
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2180.java b/uitest/src/com/vaadin/tests/tickets/Ticket2180.java
new file mode 100644
index 0000000000..fb9332d100
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2180.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+
+public class Ticket2180 extends Application.LegacyApplication {
+
+ private LegacyWindow mainWindow;
+ private TabSheet tabSheet;
+
+ @Override
+ public void init() {
+ mainWindow = new LegacyWindow("Tabsheet should cause scrollbars");
+ setMainWindow(mainWindow);
+ // mainWindow.getLayout().setSizeFull();
+ tabSheet = new TabSheet();
+ // tabSheet.setWidth("100%");
+ Button button = new Button("Blah");
+ button.setWidth("100%");
+ Label label1 = new Label("Lorem ipsum");
+ Label label2 = new Label("Lorem");
+ Label label3 = new Label(
+ "Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10");
+
+ label3.setWidth("800px");
+ tabSheet.addTab(label1, "Tab 1", null);
+ tabSheet.addTab(label2, "Tab 2", null);
+ tabSheet.addTab(label3, "Tab 3", null);
+ tabSheet.addTab(new Label("a"), "Tab 4", null);
+ tabSheet.addTab(new Label("a"), "Tab 5", null);
+ tabSheet.addTab(new Label("a"), "Tab 6", null);
+ // mainWindow.addComponent(new Label("123"));
+ mainWindow.addComponent(tabSheet);
+ mainWindow.addComponent(button);
+ // mainWindow.addComponent(new Label("abc"));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2181.java b/uitest/src/com/vaadin/tests/tickets/Ticket2181.java
new file mode 100644
index 0000000000..b67fad52c0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2181.java
@@ -0,0 +1,106 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Random;
+import java.util.Set;
+
+import com.vaadin.Application;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2181 extends Application.LegacyApplication implements
+ Button.ClickListener {
+
+ // private static final Object PROPERTY_VALUE = new Object();
+ // private static final Object PROPERTY_CAPTION = new Object();
+
+ private static final String caption = "This is a caption which is very long and nice and perhaps sometimes should be clipped";
+ LegacyWindow main = new LegacyWindow("#2181 test");
+ TextField tf1 = new TextField(caption, "Test field - undefined width");
+ TextField tf2 = new TextField(caption, "Test field - 150px wide");
+ Button setButton = new Button("Set", this);
+ private Random random = new Random(123);
+ private OptionGroup options;
+
+ private static ArrayList<String> icons = new ArrayList<String>();
+ static {
+ icons.add("icons/64/ok.png");
+ icons.add("icons/64/arrow-down.png");
+ icons.add("icons/64/arrow-left.png");
+ icons.add("icons/64/arrow-right.png");
+ icons.add("icons/64/arrow-up.png");
+ }
+
+ @Override
+ public void init() {
+ setMainWindow(main);
+ VerticalLayout ol;
+ ol = new VerticalLayout();
+ ol.addComponent(tf1);
+ main.addComponent(ol);
+
+ ol = new VerticalLayout();
+ ol.setWidth("150px");
+ tf2.setWidth("150px");
+ ol.addComponent(tf2);
+ main.addComponent(ol);
+
+ main.addComponent(createSelection());
+ main.addComponent(setButton);
+ }
+
+ private Component createSelection() {
+ options = new OptionGroup();
+ options.addItem("Icon");
+ options.addItem("Caption");
+ options.addItem("Required");
+ options.addItem("Error");
+ options.setMultiSelect(true);
+ options.select("Caption");
+
+ // ol.addComponent(og);
+ return options;
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (event.getButton() == setButton) {
+ set();
+ }
+ }
+
+ private void set() {
+ @SuppressWarnings("unchecked")
+ Set<String> values = (Set<String>) options.getValue();
+ TextField[] tfs = new TextField[] { tf1, tf2 };
+ for (TextField tf : tfs) {
+ // Clear all
+ tf.setCaption(null);
+ tf.setComponentError(null);
+ tf.setRequired(false);
+ tf.setIcon(null);
+
+ for (String value : values) {
+ if (value.equals("Caption")) {
+ tf.setCaption(caption);
+ } else if (value.equals("Icon")) {
+ String timestamp = String.valueOf(new Date().getTime());
+ tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons
+ .size())) + "?" + timestamp));
+ } else if (value.equals("Required")) {
+ tf.setRequired(true);
+ } else if (value.equals("Error")) {
+ tf.setComponentError(new UserError("Nooooo..."));
+ }
+ }
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2186.java b/uitest/src/com/vaadin/tests/tickets/Ticket2186.java
new file mode 100644
index 0000000000..50b8a1f113
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2186.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2186 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow("Quick test");
+ setMainWindow(main);
+
+ HorizontalLayout base = new HorizontalLayout();
+ main.setContent(base);
+
+ VerticalLayout content = new VerticalLayout();
+
+ content.addComponent(new Label("Content."));
+ content.setWidth("500px");
+
+ Table table = new Table();
+
+ table.setPageLength(10);
+
+ table.setWidth("100%");
+
+ table.addContainerProperty("Lähettäjä", String.class, "");
+ table.addContainerProperty("Viestin tyyppi", String.class, "");
+
+ for (int i = 0; i < 15; i++) {
+
+ table.addItem(new Object[] { i + " Joku Ihminen", "Testiviesti" },
+
+ new Object());
+
+ }
+
+ content.addComponent(table);
+
+ Panel right = new Panel("Panel");
+
+ right.addComponent(new Label("Some basic text might show up here."));
+
+ base.addComponent(content);
+
+ base.addComponent(right);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2204.java b/uitest/src/com/vaadin/tests/tickets/Ticket2204.java
new file mode 100644
index 0000000000..24c4d6e8b9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2204.java
@@ -0,0 +1,180 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.AbstractSplitPanel;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.FormFieldFactory;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+
+public class Ticket2204 extends Application.LegacyApplication {
+
+ private final List<RichTextArea> textAreas = new ArrayList<RichTextArea>();
+ private TabSheet ts;
+ private final Map<Component, Component> containerToComponent = new HashMap<Component, Component>();
+ private RichTextArea rta;
+ private final List<Class<? extends Component>> classes = new ArrayList<Class<? extends Component>>();
+ protected RichTextArea formTextArea;
+
+ @Override
+ public void init() {
+ classes.add(VerticalLayout.class);
+ classes.add(HorizontalLayout.class);
+ classes.add(GridLayout.class);
+ classes.add(Accordion.class);
+ classes.add(TabSheet.class);
+ classes.add(Panel.class);
+ classes.add(VerticalSplitPanel.class);
+ classes.add(HorizontalSplitPanel.class);
+ classes.add(Form.class);
+
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ ts = new TabSheet();
+ layout.addComponent(ts);
+
+ for (Class<? extends Component> c : classes) {
+ ts.addTab(createComponent(c), c.getSimpleName(), null);
+ }
+ rta = new RichTextArea();
+ rta.setVisible(false);
+ ts.addTab(rta, "Hidden rta", null);
+
+ Button b = new Button("Show area", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ showHide();
+ }
+ });
+
+ layout.addComponent(b);
+
+ b = new Button("Show tab", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ showTab();
+ }
+ });
+
+ layout.addComponent(b);
+
+ }
+
+ protected void showTab() {
+ rta.setVisible(!rta.isVisible());
+
+ }
+
+ protected void showHide() {
+ Component c = containerToComponent.get(ts.getSelectedTab());
+ c.setVisible(!c.isVisible());
+ }
+
+ private Component createComponent(Class<? extends Component> c) {
+ RichTextArea textArea = new RichTextArea();
+ textArea.setVisible(false);
+ textArea.setCaption("This is the textArea");
+ textArea.setWidth("200px");
+ textArea.setHeight("100px");
+ textAreas.add(textArea);
+ Component cc = null;
+
+ try {
+ cc = c.newInstance();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return null;
+ }
+ // if (c == OrderedLayout.class) {
+ // cc = new VerticalLayout();
+ // } else
+ if (c == Accordion.class) {
+ // Label l = new Label("Filler");
+ // l.setCaption("Filler label");
+ // cc.addComponent(l);
+ }
+
+ if (c == Form.class) {
+ Form f = (Form) cc;
+ f.setFormFieldFactory(new FormFieldFactory() {
+
+ @Override
+ public Field<?> createField(Item item, Object propertyId,
+ Component uiContext) {
+ formTextArea = new RichTextArea();
+ formTextArea.setVisible(false);
+ return formTextArea;
+ }
+
+ });
+ f.setItemDataSource(new BeanItem<Object>(new Object() {
+ private int a;
+
+ @SuppressWarnings("unused")
+ public int getA() {
+ return a;
+ }
+
+ @SuppressWarnings("unused")
+ public void setA(int a) {
+ this.a = a;
+ }
+ }));
+ containerToComponent.put(f, formTextArea);
+ return f;
+ }
+ containerToComponent.put(cc, textArea);
+ if (cc instanceof ComponentContainer) {
+ ((ComponentContainer) cc).addComponent(textArea);
+ }
+
+ if (AbstractSplitPanel.class.isAssignableFrom(c)) {
+ AbstractSplitPanel sp = (AbstractSplitPanel) cc;
+ sp.setWidth("300px");
+ sp.setHeight("300px");
+ sp.addComponent(new Label("Label"));
+ textArea.setSizeFull();
+ }
+ if (c == Panel.class) {
+ Layout layout = (Layout) ((Panel) cc).getContent();
+ containerToComponent.put(cc, layout);
+ layout.setVisible(false);
+ textArea.setVisible(true);
+ return cc;
+ }
+
+ return cc;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2208.java b/uitest/src/com/vaadin/tests/tickets/Ticket2208.java
new file mode 100644
index 0000000000..f622f093ee
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2208.java
@@ -0,0 +1,70 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.CellStyleGenerator;
+import com.vaadin.ui.Table.ColumnGenerator;
+
+public class Ticket2208 extends Application.LegacyApplication {
+
+ private Table t;
+
+ @Override
+ public void init() {
+ LegacyWindow mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
+
+ t = new Table("A table");
+ t.addContainerProperty("col 1 (red)", String.class, "");
+ t.addContainerProperty("col 2", String.class, "");
+
+ t.setHeight("150px");
+ t.addGeneratedColumn("col 3 (green)", new ColumnGenerator() {
+
+ @Override
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ Item item = source.getItem(itemId);
+ String col1 = (String) item.getItemProperty("col 1 (red)")
+ .getValue();
+ String col2 = (String) item.getItemProperty("col 2").getValue();
+ return new Label(col1 + "-" + col2);
+ }
+ });
+
+ t.addContainerProperty("col 4", String.class, "");
+ t.setCellStyleGenerator(new CellStyleGenerator() {
+
+ @Override
+ public String getStyle(Object itemId, Object propertyId) {
+ if ("col 1 (red)".equals(propertyId)) {
+ return "red";
+ }
+
+ if ("col 3 (green)".equals(propertyId)) {
+ return "green";
+ }
+
+ return null;
+ }
+ });
+
+ t.addItem(new Object[] { "Col 1-1", "Col 2-1", "Col 4-1" },
+ new Object());
+ t.addItem(new Object[] { "Col 1-2", "Col 2-2", "Col 4-2" },
+ new Object());
+ t.addItem(new Object[] { "Col 1-3", "Col 2-3", "Col 4-3" },
+ new Object());
+
+ t.setColumnReorderingAllowed(true);
+ t.setColumnCollapsingAllowed(true);
+ setTheme("tests-tickets");
+ mainWindow.addComponent(t);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209.java
new file mode 100644
index 0000000000..ecad9a950a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2209.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2209 extends Application.LegacyApplication {
+
+ private GridLayout gl;
+ private ComboBox combo;
+ private Label labelLong;
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow());
+
+ gl = new GridLayout(1, 2);
+ gl.setStyleName("borders");
+ getMainWindow().addComponent(gl);
+ setTheme("tests-tickets");
+ combo = new ComboBox("Combo caption");
+ labelLong = new Label(
+ "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");
+ gl.addComponent(combo);
+ gl.addComponent(labelLong);
+
+ Button b = new Button("Add label text", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ labelLong.setValue(labelLong.getValue() + "-12345");
+ }
+
+ });
+ getMainWindow().addComponent(b);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java
new file mode 100644
index 0000000000..6eec0a7704
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2209OL extends Application.LegacyApplication {
+
+ private VerticalLayout gl;
+ private ComboBox combo;
+ private Label labelLong;
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow());
+ getMainWindow().getContent().setWidth("250px");
+ gl = new VerticalLayout();
+ gl.setStyleName("borders");
+ getMainWindow().addComponent(gl);
+ setTheme("tests-tickets");
+ combo = new ComboBox("Combo caption");
+ labelLong = new Label(
+ "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. "
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");
+ gl.addComponent(combo);
+ gl.addComponent(labelLong);
+
+ Button b = new Button("Add label text", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ labelLong.setValue(labelLong.getValue() + "-12345");
+ }
+
+ });
+ getMainWindow().addComponent(b);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java
new file mode 100644
index 0000000000..7f4082d0f8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2209OL2 extends Application.LegacyApplication {
+
+ private VerticalLayout gl;
+ private ComboBox combo;
+ private Label labelLong;
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow());
+ getMainWindow().getContent().setWidth("250px");
+ gl = new VerticalLayout();
+ gl.setSizeUndefined();
+ gl.setStyleName("borders");
+ getMainWindow().addComponent(gl);
+ setTheme("tests-tickets");
+ combo = new ComboBox("Combo caption");
+ labelLong = new Label(
+ "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. "
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
+ + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");
+ gl.addComponent(combo);
+ gl.addComponent(labelLong);
+
+ Button b = new Button("Add label text", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ labelLong.setValue(labelLong.getValue() + "-12345");
+ }
+
+ });
+ getMainWindow().addComponent(b);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2215.java b/uitest/src/com/vaadin/tests/tickets/Ticket2215.java
new file mode 100644
index 0000000000..f7099d88f4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2215.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+public class Ticket2215 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow());
+
+ VerticalLayout ol = new VerticalLayout();
+ Panel p = new Panel("Test");
+ p.addComponent(new Label("Panel1"));
+ p.setHeight("500px");
+ p.setWidth("500px");
+ p.setStyleName(Reindeer.PANEL_LIGHT);
+ ol.addComponent(p);
+ ol.addComponent(new Label("NextComponent"));
+
+ getMainWindow().addComponent(ol);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2221.java b/uitest/src/com/vaadin/tests/tickets/Ticket2221.java
new file mode 100644
index 0000000000..e3f1516fb8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2221.java
@@ -0,0 +1,92 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2221 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ layout.setSizeFull();
+ layout.addComponent(new Invoice());
+ }
+
+ public class Invoice extends CustomComponent {
+
+ Layout main = new VerticalLayout();
+
+ private TextField tf;
+
+ private Panel outerPanel;
+
+ private TextField tf2;
+
+ public Invoice() {
+ setSizeFull();
+
+ setCompositionRoot(main);
+ main.setSizeFull();
+ Button b = new Button("Switch textfield/panel",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Component visible = tf;
+
+ if (tf.isVisible()) {
+ visible = outerPanel;
+ }
+
+ outerPanel.setVisible(false);
+ tf.setVisible(false);
+
+ visible.setVisible(true);
+ }
+
+ });
+ main.addComponent(b);
+
+ tf = new TextField("TextField");
+ tf.setHeight("1000px");
+ tf.setWidth("1000px");
+
+ outerPanel = new Panel();
+ outerPanel.setCaption("A RichTextArea");
+ outerPanel.setVisible(false);
+ outerPanel.setHeight("1000px");
+ outerPanel.setWidth("1000px");
+
+ outerPanel.getContent().setSizeFull();
+ Panel innerPanel = new Panel("Inner panel");
+ innerPanel.setSizeFull();
+ outerPanel.addComponent(innerPanel);
+
+ tf2 = new TextField("A 2000x2000 textfield");
+ tf2.setWidth("2000px");
+ tf2.setHeight("2000px");
+
+ innerPanel.addComponent(tf2);
+ main.addComponent(outerPanel);
+ main.addComponent(tf);
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2222.java b/uitest/src/com/vaadin/tests/tickets/Ticket2222.java
new file mode 100644
index 0000000000..14024fda8b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2222.java
@@ -0,0 +1,64 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2222 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ HorizontalLayout horiz = new HorizontalLayout();
+ horiz.setSpacing(true);
+ horiz.setMargin(true);
+ horiz.setStyleName("ticket2222");
+
+ horiz.addComponent(new Label("Horiz spacing: 60px;"));
+ horiz.addComponent(new Label("Margin-left: 40px"));
+ horiz.addComponent(new Label("Margin-top: 100px;"));
+ horiz.addComponent(new Label("Margin-right: 20px;"));
+ horiz.addComponent(new Label("Margin-bottom: 30px;"));
+ horiz.addStyleName("borders");
+
+ VerticalLayout vert = new VerticalLayout();
+ vert.setSizeUndefined();
+ vert.setSpacing(true);
+ vert.setMargin(false);
+ vert.setStyleName("ticket2222");
+ vert.addComponent(new Label("Vert spacing: 50px;"));
+ vert.addComponent(new Label("No margins"));
+ vert.addComponent(new Label("label 3"));
+ vert.addStyleName("borders");
+
+ GridLayout gl = new GridLayout(3, 2);
+ gl.setStyleName("borders");
+ gl.setSpacing(true);
+ gl.setMargin(true);
+ gl.setStyleName("ticket2222");
+ gl.addComponent(new Label("Vert spacing: 50px; horiz 20px;"));
+ gl.addComponent(new Label("Margin-left: 40px"));
+ gl.addComponent(new Label("Margin-top: 100px;"));
+ gl.addComponent(new Label("Margin-right: 20px;"));
+ gl.addComponent(new Label("Margin-bottom: 30px;"));
+ gl.addComponent(new Label("label 3"));
+ gl.addStyleName("borders");
+
+ layout.addComponent(horiz);
+ layout.addComponent(new Label(" "));
+ layout.addComponent(vert);
+ layout.addComponent(new Label(" "));
+ layout.addComponent(gl);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
new file mode 100644
index 0000000000..f9c670708e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2227OrderedlayoutInTable extends
+ Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow();
+ Table t = new Table();
+ t.setWidth("500px");
+ t.setHeight("200px");
+ t.addContainerProperty("pno", String.class, "");
+ t.addContainerProperty("testi", String.class, "");
+ t.addContainerProperty("testi2", Layout.class, null);
+ t.addContainerProperty("komponentti", Component.class, null);
+ t.addContainerProperty("nimi", String.class, "");
+ t.setVisibleColumns(new Object[] { "pno", "testi", "testi2", "nimi" });
+
+ t.setSelectable(true);
+
+ Item i = t.addItem(1);
+ i.getItemProperty("pno").setValue("1");
+ i.getItemProperty("testi").setValue("12.12.08");
+ VerticalLayout ol = new VerticalLayout();
+ ol.setWidth("100%");
+ ol.setHeight(null);
+ ol.addComponent(new Label("monirivi testi"));
+ ol.addComponent(new Label("monirivi testi2"));
+
+ i.getItemProperty("testi2").setValue(ol);
+ i.getItemProperty("nimi").setValue("test");
+
+ w.addComponent(t);
+ setMainWindow(w);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2231.java b/uitest/src/com/vaadin/tests/tickets/Ticket2231.java
new file mode 100644
index 0000000000..21994bff60
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2231.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2231 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ layout.setSizeUndefined();
+ layout.setMargin(false);
+ layout.setStyleName("borders");
+ Label l = new Label("Margin-label");
+
+ l.setStyleName("ticket2231");
+
+ layout.addComponent(l);
+
+ for (int i = 0; i < 5; i++) {
+ l = new Label("This is a label with border");
+ l.setStyleName("ticket2231-border");
+ if (i == 2) {
+ l.setWidth("100%");
+ l.setValue("100% wide");
+ } else if (i == 4) {
+ l.setWidth("20em");
+ l.setValue("20em wide");
+ }
+ // l.addStyleName("ticket2231");
+ layout.addComponent(l);
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2232.java b/uitest/src/com/vaadin/tests/tickets/Ticket2232.java
new file mode 100644
index 0000000000..d71134696f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2232.java
@@ -0,0 +1,74 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.SpacingHandler;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2232 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ setMainWindow(new LegacyWindow());
+ setTheme("tests-tickets");
+
+ getMainWindow()
+ .addComponent(
+ new Label(
+ "Defining spacing must be possible also with pure CSS"));
+
+ Layout gl;
+ gl = new VerticalLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ gl.setStyleName("t2232");
+ fillAndAdd(gl);
+
+ gl = new GridLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ gl.setStyleName("t2232");
+ fillAndAdd(gl);
+
+ gl = new VerticalLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ ((SpacingHandler) gl).setSpacing(true);
+ fillAndAdd(gl);
+
+ gl = new GridLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ ((SpacingHandler) gl).setSpacing(true);
+ fillAndAdd(gl);
+
+ gl = new VerticalLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ fillAndAdd(gl);
+
+ gl = new GridLayout();
+ gl.setWidth("100%");
+ gl.setHeight("200px");
+ fillAndAdd(gl);
+
+ }
+
+ private void fillAndAdd(Layout gl) {
+ for (int i = 0; i < 4; i++) {
+ Button b = new Button("B");
+ b.setSizeFull();
+ gl.addComponent(b);
+ }
+ String caption = gl.getClass().getSimpleName();
+ caption += " style: " + gl.getStyleName() + ", spacingFromServer:"
+ + ((SpacingHandler) gl).isSpacing();
+ gl.setCaption(caption);
+ getMainWindow().addComponent(gl);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2234.java b/uitest/src/com/vaadin/tests/tickets/Ticket2234.java
new file mode 100644
index 0000000000..ccda59bb6a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2234.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2234 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ ComboBox combo = new ComboBox("Combobox caption");
+ combo.addContainerProperty("blah", String.class, "");
+ combo.setItemCaptionPropertyId("blah");
+
+ Item item;
+ for (int i = 0; i < 100; i++) {
+ item = combo.addItem(new Object());
+ item.getItemProperty("blah").setValue("Item " + i);
+ }
+
+ layout.addComponent(combo);
+
+ combo = new ComboBox("Combobox caption");
+ combo.addContainerProperty("blah", String.class, "");
+ combo.setItemCaptionPropertyId("blah");
+
+ for (int i = 0; i < 5; i++) {
+ item = combo.addItem(new Object());
+ item.getItemProperty("blah").setValue("Item " + i);
+ }
+
+ layout.addComponent(combo);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2235.java b/uitest/src/com/vaadin/tests/tickets/Ticket2235.java
new file mode 100644
index 0000000000..fba82956e0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2235.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+
+public class Ticket2235 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ layout.setSizeFull();
+
+ TextArea tf = new TextArea();
+ tf.setCaption("A text field");
+ tf.setSizeFull();
+ tf.setRows(2);
+
+ layout.addComponent(tf);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2240.java b/uitest/src/com/vaadin/tests/tickets/Ticket2240.java
new file mode 100644
index 0000000000..bb16a40cd7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2240.java
@@ -0,0 +1,49 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2240 extends Application.LegacyApplication {
+
+ public static final String txt = "<p>There are two main types of windows: application-level windows, and "
+ + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"
+ + " within the (native) browser window to which it was added. You can create"
+ + " a sub window by creating a new Window and adding it to a application-level window, for instance"
+ + " your main window. </p><p> In contrast, you create a application-level window by"
+ + " creating a new Window and adding it to the Application. Application-level"
+ + " windows are not shown by default - you need to open a browser window for"
+ + " the url representing the window. You can think of the application-level"
+ + " windows as separate views into your application - and a way to create a"
+ + " \"native\" browser window.</p><p>Depending on your needs, it's also"
+ + " possible to create a new window instance (with it's own internal state)"
+ + " for each new (native) browser window, or you can share the same instance"
+ + " (and state) between several browser windows (the latter is most useful"
+ + " for read-only views).</p><br/><p>This is the end.</p>";
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ layout.setHeight(null);
+ layout.setStyleName("borders");
+ // layout.setSizeFull();
+ final Label l = new Label(txt);
+ l.setContentMode(ContentMode.XHTML);
+ // l.setWidth("100%");
+
+ TextField tf = new TextField("This is a textField");
+ tf.setWidth("100%");
+
+ layout.addComponent(tf);
+ layout.addComponent(l);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2242.java b/uitest/src/com/vaadin/tests/tickets/Ticket2242.java
new file mode 100644
index 0000000000..77fbfefe1a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2242.java
@@ -0,0 +1,82 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket2242 extends Application.LegacyApplication implements
+ ValueChangeListener {
+
+ private Object tableValue = null;
+ private Table t;
+ private String valueDataSource = "-";
+ private ObjectProperty<String> prop;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ Button b = new Button("Change container datasource",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ for (int i = 0; i < 5; i++) {
+ t.setContainerDataSource(createContainer());
+ // prop.setValue("ipsum");
+ }
+ }
+
+ });
+
+ layout.addComponent(b);
+
+ t = new Table("A table");
+ prop = new ObjectProperty<String>(valueDataSource);
+ t.setPropertyDataSource(prop);
+ t.setSelectable(true);
+ t.setImmediate(true);
+ t.setPageLength(5);
+ t.setContainerDataSource(createContainer());
+ tableValue = t.getValue();
+ t.addListener(this);
+
+ layout.addComponent(t);
+ }
+
+ private IndexedContainer createContainer() {
+ IndexedContainer ic = new IndexedContainer();
+ ic.addContainerProperty("a", String.class, null);
+
+ for (String s : new String[] { "Lorem", "ipsum", "dolor", "sit",
+ "amet", "consectetuer" }) {
+ Item item = ic.addItem(s);
+ item.getItemProperty("a").setValue(s);
+
+ }
+
+ return ic;
+ }
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ System.out.println("Value change from " + tableValue + " to "
+ + t.getValue());
+ tableValue = t.getValue();
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2244.java b/uitest/src/com/vaadin/tests/tickets/Ticket2244.java
new file mode 100644
index 0000000000..495e3de26a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2244.java
@@ -0,0 +1,130 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2244 extends Application.LegacyApplication {
+
+ Form form;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ GridLayout gl = new GridLayout(3, 3);
+ gl.setSpacing(true);
+ gl.addComponent(new Label("Before form"));
+ gl.newLine();
+
+ form = new Form(gl);
+ form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
+
+ gl.addComponent(new Label("After form"));
+
+ w.addComponent(form);
+
+ w.addComponent(new Button("new item", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
+
+ }
+
+ }));
+ w.addComponent(new Button("new bigger item",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setItemDataSource(new BeanItem<MyBean>(
+ new MyBiggerBean()));
+
+ }
+
+ }));
+ w.addComponent(new Button("new grid layout",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new GridLayout());
+
+ }
+
+ }));
+ w.addComponent(new Button("new form layout",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new FormLayout());
+
+ }
+
+ }));
+
+ }
+
+ public class MyBean {
+ String firstname;
+ String lastname;
+ String password;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ }
+
+ public class MyBiggerBean extends MyBean {
+ String address;
+ String phone;
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2245.java b/uitest/src/com/vaadin/tests/tickets/Ticket2245.java
new file mode 100644
index 0000000000..ab474fe6f7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2245.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2245 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow("The Main Window");
+ main.getContent().setSizeFull();
+ setMainWindow(main);
+ HorizontalSplitPanel sp = new HorizontalSplitPanel();
+ main.addComponent(sp);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2267.java b/uitest/src/com/vaadin/tests/tickets/Ticket2267.java
new file mode 100644
index 0000000000..41843a9742
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2267.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2267 extends Application.LegacyApplication {
+
+ Label l = new Label("0");
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ GridLayout gl = new GridLayout(4, 2);
+
+ Button button = new Button("1", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Button b = event.getButton();
+ l.setValue(l.getValue() + b.getCaption());
+
+ }
+
+ });
+
+ gl.addComponent(l, 0, 0, 3, 0);
+ gl.addComponent(button);
+ gl.addComponent(new Label("2"));
+ gl.addComponent(new Label("3"));
+ gl.addComponent(new Label("4"));
+
+ w.setContent(gl);
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2271.java b/uitest/src/com/vaadin/tests/tickets/Ticket2271.java
new file mode 100644
index 0000000000..91fb51034b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2271.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2271 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+
+ VerticalLayout ol = new VerticalLayout();
+ ol.setWidth(null);
+
+ ComboBox cb = new ComboBox("Asiakas");
+ cb.setWidth("100%");
+
+ Button b = new Button("View CSV-tiedostoon");
+
+ ol.addComponent(cb);
+ ol.addComponent(b);
+
+ layout.addComponent(ol);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2282.java b/uitest/src/com/vaadin/tests/tickets/Ticket2282.java
new file mode 100644
index 0000000000..976b06fe32
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2282.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2282 extends Application.LegacyApplication {
+
+ private FormLayout layout1;
+ private FormLayout layout2;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ w.getContent().setSizeUndefined();
+
+ layout1 = new FormLayout();
+ layout1.setSizeUndefined();
+ layout1.setStyleName("borders");
+ Label label = new Label(
+ "This should not be wider than this label + reserved error space");
+ label.setCaption("A caption");
+ layout1.addComponent(label);
+ w.addComponent(layout1);
+
+ layout2 = new FormLayout();
+ layout2.setWidth("500px");
+ layout2.setStyleName("borders");
+ label = new Label("This should be 500px wide");
+ label.setCaption("A caption");
+ layout2.addComponent(label);
+ w.addComponent(layout2);
+
+ Button b = new Button("Swap", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (layout1.getWidth() < 0.0) {
+ layout1.setWidth("500px");
+ layout2.setWidth(null);
+ } else {
+ layout1.setWidth(null);
+ layout2.setWidth("500px");
+ }
+ }
+
+ });
+ w.addComponent(b);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2283.java b/uitest/src/com/vaadin/tests/tickets/Ticket2283.java
new file mode 100644
index 0000000000..5576e48fba
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2283.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2283 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ GridLayout gl = new GridLayout(2, 2);
+ gl.setSizeUndefined();
+
+ gl.addComponent(new Label(
+ "Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf"));
+ gl.addComponent(new Label("Label 2 abc abc abc "));
+ Label l = new Label("Colspan2, align right");
+ gl.addComponent(l, 0, 1, 1, 1);
+ gl.setComponentAlignment(l, Alignment.TOP_RIGHT);
+ w.setContent(gl);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java
new file mode 100644
index 0000000000..59fc174215
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java
@@ -0,0 +1,33 @@
+package com.vaadin.tests.tickets;
+
+import java.net.URL;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2287 extends Ticket2292 {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+ URL url = getURL();
+ main.addComponent(new Label(
+ "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));
+
+ Label l = new Label();
+ l.setContentMode(ContentMode.XHTML);
+ l.setValue("This is a label with as slow image. <img src=\"" + url
+ + "/icon.png\" />");
+ main.addComponent(l);
+
+ l = new Label();
+ l.setContentMode(ContentMode.XHTML);
+ l.setValue("This is a label with as slow image. <img src=\"" + url
+ + "/icon.png\" />");
+ main.addComponent(l);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java
new file mode 100644
index 0000000000..c715fafd74
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java
@@ -0,0 +1,101 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2289 extends Application.LegacyApplication {
+
+ TabSheet ts = null;
+ Accordion acc = null;
+
+ @Override
+ public void init() {
+
+ LegacyWindow w = new LegacyWindow();
+ setMainWindow(w);
+ VerticalLayout ol = new VerticalLayout();
+ w.setContent(ol);
+ Button b = new Button("close current tab");
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ closeCurrentTab();
+
+ }
+ });
+ ol.addComponent(b);
+
+ b = new Button("close first tab");
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ closeFirstTab();
+
+ }
+ });
+
+ ol.addComponent(b);
+ ts = new TabSheet();
+ ts.setSizeUndefined();
+ ts.setWidth("300px");
+ ts.addTab(new MyTab("tab one"), "Caption1", null);
+ ts.addTab(new MyTab("tab two"), "Caption2", null);
+ ts.addTab(new MyTab("tab three"), "Caption3", null);
+ ts.addTab(new MyTab("tab four"), "Caption4", null);
+ ts.addTab(new MyTab("tab five"), "Caption5", null);
+
+ acc = new Accordion();
+ acc.setSizeUndefined();
+ acc.addTab(new MyTab("tab one"), "Caption1", null);
+ acc.addTab(new MyTab("tab two"), "Caption2", null);
+ acc.addTab(new MyTab("tab three"), "Caption3", null);
+ acc.addTab(new MyTab("tab four"), "Caption4", null);
+
+ ol.addComponent(acc);
+ ts = null;
+ // ol.addComponent(ts);
+
+ }
+
+ private void closeCurrentTab() {
+ if (ts != null) {
+ MyTab m = (MyTab) ts.getSelectedTab();
+ if (m != null) {
+ ts.removeComponent(m);
+ }
+ }
+ if (acc != null) {
+ MyTab m = (MyTab) acc.getSelectedTab();
+ if (m != null) {
+ acc.removeComponent(m);
+ }
+ }
+ }
+
+ private void closeFirstTab() {
+ if (ts != null) {
+ ts.removeComponent(ts.getComponentIterator().next());
+ }
+ if (acc != null) {
+ acc.removeComponent(acc.getComponentIterator().next());
+ }
+ }
+
+}
+
+class MyTab extends CustomComponent {
+ public MyTab(String text) {
+ setSizeUndefined();
+ HorizontalLayout ol = new HorizontalLayout();
+ setCompositionRoot(ol);
+ ol.addComponent(new Label(text));
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java
new file mode 100644
index 0000000000..ce7960a169
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java
@@ -0,0 +1,98 @@
+package com.vaadin.tests.tickets;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+import com.vaadin.Application;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2292 extends com.vaadin.Application.LegacyApplication
+ implements RequestHandler {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ ExternalResource icon = new ExternalResource("./icon.png");
+ main.addComponent(new Label(
+ "Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)"));
+ Button b = new Button();
+ main.addComponent(b);
+ b.setIcon(icon);
+
+ CheckBox checkBox = new CheckBox();
+ main.addComponent(checkBox);
+ checkBox.setIcon(icon);
+
+ Link l = new Link("l", icon);
+ main.addComponent(l);
+
+ addRequestHandler(this);
+ }
+
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
+
+ if (!relativeUri.contains("icon.png")) {
+ return false;
+ }
+
+ // be slow to show bug
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ BufferedImage image = new BufferedImage(200, 200,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics drawable = image.getGraphics();
+ drawable.setColor(Color.lightGray);
+ drawable.fillRect(0, 0, 200, 200);
+ drawable.setColor(Color.yellow);
+ drawable.fillOval(25, 25, 150, 150);
+ drawable.setColor(Color.blue);
+ drawable.drawRect(0, 0, 199, 199);
+
+ // Use the parameter to create dynamic content.
+ drawable.setColor(Color.black);
+ drawable.drawString("Tex", 75, 100);
+
+ try {
+ // Write the image to a buffer.
+ ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream();
+ ImageIO.write(image, "png", imagebuffer);
+
+ // Return a stream from the buffer.
+ ByteArrayInputStream istream = new ByteArrayInputStream(
+ imagebuffer.toByteArray());
+ new DownloadStream(istream, null, null).writeResponse(request,
+ response);
+ return true;
+ } catch (IOException e) {
+ return false;
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2294.java b/uitest/src/com/vaadin/tests/tickets/Ticket2294.java
new file mode 100644
index 0000000000..053534191b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2294.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2294 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((AbstractOrderedLayout) w.getContent());
+ }
+
+ private void createUI(AbstractOrderedLayout layout) {
+ Label label1 = new Label();
+ Label label2 = null;
+ Label label3 = new Label();
+ String result1 = "";
+ String result2 = "";
+ String result3 = "";
+
+ layout.addComponent(label1);
+ try {
+ layout.setComponentAlignment(label1, Alignment.BOTTOM_LEFT);
+ result1 = "OK";
+ } catch (Exception e) {
+ result1 = "FAILED: " + e.getMessage();
+ }
+
+ try {
+ layout.setComponentAlignment(label2, Alignment.BOTTOM_LEFT);
+ result2 = "FAILED, no exception";
+ } catch (IllegalArgumentException e) {
+ result2 = "OK";
+ } catch (Exception e) {
+ result2 = "FAILED: " + e.getMessage();
+ }
+
+ try {
+ layout.setComponentAlignment(label3, Alignment.BOTTOM_LEFT);
+ result3 = "FAILED, no exception";
+ } catch (IllegalArgumentException e) {
+ result3 = "OK";
+ } catch (Exception e) {
+ result3 = "FAILED: " + e.getMessage();
+ }
+
+ label1.setValue("Result 1: " + result1 + ", result 2: " + result2
+ + ", result 3: " + result3);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2296.java b/uitest/src/com/vaadin/tests/tickets/Ticket2296.java
new file mode 100644
index 0000000000..d059b96953
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2296.java
@@ -0,0 +1,33 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2296 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ CustomLayout cl = new CustomLayout("Ticket2296");
+ cl.setSizeFull();
+ Button b = new Button("100%x100% button");
+ b.setSizeFull();
+ cl.addComponent(b, "button1");
+
+ b = new Button("100%x100% button");
+ b.setSizeFull();
+ cl.addComponent(b, "button2");
+
+ b = new Button("50%x50% button");
+ b.setWidth("50%");
+ b.setHeight("50%");
+ cl.addComponent(b, "button3");
+
+ w.setContent(cl);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java
new file mode 100644
index 0000000000..073126ae07
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java
@@ -0,0 +1,41 @@
+package com.vaadin.tests.tickets;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2297 extends Ticket2292 {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+ URL url = getURL();
+ main.addComponent(new Label(
+ "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));
+
+ try {
+ CustomLayout cl = new CustomLayout(
+ new ByteArrayInputStream(
+ ("This is an empty CustomLayout with as slow image. <img src=\""
+ + url.toString() + "/icon.png\" />")
+ .getBytes()));
+ main.addComponent(cl);
+
+ cl = new CustomLayout(
+ new ByteArrayInputStream(
+ ("This is an empty CustomLayout with as slow image. <img src=\""
+ + url.toString() + "/icon.png\" />")
+ .getBytes()));
+ main.addComponent(cl);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2303.java b/uitest/src/com/vaadin/tests/tickets/Ticket2303.java
new file mode 100644
index 0000000000..fb1c5440ad
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2303.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.tickets;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import com.vaadin.Application;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2303 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow("main window");
+
+ String customlayout = "<div location=\"test\"></div>";
+ CustomLayout cl = null;
+ try {
+ cl = new CustomLayout(new ByteArrayInputStream(
+ customlayout.getBytes()));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ cl.setWidth("100%");
+ w.setContent(cl);
+
+ // VerticalLayout ol = new VerticalLayout();
+ // w.setContent(ol);
+ VerticalLayout hugeLayout = new VerticalLayout();
+ hugeLayout.setMargin(true);
+ hugeLayout.setSpacing(true);
+ for (int i = 0; i < 30; i++) {
+ hugeLayout.addComponent(new Label("huge " + i));
+ }
+ cl.addComponent(hugeLayout, "test");
+ // ol.addComponent(hugeLayout);
+ setMainWindow(w);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2304.java b/uitest/src/com/vaadin/tests/tickets/Ticket2304.java
new file mode 100644
index 0000000000..ccef7a9a92
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2304.java
@@ -0,0 +1,31 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.themes.Reindeer;
+
+public class Ticket2304 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ Panel p = new Panel();
+ p.setStyleName(Reindeer.PANEL_LIGHT);
+ main.addComponent(p);
+ p.setHeight("100px");
+
+ Label l = new Label(
+ "a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n");
+ l.setContentMode(ContentMode.PREFORMATTED);
+ p.addComponent(l);
+ main.addComponent(new Label(
+ "This text should be right below the panel, w/o spacing"));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2310.java b/uitest/src/com/vaadin/tests/tickets/Ticket2310.java
new file mode 100644
index 0000000000..24fbd7a968
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2310.java
@@ -0,0 +1,58 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.themes.Reindeer;
+
+public class Ticket2310 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
+ setMainWindow(main);
+
+ main.addComponent(new Label("Instructions: change label when panel is "
+ + "invisible -> invalid change (with disabled "
+ + "flag) is sent to client. Label is grey when panel is shown."));
+
+ final Panel p = new Panel();
+ p.setStyleName(Reindeer.PANEL_LIGHT);
+ main.addComponent(p);
+ p.setHeight("100px");
+
+ final Label l = new Label("foobar");
+
+ p.addComponent(l);
+
+ Button b = new Button("change label");
+
+ b.addListener(new Button.ClickListener() {
+ int i = 0;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+
+ l.setValue("foobar " + i++);
+
+ }
+ });
+
+ Button b2 = new Button("toggle panel visibility");
+ b2.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ p.setVisible(!p.isVisible());
+ }
+ });
+
+ main.addComponent(b);
+ main.addComponent(b2);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2319.java b/uitest/src/com/vaadin/tests/tickets/Ticket2319.java
new file mode 100644
index 0000000000..438d2ff286
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2319.java
@@ -0,0 +1,66 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+
+public class Ticket2319 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow mainw = new LegacyWindow();
+ setMainWindow(mainw);
+
+ mainw.addComponent(new Label(
+ "This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog"));
+
+ HorizontalLayout hl = new HorizontalLayout();
+ Panel panel = new Panel("p1");
+ Panel panel2 = new Panel("p2");
+ hl.addComponent(panel);
+ hl.addComponent(panel2);
+
+ mainw.addComponent(hl);
+
+ hl = new HorizontalLayout();
+ panel = new Panel("p1");
+ panel.setSizeUndefined();
+ panel.setHeight("100%");
+ panel2 = new Panel("p2");
+ panel2.setSizeUndefined();
+ panel2.setHeight("100%");
+
+ hl.addComponent(panel);
+ hl.addComponent(panel2);
+ mainw.addComponent(hl);
+
+ HorizontalSplitPanel sp = new HorizontalSplitPanel();
+
+ VerticalLayout first = new VerticalLayout();
+ first.addComponent(new Label("first"));
+ VerticalLayout second = new VerticalLayout();
+ second.addComponent(new Label("second"));
+
+ sp.setFirstComponent(first);
+ sp.setSecondComponent(second);
+
+ VerticalSplitPanel sp2 = new VerticalSplitPanel();
+ Label label = new Label("first");
+ label.setSizeFull();
+ sp2.setFirstComponent(label);
+ sp2.setSecondComponent(sp);
+
+ sp2.setHeight("200px");
+
+ mainw.addComponent(sp2);
+
+ mainw.addComponent(new Button("click me to save split panel state"));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2323.java b/uitest/src/com/vaadin/tests/tickets/Ticket2323.java
new file mode 100644
index 0000000000..d7b8db86bd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2323.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Window;
+
+public class Ticket2323 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ Window subWindow = new Window("");
+ subWindow.setSizeUndefined();
+ subWindow.getContent().setSizeUndefined();
+ subWindow.center();
+ subWindow.addComponent(new RichTextArea());
+ w.addWindow(subWindow);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2325.java b/uitest/src/com/vaadin/tests/tickets/Ticket2325.java
new file mode 100644
index 0000000000..ecc897d4ba
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2325.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class Ticket2325 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow("Testing....");
+ setMainWindow(main);
+
+ final VerticalLayout lo = new VerticalLayout();
+ lo.setSizeUndefined();
+ lo.setWidth("100%");
+ TextArea tf = new TextArea();
+ tf.setValue("The textfield should fill the window."
+ + "\n - Try to resize window\n - Try to push REdo button");
+ tf.setRows(10);
+ tf.setWidth("100%");
+ lo.addComponent(tf);
+ Window subWin = new Window(
+ "This window should initially be as wide as the caption", lo);
+ main.addWindow(subWin);
+ // subWin.setWidth("500px");
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2329.java b/uitest/src/com/vaadin/tests/tickets/Ticket2329.java
new file mode 100644
index 0000000000..2ce42376f9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2329.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2329 extends Application.LegacyApplication {
+ private Table table;
+ private VerticalLayout mainLo;
+
+ @Override
+ public void init() {
+ LegacyWindow mainw = new LegacyWindow();
+ setMainWindow(mainw);
+ mainLo = (VerticalLayout) mainw.getContent();
+ table = new Table();
+ for (int i = 0; i < 10000; i++) {
+ table.addItem(i);
+ }
+ TestColumnGenerator cgen = new TestColumnGenerator();
+ table.addGeneratedColumn("col1", cgen);
+ table.addGeneratedColumn("col2", cgen);
+ table.addGeneratedColumn("col3", cgen);
+ table.addGeneratedColumn("col4", cgen);
+ table.addGeneratedColumn("col5", cgen);
+ table.addGeneratedColumn("col6", cgen);
+ table.addGeneratedColumn("col7", cgen);
+ table.setHeight("500px");
+ mainLo.addComponent(table);
+ }
+
+ class TestColumnGenerator implements ColumnGenerator {
+ @Override
+ public Component generateCell(Table source, Object rowId,
+ Object columnId) {
+ return new Button("1");
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2337.java b/uitest/src/com/vaadin/tests/tickets/Ticket2337.java
new file mode 100644
index 0000000000..3ac381b2d1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2337.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2337 extends Application.LegacyApplication {
+
+ GridLayout gl = new GridLayout(3, 1);
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow();
+ setMainWindow(w);
+ Button b = new Button("add", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2,
+ gl.getCursorY());
+
+ }
+
+ });
+ w.addComponent(b);
+
+ b = new Button("empty", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ gl.removeAllComponents();
+ ;
+
+ }
+
+ });
+ w.addComponent(b);
+
+ w.addComponent(gl);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2339.java b/uitest/src/com/vaadin/tests/tickets/Ticket2339.java
new file mode 100644
index 0000000000..ce884bada7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2339.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.tickets;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2339 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
+ setMainWindow(mainWin);
+
+ try {
+ CustomLayout cl = new CustomLayout(
+ new ByteArrayInputStream(
+ "<div style=\"width:400px;overflow:hidden;background-color:red;\"><div style=\"border:1em solid blue; height:4em; padding:1em 1.5em;\" location=\"b\"></div></div>"
+ .getBytes()));
+ Button button = new Button("b");
+ button.setSizeFull();
+
+ cl.addComponent(button, "b");
+
+ mainWin.addComponent(cl);
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2341.java b/uitest/src/com/vaadin/tests/tickets/Ticket2341.java
new file mode 100644
index 0000000000..aa2eefcb7e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2341.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Item;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket2341 extends com.vaadin.Application.LegacyApplication {
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+ constructTables((Layout) main.getContent());
+ }
+
+ private void constructTables(Layout layout) {
+
+ Table t = createTable();
+ layout.addComponent(t);
+ t = createTable();
+ Label l = new Label("A high label to enable scrollbars");
+ l.setHeight("2000px");
+ layout.addComponent(l);
+
+ }
+
+ private Table createTable() {
+ Table t = new Table();
+ t.addContainerProperty("test1", String.class, "");
+ t.addContainerProperty("test2", String.class, "");
+ t.addContainerProperty("test3", String.class, "");
+ t.addContainerProperty("test4", String.class, "");
+ t.setWidth("100%");
+ t.setHeight("300px");
+ for (int i = 0; i < 100; i++) {
+ Item item = t.addItem(i);
+ item.getItemProperty("test1").setValue("testing1 " + i);
+ item.getItemProperty("test2").setValue("testing2 " + i);
+ item.getItemProperty("test3").setValue("testing3 " + i);
+ item.getItemProperty("test4").setValue("testing4 " + i);
+ }
+
+ return t;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2344.java b/uitest/src/com/vaadin/tests/tickets/Ticket2344.java
new file mode 100644
index 0000000000..befad78a73
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2344.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Random;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.BaseTheme;
+
+public class Ticket2344 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow("Quick test");
+
+ setMainWindow(main);
+
+ // setTheme("quicktest");
+
+ VerticalLayout hl = new VerticalLayout();
+ hl.setWidth("400px");
+ main.setContent(hl);
+
+ Table t = new Table();
+ t.setWidth("100%");
+
+ t.addContainerProperty("Prop 1", VerticalLayout.class, "");
+ t.addContainerProperty("Prop 2", String.class, "");
+ t.addContainerProperty("Prop 3", String.class, "");
+ t.addContainerProperty("Prop 4", String.class, "");
+ t.addContainerProperty("Prop 5", Button.class, "");
+
+ t.setPageLength(3);
+
+ for (int i = 0; i < 10; i++) {
+
+ VerticalLayout vl = new VerticalLayout();
+ // vl.setWidth(null);
+ Button b = new Button("String 1 2 3");
+ b.setStyleName(BaseTheme.BUTTON_LINK);
+ vl.addComponent(b);
+ t.addItem(new Object[] { vl, "String 2", "String 3", "String 4",
+
+ new Button("String 5") }, new Integer(new Random().nextInt()));
+
+ }
+
+ hl.addComponent(t);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2347.java b/uitest/src/com/vaadin/tests/tickets/Ticket2347.java
new file mode 100644
index 0000000000..582b9a95ee
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2347.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2347 extends Application.LegacyApplication {
+
+ private Button b1;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ setTheme("tests-tickets");
+ createUI((VerticalLayout) w.getContent());
+ }
+
+ private void createUI(VerticalLayout layout) {
+ CustomLayout cl = new CustomLayout("Ticket2347");
+ b1 = new Button("200px button");
+ b1.addListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (b1.getWidth() == 200.0) {
+ b1.setWidth("300px");
+ } else {
+ b1.setWidth("200px");
+
+ }
+ b1.setCaption(b1.getWidth() + "px button");
+
+ }
+
+ });
+ b1.setWidth("200px");
+ Button b2 = new Button("100% button");
+ b2.setWidth("100%");
+
+ cl.addComponent(b1, "button1");
+ cl.addComponent(b2, "button2");
+
+ layout.addComponent(cl);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2364.java b/uitest/src/com/vaadin/tests/tickets/Ticket2364.java
new file mode 100644
index 0000000000..f7d6f61110
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2364.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Select;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2364 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ LegacyWindow main = new LegacyWindow("The Main Window!!!");
+ setMainWindow(main);
+ Form form = new Form();
+ VerticalLayout formLayout = new VerticalLayout();
+ form.setLayout(formLayout);
+ Select formSelect = new Select("hello");
+ Select select = new Select("hello");
+ form.setEnabled(false);
+ select.setEnabled(false);
+ formLayout.addComponent(formSelect);
+
+ VerticalLayout l2 = new VerticalLayout();
+ l2.addComponent(new Select("hello"));
+ l2.setEnabled(false);
+
+ form.setCaption("Form");
+ main.addComponent(form);
+ l2.setCaption("VerticalLayout");
+ main.addComponent(l2);
+ main.addComponent(select);
+ main.addComponent(new Select("Enabled=true select"));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2365.java b/uitest/src/com/vaadin/tests/tickets/Ticket2365.java
new file mode 100644
index 0000000000..b191901356
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2365.java
@@ -0,0 +1,60 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2365 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
+ setMainWindow(mainWin);
+
+ VerticalLayout lo = new VerticalLayout();
+ lo.setSizeFull();
+ mainWin.setContent(lo);
+
+ final Panel p = createMultilevelPanel(5, (Panel) null);
+
+ Button b = new Button("Toggle parent level size");
+ lo.addComponent(b);
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (p.getWidth() > 0) {
+ p.setSizeUndefined();
+ } else {
+ p.setSizeFull();
+ }
+ }
+ });
+
+ lo.addComponent(p);
+
+ lo.setExpandRatio(p, 1);
+
+ }
+
+ private Panel createMultilevelPanel(int i, Panel panel) {
+ if (panel == null) {
+ panel = new Panel("Panel level " + i);
+ panel.setSizeFull();
+ panel.getContent().setSizeFull();
+ }
+ Panel p = new Panel("Panel level " + i--);
+ p.getContent().setSizeFull();
+ p.setSizeFull();
+ panel.addComponent(p);
+ if (i > 0) {
+ createMultilevelPanel(i, p);
+ }
+ return panel;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2398.java b/uitest/src/com/vaadin/tests/tickets/Ticket2398.java
new file mode 100644
index 0000000000..f5b68800e6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2398.java
@@ -0,0 +1,40 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket2398 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow();
+ setMainWindow(mainWin);
+
+ Table t = new Table();
+
+ IndexedContainer c = new IndexedContainer();
+
+ c.addItem("foo");
+
+ c.addContainerProperty("testcol1", Integer.class, new Integer(7));
+ c.addContainerProperty("testcol2", String.class, "str");
+ c.addContainerProperty("testcol3", String.class, null);
+
+ c.addItem("bar");
+
+ t.setContainerDataSource(c);
+
+ t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
+
+ mainWin.addComponent(new Label(
+ "Both rows in table should have same data (default values)"));
+
+ mainWin.addComponent(t);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2404.java b/uitest/src/com/vaadin/tests/tickets/Ticket2404.java
new file mode 100644
index 0000000000..30f9d04d3b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2404.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2404 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ GridLayout gl = new GridLayout(2, 2);
+ gl.setSizeFull();
+
+ Button bb = new Button("1st row on 2x2 GridLayout");
+ bb.setSizeFull();
+ gl.addComponent(bb, 0, 0, 1, 0);
+ for (int i = 0; i < 2; i++) {
+ Button b = new Button("" + i);
+ gl.addComponent(b);
+ b.setSizeFull();
+ }
+
+ setMainWindow(new LegacyWindow("GridLayout test", gl));
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2405.java b/uitest/src/com/vaadin/tests/tickets/Ticket2405.java
new file mode 100644
index 0000000000..8be6a13e9f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2405.java
@@ -0,0 +1,79 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2405 extends Application.LegacyApplication {
+
+ private Label label;
+ private HorizontalSplitPanel split;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow root = new LegacyWindow("VaadinTunes");
+ root.setWidth("90%");
+ root.setHeight("90%");
+
+ // We'll attach the window to the browser view already here, so we won't
+ // forget it later.
+ // browser.addWindow(root);
+ setMainWindow(root);
+
+ root.getContent().setSizeFull();
+ ((MarginHandler) root.getContent()).setMargin(false);
+
+ // Top area, containing playback and volume controls, play status, view
+ // modes and search
+ HorizontalLayout top = new HorizontalLayout();
+ // GridLayout top = new GridLayout(1, 1);
+ top.setWidth("100%");
+ top.setMargin(false);
+ top.setSpacing(false);
+
+ // Let's attach that one straight away too
+ root.addComponent(top);
+
+ label = new Label(
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. ");
+ label.setWidth("100%");
+ top.addComponent(label);
+ split = new HorizontalSplitPanel();
+ split.setHeight("100%");
+ Embedded image = new Embedded("An image", new ExternalResource(
+ "http://dev.itmill.com/chrome/site/toolkit-logo.png"));
+ image.setWidth("100%");
+ root.addComponent(split);
+ ((VerticalLayout) root.getContent()).setExpandRatio(split, 1.0f);
+ VerticalLayout vl = new VerticalLayout();
+ split.addComponent(vl);
+
+ vl.addComponent(new TextField("abc"));
+ vl.addComponent(image);
+ vl.setExpandRatio(image, 1.0f);
+ vl.setComponentAlignment(image, Alignment.BOTTOM_CENTER);
+ vl.setHeight("100%");
+ // We'll need one splitpanel to separate the sidebar and track listing
+ Button bottomButton = new Button("Filler");
+ bottomButton.setSizeFull();
+ // root.addComponent(bottomButton);
+
+ // The splitpanel is by default 100% x 100%, but we'll need to adjust
+ // our main window layout to accomodate the height
+ root.getContent().setHeight("100%");
+ // ((VerticalLayout) root.getLayout()).setExpandRatio(bottomButton,
+ // 1.0F);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2406.java b/uitest/src/com/vaadin/tests/tickets/Ticket2406.java
new file mode 100644
index 0000000000..dd42727591
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2406.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class Ticket2406 extends Application.LegacyApplication {
+
+ private Window w;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+ // setTheme("tests-tickets");
+ createUI((VerticalLayout) w.getContent());
+ }
+
+ private void createUI(VerticalLayout layout) {
+ w = new Window("A sub window");
+ w.setSizeUndefined();
+ getMainWindow().addWindow(w);
+
+ VerticalLayout l = new VerticalLayout();
+ l.setSizeFull();
+ w.setContent(l);
+
+ Button b = new Button("Button 1");
+ b.setSizeFull();
+ b.addListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ w.setHeight("200px");
+ }
+
+ });
+ l.addComponent(b);
+
+ for (int i = 0; i < 5; i++) {
+ b = new Button("Button number " + (i + 2));
+ b.setSizeFull();
+ l.addComponent(b);
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2407.java b/uitest/src/com/vaadin/tests/tickets/Ticket2407.java
new file mode 100644
index 0000000000..df2ae47acd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2407.java
@@ -0,0 +1,21 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.ui.Form;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket2407 extends com.vaadin.Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow("Ticket2407");
+ setMainWindow(main);
+
+ Form form = new Form(new VerticalLayout());
+ TextField text = new TextField("This caption shall be visible");
+ text.setRequired(true);
+ form.addField("test", text);
+ main.addComponent(form);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2411.java b/uitest/src/com/vaadin/tests/tickets/Ticket2411.java
new file mode 100644
index 0000000000..2c59493e0c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2411.java
@@ -0,0 +1,29 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2411 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ // VerticalLayout l = new VerticalLayout();
+ GridLayout l = new GridLayout();
+ w.setContent(l);
+
+ l.setHeight("504px");
+
+ for (int i = 1; i <= 5; i++) {
+ Button b = new Button("Button " + i
+ + " should be 100px or 101px high");
+ b.setHeight("100%");
+ l.addComponent(b);
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2415.java b/uitest/src/com/vaadin/tests/tickets/Ticket2415.java
new file mode 100644
index 0000000000..f52c1b1ccc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2415.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket2415 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow("");
+ setMainWindow(main);
+
+ final TextField tf = new TextField("Try to change me");
+ main.addComponent(tf);
+
+ tf.setImmediate(true);
+ tf.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ main.showNotification("New value = " + tf);
+ }
+ });
+
+ final TextField tf2 = new TextField("Try to change me");
+ main.addComponent(tf2);
+
+ tf2.setImmediate(true);
+ tf2.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ main.showNotification("New value = " + tf2);
+ }
+ });
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2420.java b/uitest/src/com/vaadin/tests/tickets/Ticket2420.java
new file mode 100644
index 0000000000..5d15107053
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2420.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2420 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow("Hello window");
+ setMainWindow(main);
+
+ setTheme("tests-tickets");
+
+ ProgressIndicator pi = new ProgressIndicator();
+ pi.setCaption("Visible");
+ pi.setIndeterminate(false);
+ pi.setValue(new Float(0.5));
+ main.addComponent(pi);
+
+ pi = new ProgressIndicator();
+ pi.setCaption("Visible (indeterminate)");
+ pi.setIndeterminate(true);
+
+ main.addComponent(pi);
+
+ main.addComponent(pi);
+
+ pi = new ProgressIndicator();
+ pi.setCaption("Visible (indeterminate, with .redborder css)");
+ pi.addStyleName("redborder");
+ pi.setIndeterminate(true);
+
+ main.addComponent(pi);
+
+ pi = new ProgressIndicator();
+ pi.setCaption("Disabled ");
+ pi.setEnabled(false);
+ pi.setIndeterminate(true);
+
+ main.addComponent(pi);
+
+ pi = new ProgressIndicator();
+
+ pi.setCaption("Hidden (via css)");
+
+ pi.addStyleName("dispnone");
+
+ main.addComponent(pi);
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2425.java b/uitest/src/com/vaadin/tests/tickets/Ticket2425.java
new file mode 100644
index 0000000000..140fa6f2b6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2425.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TabSheet;
+
+public class Ticket2425 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ w.addComponent(new Label("No scrollbars should be visible anywhere"));
+ TabSheet ts = new TabSheet();
+ ts.addTab(new Panel(), "Panel 1", null);
+ ts.addTab(new Panel(), "Panel 2", null);
+
+ w.addComponent(ts);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2426.java b/uitest/src/com/vaadin/tests/tickets/Ticket2426.java
new file mode 100644
index 0000000000..fee74b73f7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2426.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2426 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow();
+ setMainWindow(w);
+
+ final String content = "<select/>";
+
+ w.addComponent(new Label("CONTENT_DEFAULT: " + content,
+ ContentMode.TEXT));
+ w.addComponent(new Label("CONTENT_PREFORMATTED: " + content,
+ ContentMode.PREFORMATTED));
+ w.addComponent(new Label("CONTENT_RAW: " + content, ContentMode.RAW));
+ w.addComponent(new Label("CONTENT_TEXT: " + content, ContentMode.TEXT));
+ w.addComponent(new Label("CONTENT_XML: " + content, ContentMode.XML));
+ w.addComponent(new Label("CONTENT_XHTML: " + content, ContentMode.XHTML));
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2431.java b/uitest/src/com/vaadin/tests/tickets/Ticket2431.java
new file mode 100644
index 0000000000..cb9eb449bf
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2431.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
+import com.vaadin.event.ShortcutAction;
+import com.vaadin.event.ShortcutAction.KeyCode;
+import com.vaadin.event.ShortcutAction.ModifierKey;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2431 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ LegacyWindow w = new LegacyWindow();
+ setMainWindow(w);
+ Label help = new Label(
+ "Use CTRL X to fire action, CTRL C to remove it (fails before fix)");
+
+ w.addComponent(help);
+
+ w.addActionHandler(new Handler() {
+
+ final ShortcutAction a1 = new ShortcutAction("action", KeyCode.X,
+ new int[] { ModifierKey.CTRL });
+ final ShortcutAction a2 = new ShortcutAction("action", KeyCode.C,
+ new int[] { ModifierKey.CTRL });
+
+ Action[] actions = new Action[] { a1, a2 };
+
+ @Override
+ public Action[] getActions(Object target, Object sender) {
+ return actions;
+ }
+
+ @Override
+ public void handleAction(Action action, Object sender, Object target) {
+ if (action == a1) {
+ getMainWindow().addComponent(new Label("CTRL X hit"));
+ } else {
+ actions = new Action[] { a2 };
+ // annoyance, we need to repaint the panel or detect the
+ // action in presence in handler
+ getMainWindow().removeActionHandler(this);
+ getMainWindow().addActionHandler(this);
+ }
+ }
+ });
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2432.java b/uitest/src/com/vaadin/tests/tickets/Ticket2432.java
new file mode 100644
index 0000000000..f21e6a6752
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2432.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.AlignmentHandler;
+import com.vaadin.ui.Layout.SpacingHandler;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2432 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ LegacyWindow w = new LegacyWindow();
+ setMainWindow(w);
+ w.getContent().setSizeFull();
+ ((SpacingHandler) w.getContent()).setSpacing(true);
+
+ Layout layout = new GridLayout(3, 3);
+ populateLayout(layout);
+ w.addComponent(layout);
+ layout = new HorizontalLayout();
+ populateLayout(layout);
+ w.addComponent(layout);
+
+ }
+
+ private static Alignment[] alignments = new Alignment[] {
+ Alignment.TOP_LEFT, Alignment.TOP_CENTER, Alignment.TOP_RIGHT,
+ Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER,
+ Alignment.MIDDLE_RIGHT, Alignment.BOTTOM_LEFT,
+ Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT };
+
+ private void populateLayout(Layout layout) {
+ layout.setSizeFull();
+ for (int i = 0; i < 9; i++) {
+ Label l = new Label("M");
+ Alignment a = alignments[i];
+ l.setCaption(a.getHorizontalAlignment() + " "
+ + a.getVerticalAlignment() + " " + a.getBitMask());
+ layout.addComponent(l);
+ ((AlignmentHandler) layout).setComponentAlignment(l, a);
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2434.java b/uitest/src/com/vaadin/tests/tickets/Ticket2434.java
new file mode 100644
index 0000000000..6401a98763
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2434.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+public class Ticket2434 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ LegacyWindow w = new LegacyWindow();
+
+ setMainWindow(w);
+
+ Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3,
+ 50);
+
+ t.setPageLength(0);
+
+ t.addStyleName("bordered");
+
+ w.addComponent(t);
+
+ setTheme("tests-tickets");
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2436.java b/uitest/src/com/vaadin/tests/tickets/Ticket2436.java
new file mode 100644
index 0000000000..5367c24b01
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2436.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.PopupView;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2436 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ final Button remover = new Button("Remove PopupView");
+ final PopupView pv = new PopupView(new PopupView.Content() {
+ @Override
+ public String getMinimizedValueAsHTML() {
+ return "PopupView";
+ }
+
+ @Override
+ public Component getPopupComponent() {
+ return remover;
+ }
+ });
+
+ remover.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ main.removeComponent(pv);
+ }
+ });
+
+ main.addComponent(pv);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2526.java b/uitest/src/com/vaadin/tests/tickets/Ticket2526.java
new file mode 100644
index 0000000000..998fe75f8c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2526.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Window;
+
+public class Ticket2526 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+ Button b = new Button("Add windows");
+ b.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ main.addWindow(new Window());
+ }
+ });
+ main.addComponent(b);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2742.java b/uitest/src/com/vaadin/tests/tickets/Ticket2742.java
new file mode 100644
index 0000000000..733f6ac6f6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2742.java
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.UI.LegacyWindow;
+
+/**
+ * @author Risto Yrjänä / Vaadin Ltd.
+ *
+ */
+public class Ticket2742 extends Application.LegacyApplication {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.Application#init()
+ */
+ @Override
+ public void init() {
+ LegacyWindow mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
+
+ String shortString = "Short";
+ String longString = "Very, very long";
+
+ HorizontalLayout hl = new HorizontalLayout();
+
+ for (int i = 0; i < 2; i++) {
+ NativeSelect ns = new NativeSelect(shortString);
+ ns.addItem(longString);
+ ns.setNullSelectionAllowed(false);
+ ns.select(longString);
+ hl.addComponent(ns);
+ }
+ mainWindow.addComponent(hl);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java
new file mode 100644
index 0000000000..c4352abefe
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java
@@ -0,0 +1,34 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+
+/**
+ * With IE7 extra scrollbars appear in content area all though content fits
+ * properly. Scrollbars will disappear if "shaking" content a bit, like
+ * selecting tests in area.
+ */
+public class Ticket2901 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app to break layout in IE6");
+ setMainWindow(mainWin);
+
+ VerticalSplitPanel sp = new VerticalSplitPanel();
+
+ VerticalLayout l = new VerticalLayout();
+ for (int i = 0; i < 100; i++) {
+ l.addComponent(new Label("Label" + i));
+ }
+ sp.setFirstComponent(l);
+
+ mainWin.setContent(sp);
+
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2998.java b/uitest/src/com/vaadin/tests/tickets/Ticket2998.java
new file mode 100644
index 0000000000..0cd43533fd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2998.java
@@ -0,0 +1,330 @@
+package com.vaadin.tests.tickets;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+
+import com.vaadin.Application;
+import com.vaadin.data.Container;
+import com.vaadin.data.Validator;
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.MarginHandler;
+import com.vaadin.ui.ListSelect;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.themes.Reindeer;
+
+/**
+ * Table layout is very slow in Firefox 3.0.10 when the table contains
+ * components.
+ *
+ * This is adapted from the HbnContainer example application WorkoutLog.
+ *
+ * Other browsers are much faster.
+ */
+public class Ticket2998 extends Application.LegacyApplication {
+ private Table table;
+ private VerticalLayout mainLayout;
+
+ public class Workout implements Serializable {
+ private Long id;
+ private Date date = new Date();
+ private String title = " -- new workout -- ";
+ private float kilometers;
+
+ private String trainingType;
+
+ private Set<String> secondaryTypes;
+
+ public Workout() {
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public float getKilometers() {
+ return kilometers;
+ }
+
+ public void setKilometers(float kilometers) {
+ this.kilometers = kilometers;
+ }
+
+ public String getTrainingType() {
+ return trainingType;
+ }
+
+ public void setTrainingType(String trainingType) {
+ this.trainingType = trainingType;
+ }
+
+ public void setSecondaryTypes(Set<String> secondaryTypes) {
+ this.secondaryTypes = secondaryTypes;
+ }
+
+ public Set<String> getSecondaryTypes() {
+ return secondaryTypes;
+ }
+
+ }
+
+ public class WorkoutEditor extends Window {
+
+ private DateField date = new DateField("Date");
+ private TextField kilomiters = new TextField("Kilometers");
+ private TextField title = new TextField("Title/note");
+
+ private Ticket2998 workoutLog;
+
+ public WorkoutEditor(Ticket2998 app) {
+ super("Edit workout");
+ workoutLog = app;
+ Layout main = new VerticalLayout();
+ setContent(main);
+ main.setSizeUndefined();
+ main.setStyleName(Reindeer.PANEL_LIGHT);
+
+ FormLayout form = new FormLayout();
+ form.setSizeUndefined();
+ date.setResolution(DateField.RESOLUTION_MIN);
+ form.addComponent(date);
+ form.addComponent(kilomiters);
+ form.addComponent(title);
+ main.addComponent(form);
+
+ }
+
+ public void loadRun(Workout run) {
+ if (run == null) {
+ close();
+ } else {
+ date.setValue(run.getDate());
+ kilomiters.setValue(String.valueOf(run.getKilometers()));
+ title.setValue(run.getTitle());
+ if (getParent() == null) {
+ workoutLog.getMainWindow().addWindow(this);
+ }
+ kilomiters.focus();
+ }
+ }
+ }
+
+ public class MyFieldFactory extends DefaultFieldFactory {
+
+ public MyFieldFactory(Ticket2998 app) {
+ }
+
+ @Override
+ public Field<?> createField(Container container, Object itemId,
+ Object propertyId, Component uiContext) {
+
+ /*
+ * trainingType is manyToOne relation, give it a combobox
+ */
+ if (propertyId.equals("trainingType")) {
+ return getTrainingTypeComboboxFor(itemId);
+ }
+
+ /*
+ * Secondarytypes is manyToMany relation, give it a multiselect list
+ */
+ if (propertyId.equals("secondaryTypes")) {
+ return getSecondaryTypesList(itemId);
+ }
+
+ final Field<?> f = super.createField(container, itemId, propertyId,
+ uiContext);
+ if (f != null) {
+ if (f instanceof TextField) {
+ TextField tf = (TextField) f;
+ tf.setWidth("100%");
+ }
+ if (propertyId.equals("kilometers")) {
+ f.setWidth("4em");
+ f.addValidator(new Validator() {
+ @Override
+ public void validate(Object value)
+ throws InvalidValueException {
+ // FIXME this does not follow the standard pattern
+ // for validators and has side effects!
+ try {
+ @SuppressWarnings("unused")
+ float f = Float.parseFloat((String) value);
+ } catch (Exception e) {
+ Notification.show("Bad number value");
+ f.setValue(0);
+ }
+ }
+ });
+ }
+ if (propertyId.equals("date")) {
+ ((DateField) f).setResolution(DateField.RESOLUTION_MIN);
+ }
+ }
+ return f;
+
+ }
+
+ private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>();
+
+ private Field<?> getSecondaryTypesList(Object itemId) {
+ ListSelect list = workoutIdToList.get(itemId);
+ if (list == null) {
+ list = new ListSelect();
+ list.setMultiSelect(true);
+ list.addItem("Item1");
+ list.addItem("Item2");
+ list.addItem("Item3");
+ list.addItem("Item4");
+ list.addItem("Item5");
+ // list.setContainerDataSource(trainingTypes);
+ list.setRows(4);
+ workoutIdToList.put(itemId, list);
+ }
+ return list;
+ }
+
+ private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>();
+
+ private Field<?> getTrainingTypeComboboxFor(Object itemId) {
+ ComboBox cb = workoutIdToCombobox.get(itemId);
+ if (cb == null) {
+ final ComboBox cb2 = new ComboBox();
+ cb2.addItem("value1");
+ cb2.addItem("value2");
+ cb2.addItem("value3");
+ cb2.addItem("value4");
+ cb2.setNewItemsAllowed(true);
+
+ workoutIdToCombobox.put(itemId, cb2);
+ cb = cb2;
+ }
+ return cb;
+ }
+ }
+
+ @Override
+ public void init() {
+ buildView();
+ setTheme("reindeer");
+ }
+
+ /**
+ * Builds a simple view for application with Table and a row of buttons
+ * below it.
+ */
+ private void buildView() {
+
+ final LegacyWindow w = new LegacyWindow("Workout Log");
+
+ // set theme and some layout stuff
+ setMainWindow(w);
+ w.getContent().setSizeFull();
+ ((MarginHandler) w.getContent()).setMargin(false);
+
+ Panel p = new Panel("Workout Log");
+ p.setStyleName(Reindeer.PANEL_LIGHT);
+ w.addComponent(p);
+ mainLayout = new VerticalLayout();
+ p.setContent(mainLayout);
+
+ populateAndConfigureTable();
+
+ mainLayout.addComponent(table);
+
+ // make table consume all extra space
+ p.setSizeFull();
+ mainLayout.setSizeFull();
+ mainLayout.setExpandRatio(table, 1);
+ table.setSizeFull();
+ }
+
+ protected void populateAndConfigureTable() {
+ table = new Table();
+
+ table.setWidth("100%");
+ table.setSelectable(true);
+ table.setImmediate(true);
+ table.setColumnCollapsingAllowed(true);
+ table.setColumnWidth("date", 200);
+ table.setColumnWidth("kilometers", 100);
+ // table.addListener(this);
+ table.setTableFieldFactory(new MyFieldFactory(this));
+
+ loadWorkouts();
+
+ table.setEditable(true);
+ }
+
+ /**
+ * Loads container to Table
+ */
+ protected void loadWorkouts() {
+ final BeanItemContainer<Workout> cont;
+ // Use plain HbnContainer
+ cont = new BeanItemContainer<Workout>(Workout.class);
+ table.setContainerDataSource(cont);
+
+ // insert some sample data
+ Calendar c = Calendar.getInstance();
+ c.set(Calendar.MILLISECOND, 0);
+ c.set(Calendar.SECOND, 0);
+ c.set(Calendar.MINUTE, 0);
+
+ String[] titles = new String[] { "A short easy one", "intervals",
+ "very long", "just shaking legs after work",
+ "long one with Paul", "test run" };
+
+ c.add(Calendar.DATE, -1000);
+
+ Random rnd = new Random();
+
+ Workout r;
+
+ for (int i = 0; i < 1000; i++) {
+ r = new Workout();
+ c.set(Calendar.HOUR_OF_DAY,
+ 12 + (rnd.nextInt(11) - rnd.nextInt(11)));
+ r.setDate(c.getTime());
+ r.setTitle(titles[rnd.nextInt(titles.length)]);
+ r.setKilometers(Math.round(rnd.nextFloat() * 30));
+ r.setTrainingType("tt");
+ c.add(Calendar.DATE, 1);
+ cont.addBean(r);
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket3146.java b/uitest/src/com/vaadin/tests/tickets/Ticket3146.java
new file mode 100644
index 0000000000..7973ffa496
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket3146.java
@@ -0,0 +1,100 @@
+package com.vaadin.tests.tickets;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class Ticket3146 extends Application.LegacyApplication {
+
+ Table table;
+ TextField result;
+
+ @Override
+ public void init() {
+ LegacyWindow mainWindow = new LegacyWindow("Test");
+
+ table = new Table();
+ table.addContainerProperty("Items", String.class, null);
+ table.addItem(new String[] { "a" }, "a");
+ table.addItem(new String[] { "b" }, "b");
+ table.addItem(new String[] { "c" }, "c");
+ for (int i = 1; i < 100; ++i) {
+ table.addItem(new String[] { "Item " + i }, "Item " + i);
+ }
+ table.setMultiSelect(true);
+ table.setSelectable(true);
+ table.setImmediate(true);
+ table.setHeight("200px");
+ table.setWidth("200px");
+ mainWindow.addComponent(table);
+
+ Button clearButton = new Button("Clear selection",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ clearSelection();
+ }
+ });
+ mainWindow.addComponent(clearButton);
+ Button clearButton2 = new Button("Clear selection 2",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ clearSelection2();
+ }
+ });
+ mainWindow.addComponent(clearButton2);
+ Button clearButton3 = new Button("Clear selection 3",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ clearSelection3();
+ }
+ });
+ mainWindow.addComponent(clearButton3);
+ Button printButton = new Button("Print selection",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ printSelection();
+ }
+ });
+ mainWindow.addComponent(printButton);
+
+ result = new TextField();
+ result.setHeight("200px");
+ result.setWidth("200px");
+ mainWindow.addComponent(result);
+
+ setMainWindow(mainWindow);
+ }
+
+ void clearSelection() {
+ table.setValue(null);
+ }
+
+ void clearSelection2() {
+ table.setValue(new HashSet<Object>());
+ }
+
+ void clearSelection3() {
+ table.unselect("a");
+ table.unselect("b");
+ table.unselect("c");
+ }
+
+ void printSelection() {
+ String selection = "";
+ for (Object item : (Collection<?>) table.getValue()) {
+ selection = selection + item + ' ';
+ }
+ result.setValue(selection);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket34.java b/uitest/src/com/vaadin/tests/tickets/Ticket34.java
new file mode 100644
index 0000000000..fd5e9c6005
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket34.java
@@ -0,0 +1,106 @@
+package com.vaadin.tests.tickets;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.Application;
+import com.vaadin.server.Page;
+import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket34 extends Application.LegacyApplication {
+
+ private Map<String, Component> views = new HashMap<String, Component>();
+ private VerticalLayout mainLayout;
+ private Component currentView;
+
+ @Override
+ public void init() {
+
+ buildViews(new String[] { "main", "view2", "view3" });
+
+ mainLayout = new VerticalLayout();
+ mainLayout.setSizeFull();
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for URI fragment management/reading", mainLayout);
+ setMainWindow(mainWin);
+
+ mainWin.getPage().addListener(new Page.FragmentChangedListener() {
+
+ @Override
+ public void fragmentChanged(FragmentChangedEvent event) {
+ getMainWindow().showNotification(
+ "Fragment now: " + event.getFragment());
+ // try to change to view mapped by fragment string
+ setView(event.getFragment());
+ }
+ });
+
+ setView("main");
+
+ }
+
+ private void setView(String string) {
+ Component component = views.get(string);
+ if (component == null) {
+ getMainWindow().showNotification(
+ "View called " + string + " not found!");
+ } else if (component != currentView) {
+ if (currentView != null) {
+ mainLayout.replaceComponent(currentView, component);
+ } else {
+ mainLayout.addComponent(component);
+ }
+ // give all extra space for view
+ mainLayout.setExpandRatio(component, 1);
+ currentView = component;
+ }
+ }
+
+ private void buildViews(String[] strings) {
+ for (String string : strings) {
+ Panel p = new Panel(string);
+ p.setSizeFull();
+ ((VerticalLayout) p.getContent()).setSpacing(true);
+ p.addComponent(new Label("This is a simple test case for "
+ + "UriFragmentReader that can be used for"
+ + " adding linking, back/forward button "
+ + "and history support for ajax application. "));
+ StringBuffer sb = new StringBuffer();
+ sb.append("Available views : ");
+ for (String key : strings) {
+ sb.append(key);
+ sb.append(" ");
+ }
+ sb.append("Application will change to them from uri "
+ + "fragment or server initiated via textfield below.");
+ p.addComponent(new Label(sb.toString()));
+
+ final TextField tf = new TextField(
+ "Type view name (will change to that "
+ + "view and change the uri fragment)");
+ p.addComponent(tf);
+ Button b = new Button("Go!");
+ p.addComponent(b);
+ b.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String viewName = tf.getValue().toString();
+ // fragmentChangedListener will change the view if possible
+ event.getButton().getUI().getPage().setFragment(viewName);
+ }
+ });
+
+ views.put(string, p);
+ }
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5053.java b/uitest/src/com/vaadin/tests/tickets/Ticket5053.java
new file mode 100644
index 0000000000..6f8ade15c4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket5053.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.UI.LegacyWindow;
+
+/**
+ * #5053: Last ComboBox item may not be shown if null selection enabled
+ */
+public class Ticket5053 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ ComboBox combobox = new ComboBox("My ComboBox");
+
+ // Enable null selection
+ combobox.setNullSelectionAllowed(true);
+ // Add the item that marks 'null' value
+ String nullitem = "-- none --";
+ combobox.addItem(nullitem);
+ // Designate it was the 'null' value marker
+ combobox.setNullSelectionItemId(nullitem);
+
+ // Add some other items
+ for (int i = 0; i < 10; i++) {
+ combobox.addItem("Item " + i);
+ }
+
+ main.addComponent(combobox);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5157.java b/uitest/src/com/vaadin/tests/tickets/Ticket5157.java
new file mode 100644
index 0000000000..3102a0a56c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket5157.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.event.ShortcutAction.KeyCode;
+import com.vaadin.event.ShortcutListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+/**
+ * Key codes were converted to lower case on the server (overlapping special key
+ * codes for function keys etc.) and then back to upper case on the client.
+ * Therefore, registering e.g. F8 as a key code resulted in "w" being used as
+ * the trigger and F8 being ignored.
+ */
+public class Ticket5157 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
+ setMainWindow(mainWindow);
+
+ Panel p = new Panel();
+ mainWindow.addComponent(p);
+
+ Label l = new Label("Panel with F8 bound");
+ p.addComponent(l);
+
+ TextField f = new TextField();
+ p.addComponent(f);
+
+ p.addAction(new ShortcutListener("F8", KeyCode.F8, null) {
+
+ @Override
+ public void handleAction(Object sender, Object target) {
+ mainWindow.showNotification(getCaption());
+
+ }
+ });
+
+ p.addAction(new ShortcutListener("a", KeyCode.A, null) {
+
+ @Override
+ public void handleAction(Object sender, Object target) {
+ mainWindow.showNotification(getCaption());
+
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5952.java b/uitest/src/com/vaadin/tests/tickets/Ticket5952.java
new file mode 100644
index 0000000000..92cd0290d6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket5952.java
@@ -0,0 +1,30 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket5952 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
+ setMainWindow(mainWindow);
+
+ String mathml = "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>"
+ + "<mrow>"
+ + " <msup>"
+ + " <mi>x</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " <msup>"
+ + " <mi>c</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " </mrow>" + "</math>";
+ Label mathLabel = new Label(mathml, ContentMode.XML);
+ mainWindow.addComponent(mathLabel);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket6002.java b/uitest/src/com/vaadin/tests/tickets/Ticket6002.java
new file mode 100644
index 0000000000..887652aee7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket6002.java
@@ -0,0 +1,91 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class Ticket6002 extends TestBase {
+
+ @Override
+ public void setup() {
+ LegacyWindow main = getMainWindow();
+
+ final VerticalLayout mainLayout = new VerticalLayout();
+ main.setContent(mainLayout);
+
+ mainLayout.addComponent(new Label(
+ "Replace the floating-point values with an integer"));
+
+ // ///////////////////////////////////////////////////
+ // Better working case
+
+ final ObjectProperty<Double> property1 = new ObjectProperty<Double>(
+ new Double(42.0));
+
+ // A text field that changes its caption
+ final TextField tf1 = new TextField(
+ "Changing this field modifies only the textfield", property1);
+ tf1.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ // This value change event is called twice if the new
+ // input value is an integer. The second time is during
+ // paint() of AbstractOrderedLayout.
+
+ System.out.println("Value 2 is: " + property1.getValue());
+
+ tf1.setCaption("With caption " + property1.getValue());
+ }
+ });
+ tf1.setImmediate(true);
+ mainLayout.addComponent(tf1);
+
+ // ///////////////////////////////////////////////////
+ // Totally failing case
+
+ final ObjectProperty<Double> property2 = new ObjectProperty<Double>(
+ new Double(42.0));
+
+ // A text field that adds new components
+ final TextField tf2 = new TextField(
+ "Changing this field modifies the layout - do it twice",
+ property2);
+ tf2.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ // This value change event is called twice if the new
+ // input value is an integer. The second time is during
+ // paint() of AbstractOrderedLayout.
+
+ System.out.println("Value 1 is: " + property2.getValue());
+
+ // When this listener is called the second time in paint(), the
+ // add operation causes a ConcurrentModificationException
+ mainLayout.addComponent(new Label(
+ "Added a component, value is " + property2.getValue()));
+ }
+ });
+ tf2.setImmediate(true);
+ mainLayout.addComponent(tf2);
+
+ mainLayout.setSpacing(true);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Change the numbers to integer value or add 0 in the decimal representation. "
+ + "This causes a secondary call during paint() to reformat the value, which causes ConcurrentModificationException in the second case.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6002;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket677.java b/uitest/src/com/vaadin/tests/tickets/Ticket677.java
new file mode 100644
index 0000000000..1c66f67ca1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket677.java
@@ -0,0 +1,216 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+
+public class Ticket677 extends Application.LegacyApplication {
+
+ private static final Label info = new Label(
+ "<li> keep debug window open to see variable changes"
+ + "<li> disable root panel w/ toggle button"
+ + "<li> toggle one of the subpanels"
+ + "<li> we attempt to focus the subpanels first textfield"
+ + "<li> focusing should fail (try tabbing as well) [worked previousy]"
+ + "<li> no variable changes should be sent from disabled fields [changed sent previously]"
+ + "<li> try further toggling and tabbing around",
+ ContentMode.RAW);
+
+ Panel root = new Panel("Enabled");
+ Panel one = new Panel("Enabled");
+ Panel two = new Panel("Enabled");
+ Form form;
+ Table table;
+
+ @Override
+ public void init() {
+ LegacyWindow main = new LegacyWindow();
+ setMainWindow(main);
+
+ main.addComponent(info);
+
+ HorizontalLayout l = new HorizontalLayout();
+ main.addComponent(l);
+
+ l.addComponent(new Button("Toggle root panel",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggle(root);
+ }
+ }));
+ l.addComponent(new Button("Toggle panel one",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggle(one);
+ }
+ }));
+ l.addComponent(new Button("Toggle panel two",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggle(two);
+ }
+ }));
+ l.addComponent(new Button("Toggle form", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggle(form);
+ }
+ }));
+ l.addComponent(new Button("Toggle table", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggle(table);
+ }
+ }));
+
+ root.setContent(new GridLayout(2, 3));
+ main.addComponent(root);
+
+ TextField tf = new TextField("Enabled");
+ tf.setImmediate(true);
+ root.addComponent(tf);
+ tf = new TextField("Disabled");
+ tf.setImmediate(true);
+ tf.setEnabled(false);
+ root.addComponent(tf);
+
+ root.addComponent(one);
+ tf = new TextField("Enabled");
+ tf.setImmediate(true);
+ one.addComponent(tf);
+ tf = new TextField("Disabled");
+ tf.setImmediate(true);
+ tf.setEnabled(false);
+ one.addComponent(tf);
+
+ root.addComponent(two);
+ tf = new TextField("Enabled");
+ tf.setImmediate(true);
+ two.addComponent(tf);
+ tf = new TextField("Disabled");
+ tf.setImmediate(true);
+ tf.setEnabled(false);
+ two.addComponent(tf);
+
+ form = new Form();
+ form.setCaption("Enabled");
+ form.setFormFieldFactory(new DefaultFieldFactory() {
+
+ @Override
+ public Field<?> createField(Item item, Object propertyId,
+ Component uiContext) {
+ Field<?> f = super.createField(item, propertyId, uiContext);
+ f.setEnabled(!"disabled".equals(propertyId));
+ return f;
+ }
+
+ });
+ form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
+ root.addComponent(form);
+
+ table = new Table("Enabled");
+ table.setPageLength(7);
+ table.addContainerProperty("Text", String.class, null);
+ for (int i = 0; i < 150; i++) {
+ Item item = table.addItem("Item" + i);
+ Property<?> p = item.getItemProperty("Text");
+ p.setValue(i % 5 == 0 ? "enabled" : "disabled");
+ }
+
+ table.setTableFieldFactory(new DefaultFieldFactory() {
+
+ @Override
+ public Field<?> createField(Container container, Object itemId,
+ Object propertyId, Component uiContext) {
+ Field<?> f = super.createField(container, itemId, propertyId,
+ uiContext);
+ Item item = container.getItem(itemId);
+ Property<?> p = item.getItemProperty(propertyId);
+ if ("disabled".equals(p.getValue())) {
+ f.setEnabled(false);
+ }
+ return f;
+ }
+
+ });
+ table.setEditable(true);
+ root.addComponent(table);
+
+ }
+
+ private void toggle(Component c) {
+ boolean enable = "Disabled".equals(c.getCaption());
+ c.setEnabled(enable);
+ c.setCaption((enable ? "Enabled" : "Disabled"));
+ if (c instanceof ComponentContainer) {
+ TextField tf = (TextField) ((ComponentContainer) c)
+ .getComponentIterator().next();
+ tf.focus();
+ }
+ }
+
+ class MyBean {
+ boolean on = false;
+ int number = 1;
+ String rw = "read/write";
+ String r = "read";
+ String disabled = "disabled";
+
+ public boolean isOn() {
+ return on;
+ }
+
+ public void setOn(boolean on) {
+ this.on = on;
+ }
+
+ public int getNumber() {
+ return number;
+ }
+
+ public void setNumber(int number) {
+ this.number = number;
+ }
+
+ public String getRw() {
+ return rw;
+ }
+
+ public void setRw(String rw) {
+ this.rw = rw;
+ }
+
+ public String getDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public String getR() {
+ return r;
+ }
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket695.java b/uitest/src/com/vaadin/tests/tickets/Ticket695.java
new file mode 100644
index 0000000000..e539f999b3
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket695.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.tickets;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+
+@SuppressWarnings("serial")
+public class Ticket695 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+ final LegacyWindow w = new LegacyWindow("Serialization test #695");
+ setMainWindow(w);
+ Button b = new Button("Serialize ApplicationContext");
+ w.addComponent(b);
+ b.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ try {
+ ObjectOutputStream oos = new ObjectOutputStream(buffer);
+ long t = System.currentTimeMillis();
+ oos.writeObject(getContext());
+ w.showNotification("ApplicationContext serialized ("
+ + buffer.size() + "bytes) in "
+ + (System.currentTimeMillis() - t) + "ms");
+ } catch (IOException e) {
+ e.printStackTrace();
+ w.showNotification("ApplicationContext serialization failed - see console for stacktrace");
+ }
+
+ }
+ });
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket736.java b/uitest/src/com/vaadin/tests/tickets/Ticket736.java
new file mode 100644
index 0000000000..417ee86fac
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket736.java
@@ -0,0 +1,185 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Validator;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket736 extends Application.LegacyApplication {
+
+ Address address = new Address();
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #736");
+ setMainWindow(mainWin);
+
+ setTheme("runo");
+
+ // Create form for editing address
+ final Form f = new Form();
+ f.setItemDataSource(new BeanItem<Address>(address, new String[] {
+ "name", "street", "zip", "city", "state", "country" }));
+ f.setCaption("Office address");
+ f.setIcon(new ThemeResource("../runo/icons/16/document.png"));
+ f.setDescription("Jep jpe, this is form description.");
+ mainWin.addComponent(f);
+
+ // Select to use buffered mode for editing to enable commit and discard
+ f.setBuffered(true);
+ Button commit = new Button("Commit", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ f.commit();
+ }
+ });
+ Button discard = new Button("Discard", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ f.discard();
+ }
+
+ });
+ HorizontalLayout ol = new HorizontalLayout();
+ ol.setHeight("3em");
+ ol.addComponent(commit);
+ ol.setComponentAlignment(commit, Alignment.TOP_RIGHT);
+ ol.addComponent(discard);
+ f.setFooter(ol);
+
+ // Add some validators for the form
+ f.getField("zip").addValidator(
+ new IntegerValidator("'{0}' is not a number"));
+ ((AbstractComponent) f.getField("zip")).setDescription("Jepjep");
+ ((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource(
+ "../runo/icons/16/folder.png"));
+ f.getField("state").addValidator(new IsValidState());
+ f.getField("name").setRequired(true);
+ f.getField("street").setRequired(true);
+ f.getField("city").setRequired(true);
+ f.getField("zip").setRequired(true);
+
+ // Debug form properties
+ final Panel formProperties = new Panel("Form properties");
+ formProperties.setWidth("200px");
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "writeThrough", "invalidCommitted",
+ "validationVisible", "immediate" };
+ for (int i = 0; i < visibleProps.length; i++) {
+ CheckBox b = new CheckBox(visibleProps[i],
+ new MethodProperty<Boolean>(f, visibleProps[i]));
+ b.setImmediate(true);
+ formProperties.addComponent(b);
+ }
+ mainWin.addComponent(formProperties);
+
+ // Debug the internal state of the address-object
+ mainWin.addComponent(new Button("Show state of the address object",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ mainWin.showNotification(address.toString());
+ }
+ }));
+ }
+
+ /** Address pojo. */
+ public static class Address {
+ String name = "";
+ String street = "";
+ String zip = "";
+ String city = "";
+ String state = "";
+ String country = "";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @Override
+ public String toString() {
+ return name + "; " + street + "; " + city + " " + zip
+ + (state != null ? " " + state : "") + " " + country;
+ }
+
+ }
+
+ /** Simple state validator */
+ static class IsValidState implements Validator {
+
+ @Override
+ public void validate(Object value) throws InvalidValueException {
+ // Empty and null are accepted values
+ if (value == null || "".equals("" + value)) {
+ return;
+ }
+
+ // Otherwise state must be two capital letter combo
+ if (value.toString().length() != 2
+ || !value.toString().equals(("" + value).toUpperCase())) {
+ throw new InvalidValueException(
+ "State must be either two capital letter abreviation or left empty");
+ }
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket8291.java b/uitest/src/com/vaadin/tests/tickets/Ticket8291.java
new file mode 100644
index 0000000000..0280db0693
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket8291.java
@@ -0,0 +1,125 @@
+package com.vaadin.tests.tickets;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.vaadin.data.Container.Filter;
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.Table;
+
+/**
+ * Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to
+ * the end and its size reduced.
+ */
+public class Ticket8291 extends UI {
+
+ @Override
+ public void init(WrappedRequest request) {
+ setContent(new TestView());
+ }
+
+ private static class DecimateFilter implements Filter {
+ @Override
+ public boolean passesFilter(Object itemId, Item item)
+ throws UnsupportedOperationException {
+ return ((((TestObject) itemId).property3 % 10) == 0);
+ }
+
+ @Override
+ public boolean appliesToProperty(Object propertyId) {
+ return true;
+ }
+ }
+
+ private static class TestView extends HorizontalLayout {
+
+ private Filter filter = null;
+
+ private boolean reduceData;
+
+ private TestView() {
+ final Table table = new Table();
+ List<TestObject> data = createData(1000);
+ final BeanItemContainer<TestObject> container = new BeanItemContainer<TestObject>(
+ TestObject.class, data) {
+
+ @Override
+ public int size() {
+ if (reduceData) {
+ return 100;
+ } else {
+ return super.size();
+ }
+ }
+ };
+ table.setContainerDataSource(container);
+ addComponent(table);
+ Button button = new Button("Click");
+ button.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ reduceData = !reduceData;
+ table.refreshRowCache();
+ }
+ });
+ addComponent(button);
+ Button button2 = new Button("Filter");
+ button2.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (filter != null) {
+ container.removeAllContainerFilters();
+ filter = null;
+ } else {
+ filter = new DecimateFilter();
+ container.addContainerFilter(filter);
+ }
+ table.refreshRowCache();
+ }
+ });
+ addComponent(button2);
+ }
+ }
+
+ private static List<TestObject> createData(int count) {
+ ArrayList<TestObject> data = new ArrayList<TestObject>(count);
+ for (int i = 0; i < count; i++) {
+ data.add(new TestObject("string-" + i, new Date(), i));
+ }
+ return data;
+ }
+
+ public static class TestObject {
+
+ private String property1;
+ private Date property2;
+ private Integer property3;
+
+ public TestObject(String property1, Date property2, Integer property3) {
+ this.property1 = property1;
+ this.property2 = property2;
+ this.property3 = property3;
+ }
+
+ public String getProperty1() {
+ return property1;
+ }
+
+ public Date getProperty2() {
+ return property2;
+ }
+
+ public Integer getProperty3() {
+ return property3;
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket846.java b/uitest/src/com/vaadin/tests/tickets/Ticket846.java
new file mode 100644
index 0000000000..407663c6c6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket846.java
@@ -0,0 +1,51 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextField;
+
+public class Ticket846 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #846");
+ setMainWindow(mainWin);
+
+ final TextField tx = new TextField("Integer");
+ mainWin.addComponent(tx);
+ tx.setImmediate(true);
+ tx.addValidator(new IntegerValidator("{0} is not a number"));
+
+ final String[] visibleProps = { "required", "invalidAllowed",
+ "readOnly", "readThrough", "invalidCommitted",
+ "validationVisible" };
+ for (int i = 0; i < visibleProps.length; i++) {
+ CheckBox b = new CheckBox(visibleProps[i],
+ new MethodProperty<Boolean>(tx, visibleProps[i]));
+ b.setImmediate(true);
+ mainWin.addComponent(b);
+ }
+
+ // tx.setIcon(new ThemeResource("icons/16/folder.png"));
+
+ mainWin.addComponent(new Button("Validate integer",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(
+ com.vaadin.ui.Button.ClickEvent event) {
+ mainWin.showNotification("The field is "
+ + (tx.isValid() ? "" : "not ") + "valid");
+ };
+ }));
+ TextField caption = new TextField("Caption",
+ new MethodProperty<String>(tx, "caption"));
+ caption.setImmediate(true);
+ mainWin.addComponent(caption);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket932.java b/uitest/src/com/vaadin/tests/tickets/Ticket932.java
new file mode 100644
index 0000000000..c12e2fcad3
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket932.java
@@ -0,0 +1,64 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class Ticket932 extends Application.LegacyApplication {
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for max length feature");
+ setMainWindow(mainWin);
+
+ final TextField tx = new TextField(
+ "Textfield with maxlenght 10, single row");
+ tx.setImmediate(true);
+ tx.setMaxLength(10);
+
+ final Label l = new Label();
+
+ Button b = new Button("Check value");
+ b.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ l.setValue("Length: " + tx.getValue().toString().length()
+ + " Content: " + tx.getValue());
+ }
+ });
+
+ mainWin.addComponent(tx);
+ mainWin.addComponent(b);
+
+ final TextArea tx2 = new TextArea(
+ "Textfield with maxlenght 10, multirow ");
+ mainWin.addComponent(tx2);
+ tx2.setImmediate(true);
+ tx2.setRows(5);
+ tx2.setMaxLength(10);
+
+ Button b2 = new Button("Check value");
+ b2.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ l.setValue("Length: " + tx2.getValue().toString().length()
+ + " Content: " + tx2.getValue());
+ }
+ });
+
+ mainWin.addComponent(tx);
+ mainWin.addComponent(b);
+
+ mainWin.addComponent(l);
+
+ }
+
+}