Class PropMoveEvent

All Implemented Interfaces:
IPostEventProcessing

public class PropMoveEvent extends BubbleEvent
The event that indicates that a property container has been moved to another container.
Author:
Christopher Mindus
  • Constructor Details

    • PropMoveEvent

      public PropMoveEvent(int eventID, GProp<?> property, Atom oldAtom, PropCnr oldContainer, GProp<?>[] oldContainerProps)
      Constructs a new move event for a property that is moved and renamed at the same time. This event is typically used for drag-drop scenarios where the target accepts the moved items but there is a name-clash that is resolved by changing the name during the move operation from the old to the new container.
      Parameters:
      eventID - The event ID: PROP_MOVE_FROM or PROP_MOVED_TO.
      property - The property instance being changed or initialized.
      oldAtom - The old name of the property.
      oldContainer - The old container that used to house the property.
      oldContainerProps - The old container properties before the move.
  • Method Details

    • getOldAtom

      public Atom getOldAtom()
      Gets the old Atom, i.e. the old name of the property before the move.
      Returns:
      The old Atom.
    • getOldContainer

      public PropCnr getOldContainer()
      Gets the old property container.
      Returns:
      The old property container.
    • getOldContainerProps

      public GProp<?>[] getOldContainerProps()
      Gets the old container properties.
      Returns:
      An array of properties the old container contained before the move.
    • putAttachment

      public Object putAttachment(String id, Object attachment)
      Puts an attachment. This attachment is transported from the first move event to the second by the move operation, i.e. a class that processes both events can transport data to itself using this mechanism.
      Parameters:
      id - The ID of the attachment.
      attachment - The attachment object.
      Returns:
      A previous attachment for the id, or null for none.
    • getAttachment

      public Object getAttachment(String id)
      Gets an attachment. This attachment is transported from the first move event to the second by the move operation, i.e. a class that processes both events can transport data to itself using this mechanism.
      Parameters:
      id - The ID of the attachment.
      Returns:
      An attachment for the id, or null if not found.
    • removeAttachment

      public Object removeAttachment(String id)
      Removes an attachment. This attachment is transported from the first move event to the second by the move operation, i.e. a class that processes both events can transport data to itself using this mechanism.
      Parameters:
      id - The ID of the attachment.
      Returns:
      The removed attachment for the id, or null if not found.
    • getAttachments

      public Set<Map.Entry<String,Object>> getAttachments()
      Gets all attachments.
      Returns:
      The attachments set or null for never initialized.
    • addAttachments

      public void addAttachments(Set<Map.Entry<String,Object>> attachmentsSet)
      Adds a set of attachments.
      Parameters:
      attachmentsSet - The attachments to add, or null for none.
    • isClearCacheEvent

      public boolean isClearCacheEvent()
      Returns the state for a property container if this event is received in the onEventSelf method as a helper for it would need to clear the property container cache.
      Overrides:
      isClearCacheEvent in class GEvent
      Returns:
      true, always for this event.
    • isVerifyEvent

      public boolean isVerifyEvent()
      Returns if this event is a verify event for a container that processes verification.
      Overrides:
      isVerifyEvent in class GEvent
      Returns:
      true always.
    • paramString

      protected StringBuilder paramString(StringBuilder buf)
      Returns the parameter string representing the state of this event. This string is useful for debugging. Super classes adds extra information to the string by preceding it with a comma followed by the extra information.
      Overrides:
      paramString in class GEvent
      Parameters:
      buf - The StringBuilder to append the string to.
      Returns:
      The StringBuilder, i.e. the buf input parameter.