org.jtheque.core.managers.undo
Class UndoRedoManager

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by javax.swing.undo.CompoundEdit
          extended by javax.swing.undo.UndoManager
              extended by org.jtheque.core.managers.undo.UndoRedoManager
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.undo.UndoableEdit, ActivableManager, IManager, IUndoRedoManager

public final class UndoRedoManager
extends javax.swing.undo.UndoManager
implements IUndoRedoManager

An undo-redo manager implementation.

Author:
Baptiste Wicht
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.CompoundEdit
edits
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
UndoRedoManager()
           
 
Method Summary
 boolean addEdit(javax.swing.undo.UndoableEdit arg0)
          Add an undoable edit.
 void close()
          Close the manager.
 void init()
          Init the manager.
 boolean isEnabled()
          Indicate if the manager is enabled or not.
 void preInit()
          Pre-init the manager.
 void redo()
          Redo the last undoed action.
 void setEnabled(boolean enabled)
          Enable or disable the manager.
 void undo()
          Undo the last action.
 
Methods inherited from class javax.swing.undo.UndoManager
canRedo, canUndo, canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoOrRedo, undoTo
 
Methods inherited from class javax.swing.undo.CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEdit
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UndoRedoManager

public UndoRedoManager()
Method Detail

preInit

public void preInit()
Description copied from interface: IManager
Pre-init the manager. This operation is called before modules preplug.

Specified by:
preInit in interface IManager

close

public void close()
           throws ManagerException
Description copied from interface: IManager
Close the manager.

Specified by:
close in interface IManager
Throws:
ManagerException - If an error occurs during the close process.

init

public void init()
          throws ManagerException
Description copied from interface: IManager
Init the manager. This operation is called after modules preplug but before module plug.

Specified by:
init in interface IManager
Throws:
ManagerException - If an error occurs during the init process.

isEnabled

public boolean isEnabled()
Description copied from interface: ActivableManager
Indicate if the manager is enabled or not.

Specified by:
isEnabled in interface ActivableManager
Returns:
true if the manager is enabled else false.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: ActivableManager
Enable or disable the manager.

Specified by:
setEnabled in interface ActivableManager
Parameters:
enabled - true if we want enable the manager else false.

addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit arg0)
Description copied from interface: IUndoRedoManager
Add an undoable edit.

Specified by:
addEdit in interface javax.swing.undo.UndoableEdit
Specified by:
addEdit in interface IUndoRedoManager
Overrides:
addEdit in class javax.swing.undo.UndoManager
Parameters:
arg0 - The edit to add.
Returns:
true if the action has been added else false.

undo

public void undo()
Description copied from interface: IUndoRedoManager
Undo the last action.

Specified by:
undo in interface javax.swing.undo.UndoableEdit
Specified by:
undo in interface IUndoRedoManager
Overrides:
undo in class javax.swing.undo.UndoManager

redo

public void redo()
Description copied from interface: IUndoRedoManager
Redo the last undoed action.

Specified by:
redo in interface javax.swing.undo.UndoableEdit
Specified by:
redo in interface IUndoRedoManager
Overrides:
redo in class javax.swing.undo.UndoManager


Copyright © 2009 JTheque. All Rights Reserved.