Class ClsActionEvent

java.lang.Object
org.jjazz.chordleadsheet.api.event.ClsChangeEvent
org.jjazz.chordleadsheet.api.event.ClsActionEvent
Direct Known Subclasses:
SongMetaEvents.ClsSourceActionEvent

public class ClsActionEvent extends ClsChangeEvent
A special event to indicate that a high-level action, i.e. a call to a public API method that mutates the chord leadsheet, has started or is complete.

All low-level ClsChangeEvents fired by a ChordLeadSheet are always preceded and followed by start and complete ClsActionEvents. The complete ClsActionEvent contains the low-level ClsChangeEvents.

See Also:
  • Constructor Details

    • ClsActionEvent

      public ClsActionEvent(ChordLeadSheet src, ClsActionEvent.API_ID apiId, Object data)
      Create a ClsActionEvent in started state, with no subEvents.
      Parameters:
      src -
      apiId -
      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
    • isComplete

      public boolean isComplete()
      Check if complete() was called.
      Returns:
      See Also:
    • complete

      public void complete()
      Mark this ClsActionEvent as complete.
      See Also:
    • addSubEvent

      public void addSubEvent(ClsChangeEvent e)
      Add a ClsChangeEvent to this ClsActionEvent.
      Parameters:
      e - Can not be a ClsActionEvent
    • getSubEvents

      public List<ClsChangeEvent> getSubEvents()
      The lower-level ClsChangeEvents added to this instance.
      Returns:
      An unmodifiable list. Can be empty.
    • getApiId

      public ClsActionEvent.API_ID getApiId()
    • toString

      public String toString()
      Overrides:
      toString in class Object