com.esri.arcgis.addinframework
Class InternalComboBox

java.lang.Object
  extended by com.esri.arcgis.addinframework.AddIn
      extended by com.esri.arcgis.addinframework.InternalButton
          extended by com.esri.arcgis.addinframework.InternalComboBox
All Implemented Interfaces:
IComboBox, ICommand, Serializable
Direct Known Subclasses:
InternalComboBoxComponentTip

public class InternalComboBox
extends InternalButton
implements IComboBox

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.systemUI.IComboBox
IID, IIDb3cf6f42_40b5_42c4_8714_0b6fd2de8c85, xxDummy
 
Constructor Summary
InternalComboBox()
           
 
Method Summary
 int getDropDownHeight()
          The Combo box's drop down height
 String getDropDownWidth()
          The Combo box's drop down width
 String getHintText()
          Set the hint displayed in the editbox.
 String getWidth()
          The Combo box's width
 boolean isEditable()
          Is the combo box editable?
 boolean isShowCaption()
          Show Caption as Label?
 void onClick()
          Occurs when this command is clicked.
 void onCreate(Object hook)
          Occurs when this command is created.
 void onEditChange(String editString)
          Called by system when the edit box is typed into (if editable)
 void onEnter()
          Called by system when an key is pressed in the edit box (if editable)
 void onFocus(boolean focusSet)
          Called by system when the gets or loses focus
 void onSelChange(int cookie)
          Called by system when a selection changes
 void seed(Object delegate)
           
 void setParameters(IAddInRecord record, IFactoryHook factoryHook)
           
 
Methods inherited from class com.esri.arcgis.addinframework.InternalButton
init, isChecked, isEnabled
 
Methods inherited from class com.esri.arcgis.addinframework.AddIn
getApp, nativeGetPictureFromIStream, nativeGetPictureFromStream, read, readCursorFromStream, readPictureFromIStream, readPictureFromStream, readSubnode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.systemUI.ICommand
getBitmap, getCaption, getCategory, getHelpContextID, getHelpFile, getMessage, getName, getTooltip
 

Constructor Detail

InternalComboBox

public InternalComboBox()
Method Detail

seed

public void seed(Object delegate)
Overrides:
seed in class InternalButton

onCreate

public void onCreate(Object hook)
              throws IOException,
                     AutomationException
Description copied from interface: ICommand
Occurs when this command is created.

Description

hook is a reference to an IApplication object or any of the Controls.

Remarks

The OnCreate method gives the command a hook into the application.

When implementing ICommand to create a custom command, use the OnCreate method to get a hook to the application.

When you implement ICommand to create a custom command, you will find that your class constructor and destructor are called more than once per session. Commands are constructed once initially to get information about them, like the name, bitmap, etc and then they are destroyed. When the final, complete construction takes place, the OnCreate method gets called. OnCreate gets called only once, so you can rely on it to perform initialization of member variables. You can check for initialized member variables in the class destructor to find out if OnCreate has been called previously.

Example:

Object buddyControl = null;

MapControl mapControl = null; 
 
//If your buddy control is of type mapcontrol
 
public void onCreate(Object hook) {
      try { 
      // The hook argument is an instance of control to which this tool is added. 
      // Normally toolbar control.          
      ToolbarControl toolbarControl = new ToolbarControl(hook); 
      //Get the buddy control to which the toolbarcontrol is associated to.         
      buddyControl = toolbarControl.getBuddy();
      mapControl = new MapControl(buddyControl);
       }
      catch (IOException ex) {
      }
}

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
onCreate in interface ICommand
Overrides:
onCreate in class InternalButton
Parameters:
hook - A reference to another Automation Object (IDispatch) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IApplication

setParameters

public void setParameters(IAddInRecord record,
                          IFactoryHook factoryHook)
Overrides:
setParameters in class InternalButton

onClick

public final void onClick()
                   throws AutomationException,
                          IOException
Description copied from class: InternalButton
Occurs when this command is clicked.

Remarks

When implementing ICommand to create a custom command, write the code that performs the action when the command is clicked in the OnClick method.

Example:

public void onClick() {     
   //In this example, a message is displayed in console.     
   System.out.println("Clicked on my command");
}

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
onClick in interface ICommand
Overrides:
onClick in class InternalButton
Throws:
AutomationException - If the ArcObject component throws an exception.
IOException - If there are interop problems.

isEditable

public boolean isEditable()
                   throws IOException,
                          AutomationException
Is the combo box editable?

Specified by:
isEditable in interface IComboBox
Returns:
The editable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWidth

public String getWidth()
                throws IOException,
                       AutomationException
The Combo box's width

Specified by:
getWidth in interface IComboBox
Returns:
The stringForWidth
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDropDownWidth

public String getDropDownWidth()
                        throws IOException,
                               AutomationException
The Combo box's drop down width

Specified by:
getDropDownWidth in interface IComboBox
Returns:
The stringForWidth
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDropDownHeight

public int getDropDownHeight()
                      throws IOException,
                             AutomationException
The Combo box's drop down height

Specified by:
getDropDownHeight in interface IComboBox
Returns:
The rowsHigh
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHintText

public String getHintText()
                   throws IOException,
                          AutomationException
Set the hint displayed in the editbox.

Specified by:
getHintText in interface IComboBox
Returns:
The hintText
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowCaption

public boolean isShowCaption()
                      throws IOException,
                             AutomationException
Show Caption as Label?

Specified by:
isShowCaption in interface IComboBox
Returns:
The showCaption
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onEditChange

public void onEditChange(String editString)
                  throws IOException,
                         AutomationException
Called by system when the edit box is typed into (if editable)

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

onSelChange

public void onSelChange(int cookie)
                 throws IOException,
                        AutomationException
Called by system when a selection changes

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

onEnter

public void onEnter()
             throws IOException,
                    AutomationException
Called by system when an key is pressed in the edit box (if editable)

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

onFocus

public void onFocus(boolean focusSet)
             throws IOException,
                    AutomationException
Called by system when the gets or loses focus

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