org.springframework.roo.file.undo
Class DefaultUndoManager

java.lang.Object
  extended by org.springframework.roo.file.undo.DefaultUndoManager
All Implemented Interfaces:
UndoManager

@Service
public class DefaultUndoManager
extends Object
implements UndoManager

Default implementation of the UndoManager interface.

Since:
1.0
Author:
Ben Alex

Constructor Summary
DefaultUndoManager()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext context)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUndoManager

public DefaultUndoManager()
Method Detail

activate

protected void activate(org.osgi.service.component.ComponentContext context)

add

public void add(UndoableOperation undoableOperation)
Description copied from interface: UndoManager
Registers an undoable operation in the Stack.

Specified by:
add in interface UndoManager
Parameters:
undoableOperation - to register in a Stack (required)

reset

public void reset()
Description copied from interface: UndoManager
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.

Specified by:
reset in interface UndoManager

undo

public boolean undo()
Description copied from interface: UndoManager
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.

Specified by:
undo in interface UndoManager
Returns:
true if all UndoableOperations in the Stack were successfully undone


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