com.esri.arcgis.controls
Class CustomizeDialog

java.lang.Object
  extended bycom.esri.arcgis.controls.CustomizeDialog
All Implemented Interfaces:
IConnectionPointContainer, ICustomizeDialog, ICustomizeDialog2, ISupportErrorInfo, java.io.Serializable

public class CustomizeDialog
extends java.lang.Object
implements ICustomizeDialog, ICustomizeDialog2, ISupportErrorInfo, IConnectionPointContainer

CustomizeDialog is a modeless dialog that allows customization of one or more ToolbarControls.

Product Availability

Available with ArcGIS Engine.

Description

The CustomizeDialog contains a modeless dialog that allows commands, toolbar definitions (toolsets), menu definitions and palette definitions to be added to a ToolbarControl at runtime, when the IToolbarControl::Customize property is set to true.

The CustomizeDialog is modeless to allow interaction with the ToolbarControl, which would otherwise be blocked if the dialog was modal. As such, the ICustomizeDialog::StartDialog method launches the CustomizeDialog on the screen and returns immediately, rather than waiting until the CustomizeDialog closes. Consequently, when the CoClass goes out of scope the CustomizeDialog will be closed. It is sensible practise to ensure the CustomizeDialog object remains alive while the container hosting the ToolbarControl is shown, by storing the CustomizeDialog object as a form (or class) level variable.

Remarks

Objects implementing IMultiItem  cannot be added interactively to the ToolbarControl via the CustomizeDialog. They must be added to an existing ToolbarMenu using the IToolbarMenu2::AddMultiItem method.

See Also:
Serialized Form

Constructor Summary
CustomizeDialog()
          Constructs a CustomizeDialog using ArcGIS Engine.
CustomizeDialog(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
Method Summary
 void addICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
           
 void closeDialog()
          Closes the customize dialog.
 void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
          Supported Platforms
 boolean equals(java.lang.Object o)
          Compare this object with another
 void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP)
          Supported Platforms
 IConnectionPointContainer getAsIConnectionPointContainer()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ICustomizeDialog getAsICustomizeDialog()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ICustomizeDialog2 getAsICustomizeDialog2()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ISupportErrorInfo getAsISupportErrorInfo()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
static java.lang.String getClsid()
           
 java.lang.String getCommandsCategory()
          The GUID of the component category used for commands.
 java.lang.String getDialogTitle()
          The title of the customize dialog.
 java.lang.Object getDoubleClickDestination()
          The ToolbarControl commands are added to when double clicked.
 java.lang.String getMenusCategory()
          The GUID of the component category used for menu definitions.
 java.lang.String getPalettesCategory()
          The GUID of the component category used for palette definitions.
 java.lang.String getToolbarsCategory()
          The GUID of the component category used for toolbar definitions.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          Supported Platforms
 boolean isDialogActive()
          Indicates if the customize dialog is active on the screen.
 boolean isShowAddFromFile()
          Indicates if the 'Add From File' button is available on the customize dialog.
 void removeICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
           
 void setCommandsCategory(java.lang.String pVal)
          The GUID of the component category used for commands.
 void setDialogTitle(java.lang.String pVal)
          The title of the customize dialog.
 void setDoubleClickDestination(java.lang.Object pToolbarControl)
          Sets the ToolbarControl commands are added to when double clicked.
 void setMenusCategory(java.lang.String pVal)
          The GUID of the component category used for menu definitions.
 void setPalettesCategory(java.lang.String pVal)
          The GUID of the component category used for palette definitions.
 void setShowAddFromFile(boolean pVal)
          Indicates if the 'Add From File' button is available on the customize dialog.
 void setToolbarsCategory(java.lang.String pVal)
          The GUID of the component category used for toolbar definitions.
 void setWindowPosition(int left, int top)
          Positions the customize dialog at the given screen co-ordinates.
 void startDialog(int hWndParent)
          Starts the modeless customize dialog.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomizeDialog

public CustomizeDialog()
                throws java.io.IOException,
                       java.net.UnknownHostException
Constructs a CustomizeDialog using ArcGIS Engine.

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

CustomizeDialog

public CustomizeDialog(java.lang.Object obj)
                throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

Construct a CustomizeDialog using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to CustomizeDialog.
CustomizeDialog theCustomizeDialog = (CustomizeDialog) obj;

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
java.io.IOException - if there are interop problems
Method Detail

getClsid

public static java.lang.String getClsid()

getAsICustomizeDialog

public ICustomizeDialog getAsICustomizeDialog()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsICustomizeDialog2

public ICustomizeDialog2 getAsICustomizeDialog2()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsISupportErrorInfo

