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.

SubwindowDraggability.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Button;
  4. import com.vaadin.ui.Window;
  5. public class SubwindowDraggability extends TestBase {
  6. @Override
  7. protected void setup() {
  8. final Window draggableSubWindow = new Window("Draggable sub window");
  9. draggableSubWindow.setHeight("300px");
  10. final Window fixedSubWindow = new Window("Fixed sub window");
  11. fixedSubWindow.setHeight("200px");
  12. fixedSubWindow.setDraggable(false);
  13. fixedSubWindow.center();
  14. getMainWindow().addWindow(draggableSubWindow);
  15. getMainWindow().addWindow(fixedSubWindow);
  16. Button button = new Button("Swap", event -> {
  17. boolean draggable = draggableSubWindow.isDraggable();
  18. draggableSubWindow.setDraggable(!draggable);
  19. fixedSubWindow.setDraggable(draggable);
  20. });
  21. addComponent(button);
  22. }
  23. @Override
  24. protected String getDescription() {
  25. return "Two sub windows. One is draggable, the other one is fixed and cannot be moved by the user";
  26. }
  27. @Override
  28. protected Integer getTicketNumber() {
  29. return 3133;
  30. }
  31. }