com.developpez.ydisanto.swing.undo
Class UndoMapping

java.lang.Object
  extended by com.developpez.ydisanto.swing.undo.UndoMapping
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.UndoableEditListener

public final class UndoMapping
extends java.lang.Object
implements javax.swing.event.UndoableEditListener

See Also:
UndoableJTextManager

Constructor Summary
UndoMapping(javax.swing.text.JTextComponent component)
          Constructs a new UndoMapping with the specified JTextComponent.
 
Method Summary
 void addUndoListener(UndoListener listener)
          Registers UndoListener so that it will receive ActionEvents when "undo" or "redo" Action are performed.
 javax.swing.text.JTextComponent getComponent()
          Returns the JTextComponent.
 javax.swing.Action getRedoAction()
          Returns the redo Action af the UndoMapping.
 javax.swing.Action getUndoAction()
          Returns the undo Action af the UndoMapping.
 javax.swing.undo.UndoManager getUndoManager()
          Returns the UndoManager af the UndoMapping.
 void removeUndoListener(UndoListener listener)
          Unregisters UndoListener so that it will no longer receive ActionEvents.
 void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
          An undoable edit happened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoMapping

public UndoMapping(javax.swing.text.JTextComponent component)
Constructs a new UndoMapping with the specified JTextComponent.

Parameters:
component - a JTextComponent.
Method Detail

addUndoListener

public void addUndoListener(UndoListener listener)
Registers UndoListener so that it will receive ActionEvents when "undo" or "redo" Action are performed.

Parameters:
listener - a UndoListener.

getComponent

public javax.swing.text.JTextComponent getComponent()
Returns the JTextComponent.

Returns:
the JTextComponent.

getRedoAction

public javax.swing.Action getRedoAction()
Returns the redo Action af the UndoMapping.

Returns:
the redo Action af the UndoMapping.

getUndoAction

public javax.swing.Action getUndoAction()
Returns the undo Action af the UndoMapping.

Returns:
the undo Action af the UndoMapping.

getUndoManager

public javax.swing.undo.UndoManager getUndoManager()
Returns the UndoManager af the UndoMapping.

Returns:
the UndoManager af the UndoMapping.

removeUndoListener

public void removeUndoListener(UndoListener listener)
Unregisters UndoListener so that it will no longer receive ActionEvents.

Parameters:
listener - a UndoListener.

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
An undoable edit happened

Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener