com.esri.arcgis.controls
Class CustomizeDialog

java.lang.Object
  extended by com.esri.arcgis.controls.CustomizeDialog
All Implemented Interfaces:
ICustomizeDialog, ICustomizeDialog2, IConnectionPointContainer, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class CustomizeDialog
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ICustomizeDialog, ICustomizeDialog2, ISupportErrorInfo, IConnectionPointContainer

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

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.

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Constructor Summary
CustomizeDialog()
          Constructs a CustomizeDialog using ArcGIS Engine.
CustomizeDialog(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CustomizeDialog theCustomizeDialog = (CustomizeDialog) obj;
 
Method Summary
 void addICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
          addICustomizeDialogEventsListener.
 void closeDialog()
          Closes the customize dialog.
 void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
          enumConnectionPoints
 boolean equals(Object o)
          Compare this object with another
 void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP)
          findConnectionPoint
static String getClsid()
          getClsid.
 String getCommandsCategory()
          The GUID of the component category used for commands.
 String getDialogTitle()
          The title of the customize dialog.
 Object getDoubleClickDestination()
          The ToolbarControl commands are added to when double clicked.
 String getMenusCategory()
          The GUID of the component category used for menu definitions.
 String getPalettesCategory()
          The GUID of the component category used for palette definitions.
 String getToolbarsCategory()
          The GUID of the component category used for toolbar definitions.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 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)
          removeICustomizeDialogEventsListener.
 void setCommandsCategory(String pVal)
          The GUID of the component category used for commands.
 void setDialogTitle(String pVal)
          The title of the customize dialog.
 void setDoubleClickDestination(Object pToolbarControl)
          Sets the ToolbarControl commands are added to when double clicked.
 void setMenusCategory(String pVal)
          The GUID of the component category used for menu definitions.
 void setPalettesCategory(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(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
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

CustomizeDialog

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

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

CustomizeDialog

public CustomizeDialog(Object obj)
                throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CustomizeDialog theCustomizeDialog = (CustomizeDialog) obj;

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.

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

getClsid

public static String getClsid()
getClsid.


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

addICustomizeDialogEventsListener

public void addICustomizeDialogEventsListener(ICustomizeDialogEvents theListener)
                                       throws IOException
addICustomizeDialogEventsListener. Listen to events generated by this class.

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

removeICustomizeDialogEventsListener

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

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

startDialog

public void startDialog(int hWndParent)
                 throws IOException,
                        AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

getCommandsCategory

public String getCommandsCategory()
                           throws IOException,
                                  AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setCommandsCategory

public void setCommandsCategory(String pVal)
                         throws IOException,
                                AutomationException
The GUID of the component category used for commands.

Product Availability

Available with ArcGIS Engine.

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

getToolbarsCategory

public String getToolbarsCategory()
                           throws IOException,
                                  AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setToolbarsCategory

public void setToolbarsCategory(String pVal)
                         throws IOException,
                                AutomationException
The GUID of the component category used for toolbar definitions.

Product Availability

Available with ArcGIS Engine.

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

closeDialog

public void closeDialog()
                 throws IOException,
                        AutomationException
Closes the customize dialog.

Description

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

Product Availability

Available with ArcGIS Engine.

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

isDialogActive

public boolean isDialogActive()
                       throws IOException,
                              AutomationException
Indicates if the customize dialog is active on the screen.

Description

Indicates whether the modeless CustomizeDialog is currently on the screen. The CustomizeDialog can be closed through user interaction, calling the CloseDialog method, or when the CustomizeDialog object is released.

Product Availability

Available with ArcGIS Engine.

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

getDialogTitle

public String getDialogTitle()
                      throws IOException,
                             AutomationException
The title of the customize dialog.

Description

The title displayed in the CustomizeDialog window.

Product Availability

Available with ArcGIS Engine.

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

setDialogTitle

public void setDialogTitle(String pVal)
                    throws IOException,
                           AutomationException
The title of the customize dialog.

Product Availability

Available with ArcGIS Engine.

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

getDoubleClickDestination

public Object getDoubleClickDestination()
                                 throws IOException,
                                        AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setDoubleClickDestination

public void setDoubleClickDestination(Object pToolbarControl)
                               throws IOException,
                                      AutomationException
Sets the ToolbarControl commands are added to when double clicked.

Description

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

Product Availability

Available with ArcGIS Engine.

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

isShowAddFromFile

public boolean isShowAddFromFile()
                          throws IOException,
                                 AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setShowAddFromFile

public void setShowAddFromFile(boolean pVal)
                        throws IOException,
                               AutomationException
Indicates if the 'Add From File' button is available on the customize dialog.

Product Availability

Available with ArcGIS Engine.

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

getMenusCategory

public String getMenusCategory()
                        throws IOException,
                               AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setMenusCategory

public void setMenusCategory(String pVal)
                      throws IOException,
                             AutomationException
The GUID of the component category used for menu definitions.

Product Availability

Available with ArcGIS Engine.

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

getPalettesCategory

public String getPalettesCategory()
                           throws IOException,
                                  AutomationException
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.

Product Availability

Available with ArcGIS Engine.

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

setPalettesCategory

public void setPalettesCategory(String pVal)
                         throws IOException,
                                AutomationException
The GUID of the component category used for palette definitions.

Product Availability

Available with ArcGIS Engine.

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

setWindowPosition

public void setWindowPosition(int left,
                              int top)
                       throws IOException,
                              AutomationException
Positions the customize dialog at the given screen co-ordinates.

Description

Sets the position the CustomizeDialog will display itself on the screen each time the ICustomizeDialog::StartDialog method is used. The position is in device co-ordinates (pixels) relative to the top left (0,0) of the screen display.

If a position is supplied that will take the CustomizeDialog off the screen display such as (-20,-20) the window will always display so it's visible. In this case at the top left with a position of (0,0).

Product Availability

Available with ArcGIS Engine.

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

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

enumConnectionPoints

public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
                          throws IOException,
                                 AutomationException
enumConnectionPoints

Description

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

findConnectionPoint

public void findConnectionPoint(GUID riid,
                                IConnectionPoint[] ppCP)
                         throws IOException,
                                AutomationException
findConnectionPoint

Description

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.