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.

GridSpanEmptyColumns.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.layouts.gridlayout;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.GridLayout;
  5. import com.vaadin.ui.Label;
  6. public class GridSpanEmptyColumns extends AbstractReindeerTestUI {
  7. @Override
  8. protected void setup(VaadinRequest request) {
  9. GridLayout gridLayout = new GridLayout(3, 1);
  10. gridLayout.setWidth("1000px");
  11. Label bigCell = new Label("big cell");
  12. bigCell.setId("bigCell");
  13. bigCell.setWidth("100%"); // Only to make test backwards compatible
  14. Label smallCell = new Label("small cell");
  15. smallCell.setId("smallCell");
  16. smallCell.setWidth("100%"); // Only to make test backwards compatible
  17. gridLayout.addComponent(bigCell, 0, 0, 1, 0); // spans first two columns
  18. gridLayout.addComponent(smallCell, 2, 0, 2, 0); // last column only
  19. addComponent(gridLayout);
  20. }
  21. @Override
  22. protected String getTestDescription() {
  23. return "A 3x1 grid has a spanned component on the first two cells and a component on the last cell. The two components should occupy 2/3 and 1/3 of the available space respectively, instead of 1/2 each.";
  24. }
  25. @Override
  26. protected Integer getTicketNumber() {
  27. return 14335;
  28. }
  29. }