com.esri.arcgis.framework
Class ListDialog

java.lang.Object
  extended by com.esri.arcgis.framework.ListDialog
All Implemented Interfaces:
IListDialog, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class ListDialog
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IListDialog

List Dialog object.

Remarks

The list dialog is a dialog used to present a list of options and allows the user to select one of the options.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
ListDialog()
          Constructs a ListDialog using ArcGIS Engine.
ListDialog(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ListDialog theListDialog = (ListDialog) obj;
 
Method Summary
 void addString(String choice)
          Adds a string to the list that the dialog will show.
 boolean doModal(String title, int initialChoice, int hWnd)
          Displays the list dialog and lets the user select a choice.
 boolean equals(Object o)
          Compare this object with another
 int getChoice()
          The index of the string chosen (use after calling DoModal).
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 
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

ListDialog

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

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

ListDialog

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

Construct a ListDialog using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to ListDialog.

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

addString

public void addString(String choice)
               throws IOException,
                      AutomationException
Adds a string to the list that the dialog will show. These strings will be sorted in alphabetical order.

Description

Choice is a string that will be used as an item in the list displayed by the dialog.

Remarks

The AddString method is used to populate the list that is displayed in the dialog. When the dialog is displayed, the items in the list are sorted in alphabetical order.

The following code shows a list in the dialog and then reports the string associated with the selected item. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getChoice

public int getChoice()
              throws IOException,
                     AutomationException
The index of the string chosen (use after calling DoModal). Strings are numbered starting at 0 in the order that they were added, not the order that they appear in the dialog.

Remarks

The Choice property returns the index of the selected item in the list. The items are numbered starting at 0 in the order that they were added, not the order that they appear in the dialog.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getChoice in interface IListDialog
Returns:
The index
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

doModal

public boolean doModal(String title,
                       int initialChoice,
                       int hWnd)
                throws IOException,
                       AutomationException
Displays the list dialog and lets the user select a choice. Returns false if the user hits the cancel button.

Description

Title is a string that specifies the title of the dialog.

initialChoice specifies the index of the item in the list that is initially selected when the dialog is shown. The items are numbered starting at 0 in the order that they were added to the list.

hWnd specifies the window handle of the parent window. In most cases this will be the hWnd of the application.

Remarks

The DoModal method returns False if the dialog was cancelled.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
doModal in interface IListDialog
Parameters:
title - The title (in)
initialChoice - The initialChoice (in)
hWnd - The hWnd (A COM typedef) (in)
Returns:
The pOK
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.