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.

WindowMoveListener.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.Button;
  5. import com.vaadin.ui.Window;
  6. @SuppressWarnings("serial")
  7. public class WindowMoveListener extends AbstractReindeerTestUI {
  8. /*
  9. * (non-Javadoc)
  10. *
  11. * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
  12. * VaadinRequest)
  13. */
  14. @Override
  15. protected void setup(VaadinRequest request) {
  16. Window w = new Window("Caption");
  17. w.setId("testwindow");
  18. w.setHeight("100px");
  19. w.setWidth("100px");
  20. w.setPositionX(100);
  21. w.setPositionY(100);
  22. addWindow(w);
  23. Button b = new Button();
  24. b.setId("testbutton");
  25. addComponent(b);
  26. b.addClickListener(event -> {
  27. for (Window window : getWindows()) {
  28. window.setPositionX(100);
  29. window.setPositionY(100);
  30. }
  31. });
  32. }
  33. /*
  34. * (non-Javadoc)
  35. *
  36. * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
  37. */
  38. @Override
  39. protected String getTestDescription() {
  40. return "Tests that windows send their updated position "
  41. + "to server-side after being moved by user";
  42. }
  43. /*
  44. * (non-Javadoc)
  45. *
  46. * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
  47. */
  48. @Override
  49. protected Integer getTicketNumber() {
  50. return 12885;
  51. }
  52. }