com.esri.arcgis.geoprocessing
Interface IGPTool

All Superinterfaces:
Serializable
All Known Implementing Classes:
IGPToolProxy

public interface IGPTool
extends Serializable

Provides access to methods on a geoprocessing tool object.

Remarks

There are three types of geoprocessing tools: a GPModelTool, a GPScriptTool, and a GPFunctionTool. Geoprocessing tools will take a set of inputs and generate one or more outputs. A generic GPTool object is obtained from a toolbox, as the code sample below shows.

When To Use

The GPTool object contains properties that provide access to a tool's name, its help file, and license status. The arguments to the tool are made up of an array of parameter (IGPParameter) or value (IGPValue) objects . The array of parameter objects is created by using the parameterInfo property.

The GPTool object also contains methods for validating the parameters and executing the tool.

Product Availability

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

Supported Platforms

Windows


Method Summary
 boolean canAlter()
          Returns whether or not the properties of the tool can be modified.
 boolean canEditSource()
          Returns whether or not the source (i.e., definition) of the tool can be modified.
 boolean editProperties(int hParent, IGPEnvironmentManager gPEnvMgr)
          Presents a modal dialog to edit the tool's properties.
 void execute(IArray paramvalues, ITrackCancel trackcancel, IGPEnvironmentManager pEnvMgr, IGPMessages messages)
          Executes the tool with the given set of values.
 String getDescription()
          The description of the tool.
 IUID getDialogCLSID()
          The class identifier of the custom dialog to use for this tool.
 String getDisplayName()
          The display name of the tool.
 int getHelpContext()
          The context identifier of the topic within the help file for this tool.
 String getHelpFile()
          Name of the (CHM) file containing help information for this tool.
 String getName()
          The name of the tool.
 IArray getParameterInfo()
          The set of parameters required to execute the tool.
 String getPathName()
          The path of the tool object.
 Object getRenderer(IGPParameter pParam)
          Returns the renderer associated with the specified parameter.
 IGPToolbox getToolbox()
          The toolbox of the tool.
 String getToolCategory()
          The tool category.
 int getToolType()
          The type of tool.
 boolean isDeleted()
          Indicates if the tool has been deleted.
 boolean isLicensed()
          Returns whether the tool is licensed to be executed.
 boolean isLicensedForProduct()
          Returns whether the tool is part of the current product.
 boolean isRelativePaths()
          Indicates if path names are stored relative to the tool/toolbox.
 boolean isValid()
          Returns whether the tool is capable of being executed/edited.
 void setDescription(String description)
          The description of the tool.
 void setDisplayName(String displayName)
          The display name of the tool.
 void setHelpContext(int context)
          The context identifier of the topic within the help file for this tool.
 void setHelpFile(String file)
          Name of the (CHM) file containing help information for this tool.
 void setName(String displayName)
          The name of the tool.
 void setRelativePaths(boolean relPaths)
          Indicates if path names are stored relative to the tool/toolbox.
 void setToolCategory(String category)
          The tool category.
 void store()
          Stores the current state of the tool to the toolbox.
 IGPMessages validate(IArray paramvalues, boolean updateValues, IGPEnvironmentManager pEnvMgr)
          Validates the given set of values.
 

Method Detail

getName

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

Product Availability

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

Supported Platforms

Windows

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

setName

void setName(String displayName)
             throws IOException,
                    AutomationException
The name of the tool.

Product Availability

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

Supported Platforms

Windows

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

getDisplayName

String getDisplayName()
                      throws IOException,
                             AutomationException
The display name of the tool.

Product Availability

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

Supported Platforms

Windows

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

setDisplayName

void setDisplayName(String displayName)
                    throws IOException,
                           AutomationException
The display name of the tool.

Product Availability

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

Supported Platforms

Windows

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

getDescription

String getDescription()
                      throws IOException,
                             AutomationException
The description of the tool.

Product Availability

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

Supported Platforms

Windows

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

setDescription

void setDescription(String description)
                    throws IOException,
                           AutomationException
The description of the tool.

Product Availability

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

Supported Platforms

Windows

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

getToolCategory

String getToolCategory()
                       throws IOException,
                              AutomationException
The tool category.

Product Availability

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

Supported Platforms

Windows

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

setToolCategory

void setToolCategory(String category)
                     throws IOException,
                            AutomationException
The tool category.

Product Availability

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

Supported Platforms

Windows

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

getToolbox

IGPToolbox getToolbox()
                      throws IOException,
                             AutomationException
The toolbox of the tool.

Product Availability

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

Supported Platforms

Windows

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

getToolType

int getToolType()
                throws IOException,
                       AutomationException
The type of tool.

Product Availability

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

Supported Platforms

Windows

Returns:
A com.esri.arcgis.geoprocessing.esriGPToolType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isValid

