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 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui.dd;
  5. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  6. import com.vaadin.terminal.gwt.client.Paintable;
  7. /**
  8. * Vaadin Widgets (TODO or Paintables, see {@link VHasDropHandler}) that want to
  9. * receive something via drag and drop implement this interface.
  10. */
  11. public interface VDropHandler {
  12. /**
  13. * Called by DragAndDropManager when a drag operation is in progress and the
  14. * cursor enters the area occupied by this Paintable.
  15. *
  16. * @param dragEvent
  17. * DragEvent which contains the transferable and other
  18. * information for the operation
  19. */
  20. public void dragEnter(VDragEvent dragEvent);
  21. /**
  22. * Called by DragAndDropManager when a drag operation is in progress and the
  23. * cursor leaves the area occupied by this Paintable.
  24. *
  25. * @param dragEvent
  26. * DragEvent which contains the transferable and other
  27. * information for the operation
  28. */
  29. public void dragLeave(VDragEvent dragEvent);
  30. /**
  31. * Called by DragAndDropManager when a drag operation was in progress and a
  32. * drop was performed on this Paintable.
  33. *
  34. *
  35. * @param dragEvent
  36. * DragEvent which contains the transferable and other
  37. * information for the operation
  38. *
  39. * @return true if the Tranferrable of this drag event needs to be sent to
  40. * the server, false if drop is rejected or no server side event
  41. * should be sent
  42. */
  43. public boolean drop(VDragEvent drag);
  44. /**
  45. * When drag is over current drag handler.
  46. *
  47. * With drag implementation by {@link VDragAndDropManager} will be called
  48. * when mouse is moved. HTML5 implementations call this continuously even
  49. * though mouse is not moved.
  50. *
  51. * @param currentDrag
  52. */
  53. public void dragOver(VDragEvent currentDrag);
  54. /**
  55. * Returns the Paintable into which this DragHandler is associated
  56. */
  57. public Paintable getPaintable();
  58. /**
  59. * Returns the application connection to which this {@link VDropHandler}
  60. * belongs to. DragAndDropManager uses this fucction to send Transferable to
  61. * server side.
  62. */
  63. public ApplicationConnection getApplicationConnection();
  64. }