com.esri.arcgis.framework
Class ITemplatesProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.framework.ITemplatesProxy
All Implemented Interfaces:
ITemplates, Externalizable, Serializable

public class ITemplatesProxy
extends com.esri.arcgis.interop.Dispatch
implements ITemplates, Serializable

Provides access to members that query the templates collection.

Description

The Templates collection references the template objects that are currently loaded with the application. A template is a document that is used as a starting point for creating new documents. It carries customizations of several types—user interface, VBA project, and application-specific data. ArcMap has two or three templates loaded with an application. If the document is based on the Normal template, two items are in the templates collection. If the document is based on a project template, three items are in the templates collection. ArcCatalog always has one item in the templates collection; this item represents Normal.gxt.

Remarks

Note, the esriDisplay library contains an object called Template that is unrelated to this Templates collection.

When To Use

The ITemplates interface allows you to get a count of the loaded templates and get the pathnames of those templates. Use IApplication.Templates to get a reference to the templates collection.

Product Availability

Available with ArcGIS Desktop.

See Also:
IApplication.getTemplates(), Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  ITemplatesProxy()
           
  ITemplatesProxy(Object obj)
           
protected ITemplatesProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 int getCount()
          The number of templates associated with the current document.
 String getItem(int index)
          The pathname to the template at the given index.
 void removeListener(String iidStr, Object theListener)
           
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ITemplatesProxy

public ITemplatesProxy()

ITemplatesProxy

public ITemplatesProxy(Object obj)
                throws IOException
Throws:
IOException

ITemplatesProxy

protected ITemplatesProxy(Object obj,
                          String iid)
                   throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getCount

public int getCount()
             throws IOException,
                    AutomationException
The number of templates associated with the current document.

Remarks

In ArcCatalog, Count is always 1. The Normal template is the only template or document loaded.
In ArcMap, Count is either 2 or 3. The Normal template and a document are always loaded. If there is also a base template loaded then the count becomes 3.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getCount in interface ITemplates
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

public String getItem(int index)
               throws IOException,
                      AutomationException
The pathname to the template at the given index.

Product Availability

Available with ArcGIS Desktop.

Specified by:
getItem in interface ITemplates
Parameters:
index - The index (in)
Returns:
The pathName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.