Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DragAndDropEvent.java 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.event.dd;
  5. import java.io.Serializable;
  6. import com.vaadin.event.Transferable;
  7. import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
  8. /**
  9. * DragAndDropEvent wraps information related to drag and drop operation. It is
  10. * passed by terminal implementation for
  11. * {@link DropHandler#drop(DragAndDropEvent)} and
  12. * {@link AcceptCriterion#accept(DragAndDropEvent)} methods.
  13. * <p>
  14. * DragAndDropEvent instances contains both the dragged data in
  15. * {@link Transferable} (generated by {@link DragSource} and details about the
  16. * current drop event in {@link DropTargetDetails} (generated by
  17. * {@link DropTarget}.
  18. *
  19. * @since 6.3
  20. *
  21. */
  22. public class DragAndDropEvent implements Serializable {
  23. private Transferable transferable;
  24. private DropTargetDetails dropTargetDetails;
  25. public DragAndDropEvent(Transferable transferable,
  26. DropTargetDetails dropTargetDetails) {
  27. this.transferable = transferable;
  28. this.dropTargetDetails = dropTargetDetails;
  29. }
  30. /**
  31. * @return the Transferable instance representing the data dragged in this
  32. * drag and drop event
  33. */
  34. public Transferable getTransferable() {
  35. return transferable;
  36. }
  37. /**
  38. * @return the DropTargetDetails containing drop target related details of
  39. * drag and drop operation
  40. */
  41. public DropTargetDetails getDropTargetDetails() {
  42. return dropTargetDetails;
  43. }
  44. }