Class ClsActionEvent

java.lang.Object
org.jjazz.chordleadsheet.api.event.ClsChangeEvent
org.jjazz.chordleadsheet.api.event.ClsActionEvent

public class ClsActionEvent extends ClsChangeEvent
An event to indicate that a high-level ChordLeadSheet action that changes the leadsheet has started or is complete.

All other ClsChangeEvents are always preceded and followed by one ClsActionEvent. This can be used by listener to group lower-level change events by actionId. The actionId must be the corresponding method name from the ChordLeadSheet interface, e.g. "addItem".

There is the guarantee that if a start ClsActionEvent is received, the complete ClsActionEvent will be received on the same actionId. It's possible that no lower-level change event occur between 2 started/complete action events on the same actionId.

  • Constructor Details

    • ClsActionEvent

      public ClsActionEvent(ChordLeadSheet src, String actionId, boolean startedOrComplete, boolean undo, Object data)
      Parameters:
      src -
      actionId - The corresponding method name from the ChordLeadSheet interface which performs the change, e.g. "addItem".
      startedOrComplete - False means action has started, true action is complete
      undo - If true this action is part of
      data - An optional data associated to the event
  • Method Details

    • getData

      public Object getData()
      An optional data associated to the event.

      Check the source code to know which object is associated to which actionId.

      Returns:
      Can be null
    • isActionStarted

      public boolean isActionStarted()
    • isActionComplete

      public boolean isActionComplete()
    • getActionId

      public String getActionId()
    • isUndo

      public boolean isUndo()
    • toString

      public String toString()
      Overrides:
      toString in class Object