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.

InsertRowInMiddle.java 1.0KB

12345678910111213141516171819202122232425262728293031323334
  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.Button;
  5. import com.vaadin.ui.GridLayout;
  6. import com.vaadin.ui.Label;
  7. public class InsertRowInMiddle extends AbstractReindeerTestUI {
  8. @Override
  9. protected void setup(VaadinRequest request) {
  10. final GridLayout layout = new GridLayout(1, 2);
  11. layout.addComponent(new Label("some row"), 0, 0);
  12. Button newRowButton = new Button("Insert Row");
  13. newRowButton.addClickListener(event -> {
  14. layout.insertRow(1);
  15. layout.addComponent(new Label("some new row"), 0, 1);
  16. });
  17. layout.addComponent(newRowButton, 0, 1);
  18. addComponent(layout);
  19. }
  20. @Override
  21. protected String getTestDescription() {
  22. return "A new row added to the middle of a GridLayout should appear without any exception being thrown.";
  23. }
  24. @Override
  25. protected Integer getTicketNumber() {
  26. return Integer.valueOf(10097);
  27. }
  28. }