com.im.df.api 5.9

com.im.df.api.support
Interface DFUndoManager


public interface DFUndoManager

The undo manager for a single undo/redo queue.

If you want to create a single undo/redo edit for multiple edit operations you can use "complex operations", like:

       DFEntityDataProvider edp=...;
       DFUndoManager undoManager = edp.getSchemaDataProvider().getUndoManager();
       try {
           undoManager.startComplexUndo("Display name of undo", edp.getLockable(), env.getLock());
           Map results = edp.update(..., true, env);
           DFUpdateResult res = results.get(updateDesc);
           if (res.getException() != null) {
               throw res.getException();
           }
       } finally {
           undoManager.stopComplexUndo(edp.getLockable());
       }
 


Method Summary
 void addChangeListener(ChangeListener listener)
           
 boolean canRedo()
          True if it is still possible to redo this operation.
 boolean canUndo()
          True if it is still possible to undo this operation.
 void discardAllEdits()
          Empty the undo manager, sending each edit a die message in the process.
 int getMaxRowCount()
           
 int getMaxUndoQueueLength()
           
 String getRedoPresentationName()
          Provides a localized, human readable description of the redoable form of this edit, e.g.
 String getUndoPresentationName()
          Provides a localized, human readable description of the undoable form of this edit, e.g.
 boolean isEnabled()
          Is this undo/redo manager currently disabled or enabled?
 void redo(DFEnvironmentRO env)
          Re-apply the edit, assuming that it has been undone.
 void removeChangeListener(ChangeListener listener)
           
 void setEnabled(boolean enabled)
          Enable or disable whole undo manager.
 void startComplexUndo(String presentationName, DFLockable lockable, DFLock lock)
          Start the complex operation like copy/paste multiple cells or delete more rows together.
 void stopComplexUndo(DFLockable lockable)
          Notifies UndoManager that the complex undoable edit identified by this lockable is finished and can be closed.
 void undo(DFEnvironmentRO env)
          Undo the edit that was made.
 

Method Detail

undo

void undo(DFEnvironmentRO env)
          throws DFUndoRedoException
Undo the edit that was made.

Throws:
DFUndoRedoException

canUndo

boolean canUndo()
True if it is still possible to undo this operation.


redo

void redo(DFEnvironmentRO env)
          throws DFUndoRedoException
Re-apply the edit, assuming that it has been undone.

Throws:
DFUndoRedoException

canRedo

boolean canRedo()
True if it is still possible to redo this operation.


getUndoPresentationName

String getUndoPresentationName()
Provides a localized, human readable description of the undoable form of this edit, e.g. for use as an Undo menu item. Typically derived from getDescription.


discardAllEdits

void discardAllEdits()
Empty the undo manager, sending each edit a die message in the process.


setEnabled

void setEnabled(boolean enabled)
Enable or disable whole undo manager. If manager is disabled whole queue is deleted and manager does not accept any new changes.


isEnabled

boolean isEnabled()
Is this undo/redo manager currently disabled or enabled?


startComplexUndo

void startComplexUndo(String presentationName,
                      DFLockable lockable,
                      DFLock lock)
Start the complex operation like copy/paste multiple cells or delete more rows together. Complex undo action is action which is undoable together despite it's multiple DIF DML edit calls. You should always finish such a complex operation with stopComplexUndo(DFLockable) call.

Parameters:
presentationName - The presentation name of the coplex undo operation
lockable - The complex undoable operation is identified by lockable. It means all edits which happens under this lockable until it's closed will become part of this complex undo edit.
lock - The lock for lockable
Throws:
IllegalStateException - if lock is not valid and is not lock of lockable param.

stopComplexUndo

void stopComplexUndo(DFLockable lockable)
Notifies UndoManager that the complex undoable edit identified by this lockable is finished and can be closed.

Parameters:
lockable - The lockable which identifies the complex undo operation

getRedoPresentationName

String getRedoPresentationName()
Provides a localized, human readable description of the redoable form of this edit, e.g. for use as a Redo menu item. Typically derived from getPresentationName.


addChangeListener

void addChangeListener(ChangeListener listener)

removeChangeListener

void removeChangeListener(ChangeListener listener)

getMaxRowCount

int getMaxRowCount()

getMaxUndoQueueLength

int getMaxUndoQueueLength()

com.im.df.api 5.9