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.

CenteredWindowWithUndefinedSize.java 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Label;
  4. import com.vaadin.ui.VerticalLayout;
  5. import com.vaadin.ui.Window;
  6. public class CenteredWindowWithUndefinedSize extends TestBase {
  7. @Override
  8. protected String getDescription() {
  9. return "The centered sub-window with undefined height and a undefined high layout should be rendered in the center of the screen and not in the top-left corner.";
  10. }
  11. @Override
  12. protected Integer getTicketNumber() {
  13. return 2702;
  14. }
  15. @Override
  16. protected void setup() {
  17. VerticalLayout layout = new VerticalLayout();
  18. layout.setMargin(true);
  19. Window centered = new Window("A window", layout);
  20. centered.setSizeUndefined();
  21. layout.setSizeUndefined();
  22. centered.center();
  23. Label l = new Label("This window should be centered");
  24. l.setSizeUndefined();
  25. layout.addComponent(l);
  26. getMainWindow().addWindow(centered);
  27. }
  28. }