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.

UncollapsedCollumnWidth.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Button;
  4. import com.vaadin.v7.ui.Table;
  5. public class UncollapsedCollumnWidth extends TestBase {
  6. @Override
  7. protected void setup() {
  8. final Table table = new Table();
  9. table.addContainerProperty("Col1", String.class, "");
  10. table.addContainerProperty("Col2", String.class, "");
  11. table.setColumnCollapsingAllowed(true);
  12. table.setColumnCollapsed("Col2", true);
  13. table.setColumnWidth("Col1", 150);
  14. table.setWidth("400px");
  15. table.addItem(new Object[] { "Cell 1", "Cell 2" }, new Object());
  16. addComponent(table);
  17. addComponent(new Button("Uncollapse col2",
  18. event -> table.setColumnCollapsed("Col2", false)));
  19. }
  20. @Override
  21. protected String getDescription() {
  22. return "Uncollapsing col2 after resizing col1 should set a reasonable width for col2. Additionally, the width of the header and the cell content should be the same.";
  23. }
  24. @Override
  25. protected Integer getTicketNumber() {
  26. return Integer.valueOf(7012);
  27. }
  28. }