Class DropEvent


public class DropEvent extends ClientEvent<DragDropListener>
Event fired when a dragged element is dropped onto a valid drop target.

This event provides information about the dropped element, its original parent, the new parent it was dropped into, and the updated child ordering of both containers.

  • Constructor Details

    • DropEvent

      public DropEvent()
      Creates a new DropEvent.
  • Method Details

    • setDroppedElement

      public void setDroppedElement(Element droppedElement)
      Sets the element that was dropped.
      Parameters:
      droppedElement - the dropped element
    • setOldParent

      public void setOldParent(Element oldParent)
      Sets the original parent of the dropped element.
      Parameters:
      oldParent - the original parent element
    • setNewParent

      public void setNewParent(Element newParent)
      Sets the new parent where the element was dropped.
      Parameters:
      newParent - the new parent element
    • setOldParentChildIds

      public void setOldParentChildIds(ArrayList<String> oldParentChildIds)
      Sets the child IDs of the original parent after the drop.
      Parameters:
      oldParentChildIds - the list of child element IDs in the original parent
    • setNewParentChildIds

      public void setNewParentChildIds(ArrayList<String> newParentChildIds)
      Sets the child IDs of the new parent after the drop.
      Parameters:
      newParentChildIds - the list of child element IDs in the new parent
    • getDroppedElement

      public Element getDroppedElement()
      Returns the element that was dropped.
      Returns:
      the dropped element
    • getOldParent

      public Element getOldParent()
      Returns the original parent of the dropped element.
      Returns:
      the original parent element
    • getNewParent

      public Element getNewParent()
      Returns the new parent where the element was dropped.
      Returns:
      the new parent element
    • getOldParentChildIds

      public ArrayList<String> getOldParentChildIds()
      Returns the child IDs of the original parent after the drop.
      Returns:
      the list of child element IDs in the original parent
    • getNewParentChildIds

      public ArrayList<String> getNewParentChildIds()
      Returns the child IDs of the new parent after the drop.
      Returns:
      the list of child element IDs in the new parent
    • dispatchTo

      public void dispatchTo(DragDropListener listener)
      Dispatches this event to the specified listener.

      Subclasses implement this method to call the appropriate handler method on the listener interface.

      Specified by:
      dispatchTo in class Event<DragDropListener>
      Parameters:
      listener - the listener to dispatch this event to