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.

MoveComponentsFromGridLayoutToInnerLayout.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.vaadin.tests.components.gridlayout;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.AbstractOrderedLayout;
  5. import com.vaadin.ui.Button;
  6. import com.vaadin.ui.GridLayout;
  7. import com.vaadin.ui.Label;
  8. import com.vaadin.ui.VerticalLayout;
  9. public class MoveComponentsFromGridLayoutToInnerLayout
  10. extends AbstractReindeerTestUI {
  11. protected Button testButton;
  12. private GridLayout gl;
  13. protected AbstractOrderedLayout vl;
  14. @Override
  15. protected void setup(VaadinRequest request) {
  16. gl = new GridLayout();
  17. gl.setHideEmptyRowsAndColumns(true);
  18. gl.setWidth("200px");
  19. gl.setHeight("200px");
  20. testButton = new Button("Click to move to inner layout",
  21. event -> vl.addComponent(testButton));
  22. gl.addComponent(testButton);
  23. vl = new VerticalLayout();
  24. vl.setMargin(false);
  25. vl.setSpacing(false);
  26. vl.addComponent(new Label("I'm inside the inner layout"));
  27. gl.addComponent(vl);
  28. addComponent(gl);
  29. Button b = new Button("Repaint inner layout",
  30. event -> vl.markAsDirty());
  31. addComponent(b);
  32. }
  33. @Override
  34. protected String getTestDescription() {
  35. return "Click the first button to move it from an outer layout to an inner. Then click the second button to repaint the inner layout.";
  36. }
  37. @Override
  38. protected Integer getTicketNumber() {
  39. return 6060;
  40. }
  41. }