com.esri.arcgis.arccatalog
Class GxDocument

java.lang.Object
  extended by com.esri.arcgis.arccatalog.GxDocument
All Implemented Interfaces:
IDocument, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class GxDocument
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDocument

Esri ArcCatalog Application Document.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
GxDocument(Object obj)
          Construct a GxDocument using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 void addIGxDocumentEventsDispListener(IGxDocumentEventsDisp theListener)
          addIGxDocumentEventsDispListener.
 void addIGxDocumentEventsListener(IGxDocumentEvents theListener)
          addIGxDocumentEventsListener.
 boolean equals(Object o)
          Compare this object with another
 IAcceleratorTable getAccelerators()
          The accelerator table for this document.
 ICommandBars getCommandBars()
          The commandbars collection in this document.
 IUID getID()
          The unique id for this document.
 IApplication getParent()
          The application in which this document is open.
 String getTitle()
          The title of this document.
 int getType()
          The type of this document.
 Object getVBProject()
          The VBProject for this document.
 int hashCode()
          the hashcode for this object
 void removeIGxDocumentEventsDispListener(IGxDocumentEventsDisp theListener)
          removeIGxDocumentEventsDispListener.
 void removeIGxDocumentEventsListener(IGxDocumentEvents theListener)
          removeIGxDocumentEventsListener.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

GxDocument

public GxDocument(Object obj)
           throws IOException
Construct a GxDocument using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to GxDocument.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
GxDocument o = (GxDocument)obj; // will not work

GxDocument o = new GxDocument(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems GxDocument theGxDocument = (GxDocument) obj;
Method Detail

equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

addIGxDocumentEventsDispListener

public void addIGxDocumentEventsDispListener(IGxDocumentEventsDisp theListener)
                                      throws IOException
addIGxDocumentEventsDispListener. Listen to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.arccatalog.IGxDocumentEventsDisp interface.
Throws:
IOException - If there are communications problems.

removeIGxDocumentEventsDispListener

public void removeIGxDocumentEventsDispListener(IGxDocumentEventsDisp theListener)
                                         throws IOException
removeIGxDocumentEventsDispListener. Stop listening to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.arccatalog.IGxDocumentEventsDisp interface.
Throws:
IOException - If there are communications problems.

addIGxDocumentEventsListener

public void addIGxDocumentEventsListener(IGxDocumentEvents theListener)
                                  throws IOException
addIGxDocumentEventsListener. Listen to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.arccatalog.IGxDocumentEvents interface.
Throws:
IOException - If there are communications problems.

removeIGxDocumentEventsListener

public void removeIGxDocumentEventsListener(IGxDocumentEvents theListener)
                                     throws IOException
removeIGxDocumentEventsListener. Stop listening to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.arccatalog.IGxDocumentEvents interface.
Throws:
IOException - If there are communications problems.

getParent

public IApplication getParent()
                       throws IOException,
                              AutomationException
The application in which this document is open.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getParent in interface IDocument
Returns:
A reference to a com.esri.arcgis.framework.IApplication
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IApplication

getTitle

public String getTitle()
                throws IOException,
                       AutomationException
The title of this document.

Remarks

Title returns the name of the currently loaded document or template. It returns "Untitled" if the document has never been saved. If the document object is the Normal template, Title returns Normal.mxt.

Note that file extension is included with the name (e.g. MyDocument.mxd) if the Windows Explorer Folder Option "Hide extensions for known file types" is unchecked when the document is opened. Otherwise, Title returns the name without the file extension.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getTitle in interface IDocument
Returns:
The title
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCommandBars

public ICommandBars getCommandBars()
                            throws IOException,
                                   AutomationException
The commandbars collection in this document.

Description

CommandBars is a collection of all the toolbars available to a document. The ICommandBars interface allows you to set properties for all the commandbars and to create, find, or hide commandbars.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getCommandBars in interface IDocument
Returns:
A reference to a com.esri.arcgis.framework.ICommandBars
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ICommandBars

getAccelerators

public IAcceleratorTable getAccelerators()
                                  throws IOException,
                                         AutomationException
The accelerator table for this document.

Description

An AcceleratorTable is an object that contains a list of accelerator keys and the command identifiers associated with them.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getAccelerators in interface IDocument
Returns:
A reference to a com.esri.arcgis.framework.IAcceleratorTable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IAcceleratorTable

getID

public IUID getID()
           throws IOException,
                  AutomationException
The unique id for this document.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getID in interface IDocument
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.

getType

public int getType()
            throws IOException,
                   AutomationException
The type of this document.

Remarks

Use the Type property to determine whether the document object is the document, a base template, or the Normal template. Type returns an esriDocumentType enumeration.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getType in interface IDocument
Returns:
A com.esri.arcgis.framework.esriDocumentType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriDocumentType

getVBProject

public Object getVBProject()
                    throws IOException,
                           AutomationException
The VBProject for this document.

Description

The VBProject property returns a reference to the VBA VBProject object associated with the document. Use the VBProject object to set properties for the project, to access the VBComponents collection (all the modules, class modules, forms, etc. in the project), and to access the References collection.

Remarks

In the Visual Basic Editor in ArcMap, there can be up to three VBA projects. The document, the base template, and the Normal template all have a VBA project. In the following snapshot of the Project Explorer, the VBA project for the Normal template is called Normal (Normal.mxt). The VBA project for the current document is called Project (MyMap.mxd). This document is based on a template so there is also a VBA project for the template called TemplateProject (MyBase.mxt).

In the Visual Basic Editor in ArcCatalog, there is only one VBA project - Normal (Normal.gxt).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getVBProject in interface IDocument
Returns:
A reference to another Automation Object (IDispatch)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.