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.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.Button.ClickEvent;
  5. import com.vaadin.ui.Table;
  6. public class UncollapsedCollumnWidth extends TestBase {
  7. @Override
  8. protected void setup() {
  9. final Table table = new Table();
  10. table.addContainerProperty("Col1", String.class, "");
  11. table.addContainerProperty("Col2", String.class, "");
  12. table.setColumnCollapsingAllowed(true);
  13. table.setColumnCollapsed("Col2", true);
  14. table.setColumnWidth("Col1", 150);
  15. table.setWidth("400px");
  16. table.addItem(new Object[] { "Cell 1", "Cell 2" }, new Object());
  17. addComponent(table);
  18. addComponent(new Button("Uncollapse col2", new Button.ClickListener() {
  19. @Override
  20. public void buttonClick(ClickEvent event) {
  21. table.setColumnCollapsed("Col2", false);
  22. }
  23. }));
  24. }
  25. @Override
  26. protected String getDescription() {
  27. 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.";
  28. }
  29. @Override
  30. protected Integer getTicketNumber() {
  31. return Integer.valueOf(7012);
  32. }
  33. }