aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2008-08-28 12:29:37 +0000
committerMarc Englund <marc.englund@itmill.com>2008-08-28 12:29:37 +0000
commita1bc75f67f66b01053f4ab48e8de53c48e198ff8 (patch)
tree742ad226f12d5cafc227a5a970f1270f11c6690c
parent05fd737e03c63fd9d69a4169c7130f64d8868f9b (diff)
downloadvaadin-framework-a1bc75f67f66b01053f4ab48e8de53c48e198ff8.tar.gz
vaadin-framework-a1bc75f67f66b01053f4ab48e8de53c48e198ff8.zip
Added testcase for #1983
svn changeset:5289/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/tests/tickets/Ticket1983.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket1983.java b/src/com/itmill/toolkit/tests/tickets/Ticket1983.java
new file mode 100644
index 0000000000..0948cb89c2
--- /dev/null
+++ b/src/com/itmill/toolkit/tests/tickets/Ticket1983.java
@@ -0,0 +1,86 @@
+package com.itmill.toolkit.tests.tickets;
+
+import com.itmill.toolkit.Application;
+import com.itmill.toolkit.data.util.IndexedContainer;
+import com.itmill.toolkit.terminal.Sizeable;
+import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.Layout;
+import com.itmill.toolkit.ui.OrderedLayout;
+import com.itmill.toolkit.ui.SplitPanel;
+import com.itmill.toolkit.ui.Table;
+import com.itmill.toolkit.ui.Window;
+
+/**
+ * Test class for ticket 1983
+ */
+public class Ticket1983 extends Application {
+
+ public void init() {
+ Window main = new Window("Test for ticket 1983");
+ main.setLayout(new TestLayout());
+ setMainWindow(main);
+ }
+
+ private static class TestLayout extends SplitPanel {
+ boolean isLong = true;
+
+ public TestLayout() {
+ super(ORIENTATION_HORIZONTAL);
+
+ setSplitPosition(200, Sizeable.UNITS_PIXELS);
+ setMargin(false);
+ setLocked(true);
+
+ final SplitPanel leftSide = initLeftSide();
+ setFirstComponent(leftSide);
+
+ final Layout rightSide = new OrderedLayout();
+ rightSide.setHeight("100%");
+ setSecondComponent(rightSide);
+ }
+
+ private SplitPanel initLeftSide() {
+ final SplitPanel leftSide = new SplitPanel(ORIENTATION_VERTICAL);
+ leftSide.setHeight("100%");
+
+ final IndexedContainer dataSource = new IndexedContainer();
+ final String propId = "col";
+ dataSource.addContainerProperty(propId, String.class, null);
+ final Object itemId = dataSource.addItem();
+ dataSource.getItem(itemId).getItemProperty(propId).setValue(
+ "Very long value that makes a scrollbar appear for sure");
+
+ final Table table = new Table();
+ 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() {
+ 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");
+ isLong = false;
+ } else {
+ dataSource
+ .getItem(itemId)
+ .getItemProperty(propId)
+ .setValue(
+ "Very long value that makes a scrollbar appear for sure");
+ isLong = true;
+ }
+ // Works the same way with or without repaint request
+ table.requestRepaint();
+ }
+ });
+ leftSide.setFirstComponent(button);
+
+ return leftSide;
+ }
+ }
+}