com.esri.arcgis.systemUI
Interface IOperationStack

All Superinterfaces:
Serializable
All Known Implementing Classes:
ControlsOperationStack

public interface IOperationStack
extends Serializable

Provides access to members that control the Operation Stack.

Description

An application can implement an OperationStack to provide undo and redo facilities. As you carry out operations, they are added to the stack, then you can use undo and redo in the application to manipulate the stack to undo or redo the operations.

Remarks

ArcMap has an OperationStack, which can be obtained with the IMxDocument::OperationStack property. ArcMap’s buttons and tools wrap their actions in an operation and add the operations to the stack.

Depending on your scenario, there are different methodologies for creating an operation and adding it to the OperationStack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void esri_do(IOperation operation)
          Performs the given operation and places it on the stack.
 int getCount()
          The number of operations on the stack.
 IOperation getItem(int index)
          The operation at the specified index.
 IOperation getRedoOperation()
          Redoes a specified operation.
 IOperation getUndoOperation()
          Undoes a specified operation.
 void redo()
          Redoes the next operation on the stack.
 void remove(int index)
          Removes an operation from the stack.
 void reset()
          Removes all operations from the stack.
 void undo()
          Undoes the previous operation on the stack.
 

Method Detail

getCount

int getCount()
             throws IOException,
                    AutomationException
The number of operations on the stack.

Description

Returns the number of operations on the OperationStack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

IOperation getItem(int index)
                   throws IOException,
                          AutomationException
The operation at the specified index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.systemUI.IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

void reset()
           throws IOException,
                  AutomationException
Removes all operations from the stack.

Description

This method removes all operations from the OperationStack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_do

void esri_do(IOperation operation)
             throws IOException,
                    AutomationException
Performs the given operation and places it on the stack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
operation - A reference to a com.esri.arcgis.systemUI.IOperation (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

undo

void undo()
          throws IOException,
                 AutomationException
Undoes the previous operation on the stack.

Description

The Undo method performs the undo of the 'current' operation on the OperationStack and moves the 'current' operation pointer back one operation on the OperationStack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

redo

void redo()
          throws IOException,
                 AutomationException
Redoes the next operation on the stack.

Description

The Redo method performs the redo of the 'next' operation on the OperationStack and moves the 'current' operation pointer forward one operation on the OperationStack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUndoOperation

IOperation getUndoOperation()
                            throws IOException,
                                   AutomationException
Undoes a specified operation.

Description

Returns the 'current' operation on the OperationStack, without executing an undo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.systemUI.IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRedoOperation

IOperation getRedoOperation()
                            throws IOException,
                                   AutomationException
Redoes a specified operation.

Description

Returns the 'next' operation on the OperationStack, without executing an redo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.systemUI.IOperation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remove

void remove(int index)
            throws IOException,
                   AutomationException
Removes an operation from the stack.

Description

Removes the operation at the specified index from the OperationStack. The operation at the beginning of the collection has an index of 0 and the operation at the end of the collection has an index of IOperationStack::Count - 1.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.