|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IApplication
Provides access to members that query or modify the application.
The Application object is the core object in the ArcMap and ArcCatalog applications. This object represents the application itself and acts as the central point where access is gained to other objects in the system. The Application object's primary interface is IApplication. This interface provides access to the Document object, the extensions, the StatusBar object, the Templates object, the currently selected tool, and the Visual Basic Editor. There are several methods that allow you to open, save, and print documents, lock and unlock the application from user customizations, display dialogs, and exit the application.
ICommand.onCreate(java.lang.Object)
,
IDocument.getParent()
,
com.esri.arcgis.arcmapUI.IMxApplication
Method Summary | |
---|---|
IExtension |
findExtensionByCLSID(IUID extensionCLSID)
Finds an extension by its CLSID. |
IExtension |
findExtensionByName(String extensionName)
Finds an extension by its name. |
String |
getCaption()
The caption of this application. |
ICommandItem |
getCurrentTool()
The currently selected tool. |
IDocument |
getDocument()
The document that is currently loaded in the application. |
int |
getHWnd()
The handle of the application's window. |
String |
getName()
The name of this application. |
IStatusBar |
getStatusBar()
The statusbar of this application. |
ITemplates |
getTemplates()
The templates collection. |
Object |
getVBE()
The Visual Basic Environment. |
boolean |
isDialogVisible(int dialogID)
Indicates if the specified dialog is visible in the application. |
boolean |
isVisible()
Indicates if the application window is visible. |
void |
lockCustomization(String password,
ICustomizationFilter custFilter)
Locks the application's user interface against any customizations. |
void |
newDocument(boolean selectTemplate,
String templatePath)
Creates a new document in this application. |
void |
openDocument(String path)
Opens a document in this application. |
void |
printDocument()
Displays the Print dialog. |
void |
printPreview()
Displays how the document will look like when it is printed. |
void |
refreshWindow()
Redraws the application window. |
void |
saveAsDocument(String saveAsPath,
boolean saveAsCopy)
Saves the document that is currently open in this application to a different file. |
void |
saveDocument(String saveAsPath)
Saves the document that is currently open in this application. |
void |
setCaption(String caption)
The caption of this application. |
void |
setCurrentToolByRef(ICommandItem tool)
The currently selected tool. |
void |
setVisible(boolean visible)
Indicates if the application window is visible. |
Object |
showDialog(int dialogID,
Object bShow)
Displays the specified dialog in the application. |
void |
shutdown()
Terminates the application. |
void |
unlockCustomization(String password)
Unlocks previous user interface customization lock. |
Method Detail |
---|
String getName() throws IOException, AutomationException
Returns the string ArcMap for the ArcMap application.
Returns the string ArcCatalog for the ArcCatalog application.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDocument getDocument() throws IOException, AutomationException
In ArcMap, the Document is the currently loaded document.
In ArcCatalog, the Document is the Normal template.
Both ArcMap and ArcCatalog applications are composed of several things including a document. The document is an object which controls the representation of data. In ArcMap, the document object is the MxDocument CoClass and in ArcCatalog it is the GxDocument CoClass. Access to these CoClasses is provided through this property.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDocument
,
GxDocument
,
com.esri.arcgis.arcmapUI.MxDocument
IStatusBar getStatusBar() throws IOException, AutomationException
The status bar is the horizontal area at the bottom of an ArcGIS application window. It provides information about the selected command. For example, if you select a layer in the table of contents in ArcMap, the status bar will tell you how many features are currently selected. It may also display a progress bar while something is being processed.
The IStatusBar interface allows you to set the properties of the status bar.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IStatusBar
Object showDialog(int dialogID, Object bShow) throws IOException, AutomationException
Refer to the esriMxDlgIDs Constants help topic for a listing of the dialog ids in ArcMap.
Refer to the esriGxDlgIDs Constants help topic for a listing of the dialog ids in ArcCatalog.
This example shows the TOC in ArcMap if it is not already visible. You would get m_app from the hook in ICommand::OnCreate().
dialogID
- The dialogID (in)bShow
- A Variant (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.com.esri.arcgis.arcmapUI.esriMxDlgIDs
,
com.esri.arcgis.arccatalogui.esriGxDlgIDs
boolean isDialogVisible(int dialogID) throws IOException, AutomationException
Refer to the esriMxDlgIDs Constants help topic for a listing of the dialog ids in ArcMap.
Refer to the esriGxDlgIDs Constants help topic for a listing of the dialog ids in ArcCatalog.
dialogID
- The dialogID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.com.esri.arcgis.arcmapUI.esriMxDlgIDs
,
com.esri.arcgis.arccatalogui.esriGxDlgIDs
ICommandItem getCurrentTool() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICommandItem
void setCurrentToolByRef(ICommandItem tool) throws IOException, AutomationException
This VBA macro makes the Identify tool the currently selected tool in ArcMap.
Public Sub SetCurrentTool()
Dim pItem As ICommandItem
' Use the built-in ArcId module to find unique identifier
' for the Identify tool
Set pItem = CommandBars.Find(arcid.Query_Identify)
Set Application.CurrentTool = pItem
End Sub
tool
- A reference to a com.esri.arcgis.framework.ICommandItem (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICommandItem
Object getVBE() throws IOException, AutomationException
The VBE is the root object that provides access to all other objects represented in Visual Basic for Applications that is embedded in the application.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void newDocument(boolean selectTemplate, String templatePath) throws IOException, AutomationException
selectTemplate Specify True if you want the New document dialog to be opened to allow the user to select a template. [Optional]
templatePath is a string representing the path and filename of the template to base the new document on if selectTemplate is False. [Optional]
If selectTemplate is True, the New document dialog is displayed.
If templatePath is not specified, the New document dialog is displayed regardless of the value of selectTemplate.
Note, this method does not work in ArcCatalog.
The following example creates a new document in ArcMap using the Normal template. You would get m_app from the hook in ICommand::OnCreate().
selectTemplate
- The selectTemplate (in, optional, pass false if not required)templatePath
- The templatePath (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void openDocument(String path) throws IOException, AutomationException
Path is a string representing the path and filename of the document to be opened. [Optional]
If no Path is specified, the Open dialog is displayed.
Note, this method does not work in ArcCatalog.
path
- The path (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void saveDocument(String saveAsPath) throws IOException, AutomationException
saveAsPath is a string representing a path and filename for the document that is being saved. [Optional]
If this document is a new document that has not been saved yet and a saveAsPath is not specified, the Save As dialog will be displayed.
saveAsPath
- The saveAsPath (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void saveAsDocument(String saveAsPath, boolean saveAsCopy) throws IOException, AutomationException
saveAsPath is a string representing a new path and filename for the document that is being saved. [Optional]
saveAsCopy specify True if you want to save a copy of the document to a new filename but keep the original document open in the application; otherwise False. [Optional]
Note, this method does not work in ArcCatalog.
saveAsPath
- The saveAsPath (in, optional, pass null if not required)saveAsCopy
- The saveAsCopy (in, optional, pass false if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void printPreview() throws IOException, AutomationException
Note, this method does not work in ArcCatalog.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void printDocument() throws IOException, AutomationException
Note, this method does not work in ArcCatalog.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void lockCustomization(String password, ICustomizationFilter custFilter) throws IOException, AutomationException
password is a string representing a password. The string must be at least five characters long.
custFilter is a customization filter object which implements the ICustomizationFilter interface. [Optional]
password
- The password (in)custFilter
- A reference to a com.esri.arcgis.framework.ICustomizationFilter (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICustomizationFilter
void unlockCustomization(String password) throws IOException, AutomationException
password is a string representing the password that was used to lock customization. The string must be at least five characters long.
password
- The password (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void refreshWindow() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITemplates getTemplates() throws IOException, AutomationException
The Templates object is a collection of the templates that are currently loaded in the application. In ArcCatalog, the Normal template, Normal.gxt, is the only template that is ever loaded. In ArcMap, there is either two or three templates loaded. The Normal template, Normal.mxt, is always loaded. Also, the document is considered a template is this case; there is always a document loaded in ArcMap. Optionally, the document can be based on another template referred to as a base template.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITemplates
int getHWnd() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IExtension findExtensionByName(String extensionName) throws IOException, AutomationException
extensionName specifies the name of an extension as a string.
To find the Name of an ESRI extension, refer to the following technical document:
ArcGIS Developer Help > Technical Documents > Names and IDs > Extensions
If an extension is registered as a Just-In-Time extension, FindExtensionByName may return nothing. The safest way to get a reference to any extension is to use FindExtensionByCLSID.
extensionName
- The extensionName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IExtension
IExtension findExtensionByCLSID(IUID extensionCLSID) throws IOException, AutomationException
ExtensionCLSID specifies the unique identifier (UID) of an extension.
COM coclasses are identified by a globally unique identifier (GUID). There are two formats for the GUID for a coclass: a class ID (CLSID) and a ProgID. The ProgID is a text alias for a CLSID. The UID coclass can be used to represent the GUID of an extension object. You can set the IUID.Value property to either the CLSID or the ProgID.
To find the CLSID and ProgID of an ESRI extension, refer to the following technical document:
ArcGIS Developer Help > Technical Documents > Names and IDs > Extensions
For your custom extensions, the ProgID is a string composed of the name of your project used to make the extension and the class name of the extension. For example if you have a Visual Basic project called MyCustomExt and there is a class module for your extension called clsMyExtension in that project, then the ProgID for this command would be "MyCustomExt.clsMyExtension". To find the CLSID for this command, you could search the system registry for this ProgID.
extensionCLSID
- A reference to a com.esri.arcgis.system.IUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IExtension
,
IUID
void shutdown() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isVisible() throws IOException, AutomationException
Set the Visible property to True to make the application window visible.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setVisible(boolean visible) throws IOException, AutomationException
Set the Visible property to True to make the application window visible.
visible
- The visible (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setCaption(String caption) throws IOException, AutomationException
Public Sub SetCaption()
Application.Caption = "My Custom Application"
End Sub
caption
- The caption (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getCaption() throws IOException, AutomationException
The Caption is the string that appears as the title of the application's main window.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |