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.

TableRowHeight2.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.annotations.Theme;
  3. import com.vaadin.server.VaadinRequest;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.ui.Button;
  6. import com.vaadin.ui.HorizontalLayout;
  7. import com.vaadin.v7.data.Item;
  8. import com.vaadin.v7.ui.Table;
  9. import com.vaadin.v7.ui.themes.BaseTheme;
  10. @Theme("tests-tickets")
  11. public class TableRowHeight2 extends AbstractReindeerTestUI {
  12. @Override
  13. protected String getTestDescription() {
  14. return "The table contains 2 rows, which both should be shown completely as the table height is undefined.";
  15. }
  16. @Override
  17. protected Integer getTicketNumber() {
  18. return 2747;
  19. }
  20. @SuppressWarnings("unchecked")
  21. @Override
  22. protected void setup(VaadinRequest request) {
  23. HorizontalLayout vl = new HorizontalLayout();
  24. vl.setSizeFull();
  25. Table table = new Table();
  26. int COL_TITLE_W = 200;
  27. int COL_TEST_W = 98;
  28. table.setPageLength(0);
  29. table.setColumnWidth("title", COL_TITLE_W);
  30. table.setColumnWidth("test", COL_TEST_W);
  31. table.addContainerProperty("title", Button.class, "");
  32. table.addContainerProperty("test", Button.class, "");
  33. for (int i = 0; i < 2; i++) {
  34. Item item = table.addItem(new Object());
  35. Button b = new Button();
  36. b.setWidth("100%");
  37. b.setStyleName(BaseTheme.BUTTON_LINK);
  38. b.addStyleName("nowraplink");
  39. b.setCaption(
  40. "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper, elit quis elementum iaculis, dui est rutrum risus, at cursus sem leo eget arcu. Proin vel eros ut tortor luctus pretium. Nulla facilisi. Donec in dui. Proin ac diam vitae massa tempus faucibus. Fusce eu risus. Nunc ac risus. Cras libero.");
  41. item.getItemProperty("title").setValue(b);
  42. Button c = new Button("test");
  43. item.getItemProperty("test").setValue(c);
  44. }
  45. vl.addComponent(table);
  46. addComponent(vl);
  47. }
  48. }