public ISupportErrorInfo getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIConnectionPointContainer

public IConnectionPointContainer getAsIConnectionPointContainer()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

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


hashCode

public int hashCode()
the hashcode for this object


addICustomizeDialogEventsListener

public void addICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
                                       throws java.io.IOException
Throws:
java.io.IOException

removeICustomizeDialogEventsListener

public void removeICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
                                          throws java.io.IOException
Throws:
java.io.IOException

startDialog

public void startDialog(int hWndParent)
                 throws java.io.IOException,
                        AutomationException
Description copied from interface: ICustomizeDialog
Starts the modeless customize dialog.

Description

Opens a modeless CustomizeDialog on the screen and fires the ICustomizeDialogEvents::OnStartDialog event. The CustomizeDialog allows users to add commands, menus, palettes and toolsets onto the ToolbarControl by ether dragging and dropping or double clicking them.

The CustomizeDialog can be closed through user interaction, calling the CloseDialog method, or when the CustomizeDialog object is released. 

Specified by:
startDialog in interface ICustomizeDialog
Parameters:
hWndParent - The hWndParent (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCommandsCategory

public java.lang.String getCommandsCategory()
                                     throws java.io.IOException,
                                            AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for commands.

Description

The guid of the component category used by the CustomizeDialog to read ICommand objects. By default the CommandsCategory is set to the "ESRI Controls Commands" category:

"{B284D891-22EE-4F12-A0A9-B1DDED9197F4}"

Set the CommandsCategory to a valid guid of your own component category in order for the CustomizeDialog to pick up your own custom commands rather than the default control commands. The StartDialog method will extract all valid commands from this component category.

Specified by:
getCommandsCategory in interface ICustomizeDialog
Returns:
The pVal
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setCommandsCategory

public void setCommandsCategory(java.lang.String pVal)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for commands.

Specified by:
setCommandsCategory in interface ICustomizeDialog
Parameters:
pVal - The pVal (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getToolbarsCategory

public java.lang.String getToolbarsCategory()
                                     throws java.io.IOException,
                                            AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for toolbar definitions.

Description

The guid of the component category used by the CustomizeDialog to read IToolbarDef objects. By default the ToolbarsCategory is set to the "ESRI Controls Toolbars" category:

"{5155BBC7-A6E9-4AF9-81DB-A16742D5A026}"

Set the ToolbarsCategory to a valid guid of your own component category in order for the CustomizeDialog to pick up your own custom toolsets rather than the default control toolsets. The StartDialog method will extract all valid toolsets from this component category.

Specified by:
getToolbarsCategory in interface ICustomizeDialog
Returns:
The pVal
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setToolbarsCategory

public void setToolbarsCategory(java.lang.String pVal)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for toolbar definitions.

Specified by:
setToolbarsCategory in interface ICustomizeDialog
Parameters:
pVal - The pVal (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

closeDialog

public void closeDialog()
                 throws java.io.IOException,
                        AutomationException
Description copied from interface: ICustomizeDialog
Closes the customize dialog.

Description

Closes the CustomizeDialog if it is active on the screen and fires the ICustomizeDialogEvents::OnCloseDialog event.

Specified by:
closeDialog in interface ICustomizeDialog
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

isDialogActive

public boolean isDialogActive()
                       throws java.io.IOException,
                              AutomationException
Description copied from interface: ICustomizeDialog
Indicates if the customize dialog is active on the screen.

Specified by:
isDialogActive in interface ICustomizeDialog
Returns:
The pVal
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDialogTitle

public java.lang.String getDialogTitle()
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ICustomizeDialog
The title of the customize dialog.

Description

The title displayed in the CustomizeDialog window.

Specified by:
getDialogTitle in interface ICustomizeDialog
Returns:
The pVal
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDialogTitle

public void setDialogTitle(java.lang.String pVal)
                    throws java.io.IOException,
                           AutomationException
Description copied from interface: ICustomizeDialog
The title of the customize dialog.

Specified by:
setDialogTitle in interface ICustomizeDialog
Parameters:
pVal - The pVal (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getDoubleClickDestination

public java.lang.Object getDoubleClickDestination()
                                           throws java.io.IOException,
                                                  AutomationException
Description copied from interface: ICustomizeDialog
The ToolbarControl commands are added to when double clicked.

Description

The ToolbarControl passed to the SetDoubleClickDestination method that new items will be added to when an ICommand, IMenuDef, IPaletteDef or IToolbarDef object is double clicked upon in the CustomizeDialog window.

Specified by:
getDoubleClickDestination in interface ICustomizeDialog
Returns:
A reference to another Object (IUnknown)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setDoubleClickDestination

public void setDoubleClickDestination(java.lang.Object pToolbarControl)
                               throws java.io.IOException,
                                      AutomationException
Description copied from interface: ICustomizeDialog
Sets the ToolbarControl commands are added to when double clicked.

Specified by:
setDoubleClickDestination in interface ICustomizeDialog
Parameters:
pToolbarControl - A reference to another Object (IUnknown) (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowAddFromFile

public boolean isShowAddFromFile()
                          throws java.io.IOException,
                                 AutomationException
Description copied from interface: ICustomizeDialog
Indicates if the 'Add From File' button is available on the customize dialog.

Description

Determines whether the CustomizeDialog has an 'Add From File..' button. Clicking this button enables users to browse and select *.dll and *.tlb files containing objects that implement ICommand, IMenuDef, IPaletteDef and IToolbarDef. The selected *.dll or *.tlb will be registered and the objects registered in the appropriate CommandsCategory, MenusCategory, PalettesCategory and ToolbarsCategory component categories. This property is true by default.

Specified by:
isShowAddFromFile in interface ICustomizeDialog
Returns:
The pVal
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShowAddFromFile

public void setShowAddFromFile(boolean pVal)
                        throws java.io.IOException,
                               AutomationException
Description copied from interface: ICustomizeDialog
Indicates if the 'Add From File' button is available on the customize dialog.

Specified by:
setShowAddFromFile in interface ICustomizeDialog
Parameters:
pVal - The pVal (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getMenusCategory

public java.lang.String getMenusCategory()
                                  throws java.io.IOException,
                                         AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for menu definitions.

Description

The guid of the component category used by the CustomizeDialog to read IMenuDef objects. By default the MenusCategory is set to the "ESRI Controls Menus" category:

"{B7D74382-06A8-483F-8FE5-6FB08FAA356A}"

Set the MenusCategory to a valid guid of your own component category in order for the CustomizeDialog to pick up your own custom menus rather than the default control menus. The StartDialog method will extract all valid menus from this component category.

Specified by:
getMenusCategory in interface ICustomizeDialog
Returns:
The pVal
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMenusCategory

public void setMenusCategory(java.lang.String pVal)
                      throws java.io.IOException,
                             AutomationException
Description copied from interface: ICustomizeDialog
The GUID of the component category used for menu definitions.

Specified by:
setMenusCategory in interface ICustomizeDialog
Parameters:
pVal - The pVal (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPalettesCategory

public java.lang.String getPalettesCategory()
                                     throws java.io.IOException,
                                            AutomationException
Description copied from interface: ICustomizeDialog2
The GUID of the component category used for palette definitions.

Description

The guid of the component category used by the CustomizeDialog to read IPaletteDef objects. By default the PalettesCategory is set to the "ESRI Controls Palettes" category:

"{F278DFAD-3B0B-4708-99BF-227B113CB10B}"

Set the PalettesCategory to a valid guid of your own component category in order for the CustomizeDialog to pick up your own custom palettes rather than the default control palettes. The StartDialog method will extract all valid palettes from this component category.

Specified by:
getPalettesCategory in interface ICustomizeDialog2
Returns:
The pVal
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setPalettesCategory

public void setPalettesCategory(java.lang.String pVal)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: ICustomizeDialog2
The GUID of the component category used for palette definitions.

Specified by:
setPalettesCategory in interface ICustomizeDialog2
Parameters:
pVal - The pVal (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setWindowPosition

public void setWindowPosition(int left,
                              int top)
                       throws java.io.IOException,
                              AutomationException
Description copied from interface: ICustomizeDialog2
Positions the customize dialog at the given screen co-ordinates.

Specified by:
setWindowPosition in interface ICustomizeDialog2
Parameters:
left - The left (in)
top - The top (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ISupportErrorInfo

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether the interface supports IErrorInfo.

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

enumConnectionPoints

public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
                          throws java.io.IOException,
                                 AutomationException
Description copied from interface: IConnectionPointContainer

Supported Platforms

Windows, Solaris, Linux

Description

IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.

Specified by:
enumConnectionPoints in interface IConnectionPointContainer
Parameters:
ppEnum - A reference to a com.esri.arcgis.display.IEnumConnectionPoints (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findConnectionPoint

public void findConnectionPoint(GUID riid,
                                IConnectionPoint[] ppCP)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IConnectionPointContainer

Supported Platforms

Windows, Solaris, Linux

Description

IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.

Specified by:
findConnectionPoint in interface IConnectionPointContainer
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
ppCP - A reference to a com.esri.arcgis.display.IConnectionPoint (out: use single element array)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.