You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TableExtraScrollbars.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.tests.components.AbstractTestCase;
  3. import com.vaadin.ui.LegacyWindow;
  4. import com.vaadin.ui.VerticalLayout;
  5. import com.vaadin.v7.data.Container;
  6. import com.vaadin.v7.data.Item;
  7. import com.vaadin.v7.data.util.IndexedContainer;
  8. import com.vaadin.v7.ui.Table;
  9. public class TableExtraScrollbars extends AbstractTestCase {
  10. private static int PROPS = 15;
  11. private static int ROWS = 1000;
  12. @Override
  13. public void init() {
  14. setTheme("runo");
  15. LegacyWindow w = new LegacyWindow("Table scrollbars bug example");
  16. setMainWindow(w);
  17. VerticalLayout vl = new VerticalLayout();
  18. vl.setSizeFull();
  19. vl.addComponent(createTable());
  20. w.setContent(vl);
  21. }
  22. protected Table createTable() {
  23. Table table = new Table(null, createContainer());
  24. table.setSizeFull();
  25. table.setPageLength(50);
  26. table.setColumnReorderingAllowed(true);
  27. table.setSelectable(true);
  28. return table;
  29. }
  30. protected Container createContainer() {
  31. Container container = new IndexedContainer();
  32. for (int i = 0; i < PROPS; ++i) {
  33. container.addContainerProperty("prop" + i, String.class, null);
  34. }
  35. for (int i = 0; i < ROWS; ++i) {
  36. Item item = container.addItem(i);
  37. for (int p = 0; p < PROPS; ++p) {
  38. item.getItemProperty("prop" + p)
  39. .setValue("property value 1234567890");
  40. }
  41. }
  42. return container;
  43. }
  44. @Override
  45. protected String getDescription() {
  46. return "Scrolling down in the table should not add extra scrollbars";
  47. }
  48. @Override
  49. protected Integer getTicketNumber() {
  50. return 4489;
  51. }
  52. }