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.

VDropHandler.java 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2000-2016 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.client.ui.dd;
  17. import com.vaadin.client.ApplicationConnection;
  18. import com.vaadin.client.ComponentConnector;
  19. import com.vaadin.ui.dnd.DropTargetExtension;
  20. import com.vaadin.ui.dnd.event.DropListener;
  21. /**
  22. * Vaadin Widgets that want to receive something via drag and drop implement
  23. * this interface.
  24. *
  25. * @deprecated Replaced in 8.1 with {@link DropListener} and
  26. * {@link DropTargetExtension}
  27. */
  28. @Deprecated
  29. public interface VDropHandler {
  30. /**
  31. * Called by DragAndDropManager when a drag operation is in progress and the
  32. * cursor enters the area occupied by this Paintable.
  33. *
  34. * @param dragEvent
  35. * DragEvent which contains the transferable and other
  36. * information for the operation
  37. */
  38. public void dragEnter(VDragEvent dragEvent);
  39. /**
  40. * Called by DragAndDropManager when a drag operation is in progress and the
  41. * cursor leaves the area occupied by this Paintable.
  42. *
  43. * @param dragEvent
  44. * DragEvent which contains the transferable and other
  45. * information for the operation
  46. */
  47. public void dragLeave(VDragEvent dragEvent);
  48. /**
  49. * Called by DragAndDropManager when a drag operation was in progress and a
  50. * drop was performed on this Paintable.
  51. *
  52. *
  53. * @param drag
  54. * VDragEvent which contains the transferable and other
  55. * information for the operation
  56. *
  57. * @return true if the Tranferrable of this drag event needs to be sent to
  58. * the server, false if drop is rejected or no server side event
  59. * should be sent
  60. */
  61. public boolean drop(VDragEvent drag);
  62. /**
  63. * When drag is over current drag handler.
  64. *
  65. * With drag implementation by {@link VDragAndDropManager} will be called
  66. * when mouse is moved. HTML5 implementations call this continuously even
  67. * though mouse is not moved.
  68. *
  69. * @param currentDrag
  70. */
  71. public void dragOver(VDragEvent currentDrag);
  72. /**
  73. * Returns the ComponentConnector with which this DropHandler is associated.
  74. */
  75. public ComponentConnector getConnector();
  76. /**
  77. * Returns the application connection to which this {@link VDropHandler}
  78. * belongs to. DragAndDropManager uses this fucction to send Transferable to
  79. * server side.
  80. */
  81. public ApplicationConnection getApplicationConnection();
  82. }