com.esri.arcgis.editor
Interface IEditTask

All Superinterfaces:
Serializable
All Known Implementing Classes:
IEditTaskProxy

public interface IEditTask
extends Serializable

Provides access to a task that receives notification when the sketch is complete.

Remarks

You can find and set an edit task either by using the Name property in conjunction with IEdtior::TaskCount and IEditor::Task or by IEditTaskSearch

When To Use

The purpose of the IEditTask interface is to take a geometry (the edit sketch) from IEditSketch::Geometry and perform some action with it. Each edit task performs a different operation with this geometry. For example, the CreateNewFeature edit task takes the edit sketch and stores it as a new feature. The Reshape Feature edit task uses the edit sketch to reshape a selected feature. The editor can only have one active edit task at a time, use IEditor::CurrentTask to set this.
All edit tasks implement the IEditTask interface. Edit tasks must be registered in the ESRI Edit Tasks component category to appear in the Edit Task dropdown menu on the Editor toolbar.

Product Availability

Available with ArcGIS Desktop.

See Also:
IEditAttributeProperties, IEditSketch

Method Summary
 void activate(IEditor editor, IEditTask oldTask)
          Called by the editor when the task becomes active.
 void deactivate()
          Called by the editor when the task becomes inactive.
 String getName()
          The name of the edit task.
 void onDeleteSketch()
          Notifies the task that the edit sketch has been deleted.
 void onFinishSketch()
          Notifies the task that the edit sketch is complete.
 

Method Detail

getName

String getName()
               throws IOException,
                      AutomationException
The name of the edit task.

Remarks

The Name property is usually used with IEdtior::TaskCount and IEditor::Task to change the editor's current task. It is not a good idea to set an edit task via its index as this may change and is likely different for different users.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IExtension, IEditTask, ISketchTool, esriSketchConstraint, IEditSketch

activate

void activate(IEditor editor,
              IEditTask oldTask)
              throws IOException,
                     AutomationException
Called by the editor when the task becomes active.

Remarks

Activate is called each time the editor's current task is changed. This gives you the ability initialize variables, namely set a reference to the passed in Editor object, and modify the editing environment before work starts with an edit task. For example, you may want the edit sketch to be of type Polyline regardless of what the current layer geometry type is. By default the edit sketch has a geometry type equal to that of the current layer, override this by changing the editor's geometry type in Activate.
 


Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
editor - A reference to a com.esri.arcgis.editor.IEditor (in)
oldTask - A reference to a com.esri.arcgis.editor.IEditTask (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IExtension, IEditAttributeProperties, IEditSketch

deactivate

void deactivate()
                throws IOException,
                       AutomationException
Called by the editor when the task becomes inactive.

Remarks

Deactivate is the last method called when a edit task completes, use it to perform code clean-up.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IExtension, IEditTask, IEditSketch

onFinishSketch

void onFinishSketch()
                    throws IOException,
                           AutomationException
Notifies the task that the edit sketch is complete.

Remarks

Control passes to OnFinishSketch after IEditSketch::FinishSketch is called. When implementing IEditTask to create your own edit task, the bulk of code is typically written here. This is where you should start an edit operation if necessary and store any created or modified features.
If you need to get a reference to IApplication use IEditor::Parent; a reference to the Editor object itself should be set in Activate.
 


Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IExtension, IEditTask, IEditSketch

onDeleteSketch

void onDeleteSketch()
                    throws IOException,
                           AutomationException
Notifies the task that the edit sketch has been deleted.

Remarks

OnDeleteSketch gives an edit task an opportunity to clean up any steps that were already completed. For example, if you had added any SketchOperation to the operation stack you may want to remove them.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IExtension, IEditTask, IEditSketch