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.

ComponentsInTreeTable.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.vaadin.tests.components.treetable;
  2. import com.vaadin.shared.ui.ContentMode;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.Component;
  6. import com.vaadin.ui.HorizontalLayout;
  7. import com.vaadin.ui.Label;
  8. import com.vaadin.ui.Layout;
  9. import com.vaadin.ui.VerticalLayout;
  10. import com.vaadin.v7.ui.TreeTable;
  11. public class ComponentsInTreeTable extends TestBase {
  12. @Override
  13. protected void setup() {
  14. TreeTable tt = new TreeTable();
  15. tt.setWidth("300px");
  16. tt.setHeight("300px");
  17. addComponent(tt);
  18. tt.addContainerProperty("component", Component.class, "");
  19. tt.addContainerProperty("type", String.class, "bar");
  20. Layout l = new HorizontalLayout();
  21. l.addComponent(new Label("bar"));
  22. l.addComponent(new Label("bar"));
  23. tt.addItem(new Object[] { l, "HorizontalLayout" }, 1);
  24. l = new VerticalLayout();
  25. l.addComponent(new Label("baz"));
  26. l.addComponent(new Label("baz"));
  27. tt.addItem(new Object[] { l, "VerticalLayout" }, 2);
  28. Label lbl = new Label("<b>foo</b><br/><i>bar</i>");
  29. lbl.setContentMode(ContentMode.HTML);
  30. tt.addItem(new Object[] { lbl, "Label" }, 3);
  31. tt.addItem(new Object[] { new Button("Test"), "Button" }, 4);
  32. tt.setParent(4, 3);
  33. }
  34. @Override
  35. protected String getDescription() {
  36. return "Components in TreeTable cells should be rendered inline with the expand/collapse arrow";
  37. }
  38. @Override
  39. protected Integer getTicketNumber() {
  40. return 7387;
  41. }
  42. }