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.

EmptySpaceOnPageAfterExpandedComponent.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package com.vaadin.tests.components.layout;
  2. import com.vaadin.server.Page;
  3. import com.vaadin.server.VaadinRequest;
  4. import com.vaadin.tests.components.AbstractReindeerTestUI;
  5. import com.vaadin.ui.GridLayout;
  6. import com.vaadin.ui.Panel;
  7. import com.vaadin.ui.VerticalLayout;
  8. import com.vaadin.v7.ui.TextArea;
  9. import com.vaadin.v7.ui.TextField;
  10. public class EmptySpaceOnPageAfterExpandedComponent
  11. extends AbstractReindeerTestUI {
  12. @Override
  13. protected void setup(VaadinRequest request) {
  14. getLayout().setHeight("200px");
  15. VerticalLayout container = new VerticalLayout();
  16. container.setStyleName("mystyle");
  17. container.setId("container");
  18. container.setMargin(false);
  19. container.setSizeFull();
  20. addComponent(container);
  21. Page.getCurrent().getStyles()
  22. .add(".mystyle {border: 1px solid black;}");
  23. GridLayout grid = new GridLayout();
  24. grid.setSpacing(true);
  25. TextField text1 = new TextField();
  26. text1.setCaption("Text1");
  27. text1.setRequired(true);
  28. grid.setColumns(1);
  29. grid.setRows(1);
  30. grid.addComponent(text1);
  31. grid.setSizeUndefined();
  32. Panel panel = new Panel();
  33. panel.setContent(grid);
  34. panel.setSizeUndefined();
  35. container.addComponent(panel);
  36. TextArea expand = new TextArea();
  37. expand.setId("expandedElement");
  38. expand.setSizeFull();
  39. container.addComponent(expand);
  40. container.setExpandRatio(expand, 1);
  41. }
  42. @Override
  43. protected String getTestDescription() {
  44. return "Height calculation should be correct in Chrome. There should not be any empty space after expanded component.";
  45. }
  46. @Override
  47. protected Integer getTicketNumber() {
  48. return 12672;
  49. }
  50. }