org.springframework.roo.file.undo
Interface UndoManager

All Known Implementing Classes:
DefaultUndoManager

public interface UndoManager

Provides the ability to undo changes to a file system.

Note that the complexities of file system I/O are significant and Java does not provide full access to a file lock API that would simplify coding of implementations. Therefore undoing changes to the file system is a best-effort basis only, and designs should not rely on robust, guaranteed, fail-safe undo semantics.

Since:
1.0
Author:
Ben Alex

Method Summary
 void add(UndoableOperation undoableOperation)
          Registers an undoable operation in the Stack.
 void reset()
          Resets the undo Stack, and guarantees to clear the Stack.
 boolean undo()
          Replays the undo Stack, and guarantees to clear the Stack.
 

Method Detail

add

void add(UndoableOperation undoableOperation)
Registers an undoable operation in the Stack.

Parameters:
undoableOperation - to register in a Stack (required)

undo

boolean undo()
Replays the undo Stack, and guarantees to clear the Stack.

The first operation that returns false to UndoableOperation.undo() will cause the remainder of the Stack to stop undoing.

Executing this command guarantees the Stack will be empty upon return, with every element either undone or reset.

Returns:
true if all UndoableOperations in the Stack were successfully undone

reset

void reset()
Resets the undo Stack, and guarantees to clear the Stack.

Executing this command guarantees the Stack will be empty upon return, with every element reset.



Copyright © 2009-2010 VMware, Inc. All Rights Reserved.