com.esri.arcgis.systemUI
Class IToolBarDefProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.systemUI.IToolBarDefProxy
All Implemented Interfaces:
IToolBarDef, Externalizable, Serializable

public class IToolBarDefProxy
extends com.esri.arcgis.interop.Dispatch
implements IToolBarDef, Serializable

Provides access to members that define a toolbar.

Remarks

The command bars collection uses command bar definitions (either ToolBarDef or MenuDef) to create command bars. For example, a class that implements IToolbarDef is only a definition for a toolbar; it is not actually a toolbar object. Once this class is registered in one of the command bar component categories, the command bars collection uses the definition of the toolbar in your class to create the actual command bar.

When an end user installs your custom toolbar, you may want this toolbar immediately available in the application so that the user doesn't have to manually display that toolbar before using it. You can add a registry setting to make this toolbar automatically appear the first time the application is run after the installation of your toolbar. In the setup program for your toolbar, you can create a new key under:

HKEY_CURRENT_USER\Software\ESRI\Desktop10.x\ArcMap\Settings\PremierToolbars

The key name should be the CLSID of the toolbar. You don't have to set a value for this key.

This graphic shows that a custom toolbar has been added to PremierToolbars in the registry.

The PremierToolbars setting is only used the first time the application is started; if the user subsequently hides the toolbar, no further attempts will be made to show the toolbar on application startup. After the application is started once the value of your PremierToolbars key is set to 1 and is then ignored by the application.

If you are working in Visual Basic you can use the ESRI Compile and Register Add-in to set up this registry key.

When To Use

The IToolbarDef interface is used to define the properties of a custom toolbar. When creating your own toolbar, you would implement the IToolBarDef interface in your class code. You can set the caption and name of the toolbar and specify what commanditems are on the toolbar.

Product Availability

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

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Fields inherited from interface com.esri.arcgis.systemUI.IToolBarDef
IID, IID61b318f0_cda0_11d1_b9a8_080009ee4e51, xxDummy
 
Constructor Summary
  IToolBarDefProxy()
           
  IToolBarDefProxy(Object obj)
           
protected IToolBarDefProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 String getCaption()
          The caption of this toolbar.
 int getItemCount()
          The number of items in this toolbar.
 void getItemInfo(int pos, IItemDef itemDef)
          The CLSID for the item on this toolbar at the specified index.
 String getName()
          The name of this toolbar.
 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

IToolBarDefProxy

public IToolBarDefProxy()

IToolBarDefProxy

public IToolBarDefProxy(Object obj)
                 throws IOException
Throws:
IOException

IToolBarDefProxy

protected IToolBarDefProxy(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

getItemCount

public int getItemCount()
                 throws IOException,
                        AutomationException
The number of items in this toolbar.

Specified by:
getItemCount in interface IToolBarDef
Returns:
The numItems
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItemInfo

public void getItemInfo(int pos,
                        IItemDef itemDef)
                 throws IOException,
                        AutomationException
The CLSID for the item on this toolbar at the specified index.

Specified by:
getItemInfo in interface IToolBarDef
Parameters:
pos - The pos (in)
itemDef - A reference to a com.esri.arcgis.systemUI.IItemDef (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
The name of this toolbar.

Specified by:
getName in interface IToolBarDef
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCaption

public String getCaption()
                  throws IOException,
                         AutomationException
The caption of this toolbar.

Specified by:
getCaption in interface IToolBarDef
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.