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.

LastColumnNegative.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Button;
  4. import com.vaadin.ui.VerticalLayout;
  5. import com.vaadin.v7.data.util.IndexedContainer;
  6. import com.vaadin.v7.ui.Table;
  7. public class LastColumnNegative extends TestBase {
  8. Table table = setupTable();
  9. VerticalLayout wrapper = new VerticalLayout();
  10. @Override
  11. public void setup() {
  12. Button addButton = new Button("Add a table",
  13. event -> wrapper.addComponent(table));
  14. Button removeButton = new Button("Remove a table",
  15. event -> wrapper.removeComponent(table));
  16. Button shrinkWrapper = new Button("Shrink wrapper",
  17. event -> wrapper.setWidth("400px"));
  18. addComponent(addButton);
  19. addComponent(removeButton);
  20. addComponent(shrinkWrapper);
  21. addComponent(wrapper);
  22. }
  23. private Table setupTable() {
  24. IndexedContainer container = new IndexedContainer();
  25. container.addContainerProperty("fileName", String.class,
  26. "Long enough string to cause a scrollbar when the window is set to a dencently small size.");
  27. container.addContainerProperty("size", Long.class, 23958l);
  28. container.addItem();
  29. container.addItem();
  30. container.addItem();
  31. Table table = new Table();
  32. table.setContainerDataSource(container);
  33. table.setWidth("100%");
  34. table.setColumnCollapsingAllowed(true);
  35. table.setColumnExpandRatio("size", 1);
  36. return table;
  37. }
  38. @Override
  39. protected String getDescription() {
  40. return "Table rendering should not fail when view becomes smaller than the table width.";
  41. }
  42. @Override
  43. protected Integer getTicketNumber() {
  44. return 8411;
  45. }
  46. }