com.esri.arcgis.systemUI
Interface IOperation

All Superinterfaces:
Serializable
All Known Subinterfaces:
IEditOperation, IElementEditVerticesOperation, IElementOperation, IEngineSketchOperation, IReferenceScaleOperation, IRotateOperation, ISchematicOperation, ISketchOperation
All Known Implementing Classes:
AddLayersOperation, ElementEditVerticesOperation, ElementNewOperation, EngineSketchOperation, GroupLayersOperation, IEditOperationProxy, IElementEditVerticesOperationProxy, IElementOperationProxy, IOperationProxy, IReferenceScaleOperationProxy, ISchematicOperationProxy, MoveLayersOperation, MoveMapsOperation, ReferenceScaleOperation, RemoveLayerOperation, RemoveLayersOperation, RotateOperation, SchematicOperation, SelectFeaturesOperation, SketchOperation, UngroupLayerOperation

public interface IOperation
extends Serializable

Provides access to members that control Operations.

Description

IOperation is a interface that supports creating custom undo and redo operations in either ArcMap, ArcCatalog or standalone applications. An operation is an action, or group of actions, that may be undone or redone.

By creating a class that implements IOperation, you can use the Do method to execute some action, and then the Undo method to reset the action from the Do method. The Redo method follows this paradigm to support any specialized actions needed for managing the re-application of the Do method.

By implementing your actions within the IOperation interface, you will automatically add them to the application's OperationStack.

Remarks

Verify the other classes that already implement IOperation, to avoid rewriting functions that already exist.

Product Availability

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

See Also:
IOperationStack

Method Summary
 void esri_do()
          Performs the operation.
 String getMenuString()
          The menu string.
 boolean isCanRedo()
          Indicates if the operation can be redone.
 boolean isCanUndo()
          Indicates if the operation can be undone.
 void redo()
          Redoes the operation.
 void undo()
          Undoes the operation.
 

Method Detail

getMenuString

String getMenuString()
                     throws IOException,
                            AutomationException
The menu string.

Description

The MenuString associated with the Operation. This is used by the application framework to populate the Edit menu in ArcMap. For example, adding a layer to ArcMap adds the menu string of the Operation "Undo Add Layers(s)" to the Edit menu.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isCanUndo

boolean isCanUndo()
                  throws IOException,
                         AutomationException
Indicates if the operation can be undone.

Description

CanUndo indicates if the operation can be un-done. Use the property before using the Undo method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

isCanRedo

boolean isCanRedo()
                  throws IOException,
                         AutomationException
Indicates if the operation can be redone.

Description

CanRedo indicates if the operation can be re-done. Use the property before using the Redo method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

esri_do

void esri_do()
             throws IOException,
                    AutomationException
Performs the operation.

Product Availability

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

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

undo

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

Description

Undo the operation to reset the action from the Do method. Use the CanUndo property to determine whether the operation can be un-done.

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 operation.

Description

Redo the operation to redo the action from the Do method. Use the CanRedo property to determine whether the operation can be re-done.

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.