Package ptolemy.kernel.undo
Class UndoChangeRequest
- java.lang.Object
-
- ptolemy.kernel.util.ChangeRequest
-
- ptolemy.kernel.undo.UndoChangeRequest
-
public class UndoChangeRequest extends ChangeRequest
A change request to undo. When executed, this change request will identify the undo stack associated with the specified context, and it will execute the top undo action on that stack, if there is one.- Since:
- Ptolemy II 3.1
- Version:
- $Id$
- Author:
- Edward A. Lee and Neil Smyth
- Pt.AcceptedRating:
- Green (hyzheng)
- Pt.ProposedRating:
- Green (eal)
-
-
Constructor Summary
Constructors Constructor Description UndoChangeRequest(java.lang.Object originator, NamedObj context)
Construct a change request to be executed in the specified context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_execute()
Execute the change by invoking undo on the undo stack of the context specified in the constructor.NamedObj
getContext()
Return the context specified in the constructor, or null if none was specified.-
Methods inherited from class ptolemy.kernel.util.ChangeRequest
addChangeListener, execute, getDescription, getLocality, getSource, isErrorReported, isPersistent, isStructuralChange, removeChangeListener, setDescription, setErrorReported, setListeners, setPersistent, waitForCompletion
-
-
-
-
Constructor Detail
-
UndoChangeRequest
public UndoChangeRequest(java.lang.Object originator, NamedObj context)
Construct a change request to be executed in the specified context. The undo stack associated with the specified context will be used. That stack is the one returned by UndoStackAttribute.getUndoInfo().- Parameters:
originator
- The originator of the change request.context
- The context in which to execute the MoML.- See Also:
UndoStackAttribute
-
-
Method Detail
-
getContext
public NamedObj getContext()
Return the context specified in the constructor, or null if none was specified.- Returns:
- The context.
-
_execute
protected void _execute() throws java.lang.Exception
Execute the change by invoking undo on the undo stack of the context specified in the constructor.- Specified by:
_execute
in classChangeRequest
- Throws:
java.lang.Exception
- If an exception is thrown while evaluating the request.
-
-