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.

WindowShadow.java 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.window;
  17. import com.vaadin.server.VaadinRequest;
  18. import com.vaadin.tests.components.AbstractTestUI;
  19. import com.vaadin.ui.UI;
  20. import com.vaadin.ui.Window;
  21. //Tests that invisible divs don't overlap windows and don't block mouse events
  22. public class WindowShadow extends AbstractTestUI {
  23. @Override
  24. protected void setup(VaadinRequest request) {
  25. Window wnd = createWindow();
  26. wnd.setId("topwindow");
  27. Window wnd2 = createWindow();
  28. wnd2.setId("botwindow");
  29. wnd.setPositionX(100);
  30. wnd.setPositionY(100);
  31. wnd2.setPositionX(100);
  32. // Pick ycoord, that the top div of the Window overlaps with its footer
  33. int yCoord = (int) (wnd.getPositionX() + wnd.getHeight() - 5);
  34. wnd2.setPositionY(yCoord);
  35. UI.getCurrent().addWindow(wnd);
  36. UI.getCurrent().addWindow(wnd2);
  37. }
  38. private Window createWindow() {
  39. Window wnd = new Window();
  40. wnd.setHeight("200");
  41. wnd.setWidth("200");
  42. return wnd;
  43. }
  44. @Override
  45. protected String getTestDescription() {
  46. return "Popup window has shadow div elemetns, which overlaps other elements and blocks mouse events";
  47. }
  48. @Override
  49. protected Integer getTicketNumber() {
  50. return 13885;
  51. }
  52. }