boolean isValid()
                throws IOException,
                       AutomationException
Returns whether the tool is capable of being executed/edited.

Product Availability

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

Supported Platforms

Windows

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

isLicensedForProduct

boolean isLicensedForProduct()
                             throws IOException,
                                    AutomationException
Returns whether the tool is part of the current product.

Product Availability

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

Supported Platforms

Windows

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

isLicensed

boolean isLicensed()
                   throws IOException,
                          AutomationException
Returns whether the tool is licensed to be executed.

Product Availability

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

Supported Platforms

Windows

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

isDeleted

boolean isDeleted()
                  throws IOException,
                         AutomationException
Indicates if the tool has been deleted.

Product Availability

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

Supported Platforms

Windows

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

canAlter

boolean canAlter()
                 throws IOException,
                        AutomationException
Returns whether or not the properties of the tool can be modified.

Product Availability

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

Supported Platforms

Windows

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

canEditSource

boolean canEditSource()
                      throws IOException,
                             AutomationException
Returns whether or not the source (i.e., definition) of the tool can be modified.

Product Availability

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

Supported Platforms

Windows

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

getParameterInfo

IArray getParameterInfo()
                        throws IOException,
                               AutomationException
The set of parameters required to execute the tool.

Product Availability

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

Supported Platforms

Windows

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

getDialogCLSID

IUID getDialogCLSID()
                    throws IOException,
                           AutomationException
The class identifier of the custom dialog to use for this tool.

Product Availability

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

Supported Platforms

Windows

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

store

void store()
           throws IOException,
                  AutomationException
Stores the current state of the tool to the toolbox.

Product Availability

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

Supported Platforms

Windows

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

validate

IGPMessages validate(IArray paramvalues,
                     boolean updateValues,
                     IGPEnvironmentManager pEnvMgr)
                     throws IOException,
                            AutomationException
Validates the given set of values.

Product Availability

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

Supported Platforms

Windows

Parameters:
paramvalues - A reference to a com.esri.arcgis.system.IArray (in)
updateValues - The updateValues (in)
pEnvMgr - A reference to a com.esri.arcgis.geoprocessing.IGPEnvironmentManager (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IGPMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

void execute(IArray paramvalues,
             ITrackCancel trackcancel,
             IGPEnvironmentManager pEnvMgr,
             IGPMessages messages)
             throws IOException,
                    AutomationException
Executes the tool with the given set of values.

Product Availability

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

Supported Platforms

Windows

Parameters:
paramvalues - A reference to a com.esri.arcgis.system.IArray (in)
trackcancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
pEnvMgr - A reference to a com.esri.arcgis.geoprocessing.IGPEnvironmentManager (in)
messages - A reference to a com.esri.arcgis.geodatabase.IGPMessages (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

editProperties

boolean editProperties(int hParent,
                       IGPEnvironmentManager gPEnvMgr)
                       throws IOException,
                              AutomationException
Presents a modal dialog to edit the tool's properties.

Product Availability

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

Supported Platforms

Windows

Parameters:
hParent - The hParent (A COM typedef) (in)
gPEnvMgr - A reference to a com.esri.arcgis.geoprocessing.IGPEnvironmentManager (in)
Returns:
The ok
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRenderer

Object getRenderer(IGPParameter pParam)
                   throws IOException,
                          AutomationException
Returns the renderer associated with the specified parameter.

Product Availability

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

Supported Platforms

Windows

Parameters:
pParam - A reference to a com.esri.arcgis.geoprocessing.IGPParameter (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPathName

String getPathName()
                   throws IOException,
                          AutomationException
The path of the tool object.

Product Availability

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

Supported Platforms

Windows

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

isRelativePaths

boolean isRelativePaths()
                        throws IOException,
                               AutomationException
Indicates if path names are stored relative to the tool/toolbox.

Product Availability

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

Supported Platforms

Windows

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

setRelativePaths

void setRelativePaths(boolean relPaths)
                      throws IOException,
                             AutomationException
Indicates if path names are stored relative to the tool/toolbox.

Product Availability

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

Supported Platforms

Windows

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

getHelpFile

String getHelpFile()
                   throws IOException,
                          AutomationException
Name of the (CHM) file containing help information for this tool.

Product Availability

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

Supported Platforms

Windows

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

setHelpFile

void setHelpFile(String file)
                 throws IOException,
                        AutomationException
Name of the (CHM) file containing help information for this tool.

Product Availability

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

Supported Platforms

Windows

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

getHelpContext

int getHelpContext()
                   throws IOException,
                          AutomationException
The context identifier of the topic within the help file for this tool.

Product Availability

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

Supported Platforms

Windows

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

setHelpContext

void setHelpContext(int context)
                    throws IOException,
                           AutomationException
The context identifier of the topic within the help file for this tool.

Product Availability

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

Supported Platforms

Windows

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