diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesPageLength0.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesPageLength0.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesPageLength0.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesPageLength0.java new file mode 100644 index 0000000000..20412bf0e2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTablePartialUpdatesPageLength0.java @@ -0,0 +1,68 @@ +package com.vaadin.tests.components.treetable; + +import com.vaadin.data.Container.Hierarchical; +import com.vaadin.data.util.HierarchicalContainer; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.TreeTable; + +public class TreeTablePartialUpdatesPageLength0 extends TestBase { + + @Override + protected void setup() { + setTheme("reindeer-tests"); + TreeTable tt = new TreeTable(); + tt.addStyleName("table-equal-rowheight"); + tt.setPageLength(0); + tt.setContainerDataSource(makeHierarchicalContainer()); + tt.setWidth("300px"); + addComponent(tt); + tt.getParent().setHeight(null); + tt.getParent().getParent().setHeight(null); + } + + private Hierarchical makeHierarchicalContainer() { + HierarchicalContainer hc = new HierarchicalContainer(); + hc.addContainerProperty("p1", String.class, ""); + hc.addContainerProperty("p2", String.class, ""); + + Object r1 = hc.addItem(); + hc.getItem(r1).getItemProperty("p1").setValue("root1"); + hc.getItem(r1).getItemProperty("p2").setValue("root1"); + + Object r2 = hc.addItem(); + hc.getItem(r2).getItemProperty("p1").setValue("root2"); + hc.getItem(r2).getItemProperty("p2").setValue("root2"); + + Object r3 = hc.addItem(); + hc.getItem(r3).getItemProperty("p1").setValue("root3"); + hc.getItem(r3).getItemProperty("p2").setValue("root3"); + + Object r4 = hc.addItem(); + hc.getItem(r4).getItemProperty("p1").setValue("END"); + hc.setChildrenAllowed(r4, false); + + addNodesToRoot(hc, r1, 10); + addNodesToRoot(hc, r2, 200); + addNodesToRoot(hc, r3, 200); + return hc; + } + + private void addNodesToRoot(HierarchicalContainer hc, Object root, int count) { + for (int ix = 0; ix < count; ix++) { + Object id = hc.addItem(); + hc.getItem(id).getItemProperty("p1").setValue(String.valueOf(ix)); + hc.setParent(id, root); + } + } + + @Override + protected String getDescription() { + return ""; + } + + @Override + protected Integer getTicketNumber() { + return 6722; + } + +} |