Class SessionEditorUndoableEdit

java.lang.Object
javax.swing.undo.AbstractUndoableEdit
ca.phon.app.session.editor.undo.SessionEditorUndoableEdit
All Implemented Interfaces:
IExtendable, Serializable, UndoableEdit
Direct Known Subclasses:
AddGroupEdit, AddParticipantEdit, AddRecordEdit, AddTierEdit, ChangeSpeakerEdit, ConvertFlatTierEdit, DeleteRecordEdit, MediaLocationEdit, MergeAllGroupsEdit, MergeGroupEdit, ParticipantUndoableEdit, RecordExcludeEdit, RecordMoveEdit, RemoveGroupEdit, RemoveParticipantEdit, RemoveTierEdit, ScTypeEdit, SessionDateEdit, SessionLanguageEdit, SplitGroupEdit, SyllabifyEdit, TierEdit, TierNameEdit, TierViewEdit, TierViewItemEdit, ToggleDiphthongEdit

public abstract class SessionEditorUndoableEdit extends AbstractUndoableEdit implements IExtendable
Base class for SessionEditor changes. All changes to the Session should go through the UndoManager.
See Also:
  • Constructor Details

    • SessionEditorUndoableEdit

      public SessionEditorUndoableEdit(SessionEditor editor)
      Constructor
      Parameters:
      editor -
  • Method Details

    • getEditor

      public SessionEditor getEditor()
    • getSource

      public Component getSource()
      Get the source for the edit. This value is given to the resulting EditorEvents. During undo/redo operations, the source is always the value of getEditor().getUndoSupport().
      Returns:
      the source
    • setSource

      public void setSource(Component source)
      Set the source for the edit. This is the source passed to the initial execution of the edit. Undo/redo operations always use the editor's undo support as the source.
      Parameters:
      source -
    • redo

      public void redo()
      Specified by:
      redo in interface UndoableEdit
      Overrides:
      redo in class AbstractUndoableEdit
    • undo

      public void undo()
      Specified by:
      undo in interface UndoableEdit
      Overrides:
      undo in class AbstractUndoableEdit
    • doIt

      public abstract void doIt()
      'Do' the specified action. The method is called by the EditorUnsoSupport when new edits are posted.
    • canRedo

      public boolean canRedo()
      Specified by:
      canRedo in interface UndoableEdit
      Overrides:
      canRedo in class AbstractUndoableEdit
    • canUndo

      public boolean canUndo()
      Specified by:
      canUndo in interface UndoableEdit
      Overrides:
      canUndo in class AbstractUndoableEdit
    • isSignificant

      public boolean isSignificant()
      Specified by:
      isSignificant in interface UndoableEdit
      Overrides:
      isSignificant in class AbstractUndoableEdit
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove