com.esri.arcgis.systemUI
Class IToolControlProxy

java.lang.Object
  extended bycom.esri.arcgis.interop.Dispatch
      extended bycom.esri.arcgis.systemUI.IToolControlProxy
All Implemented Interfaces:
java.io.Externalizable, IToolControl, java.io.Serializable

public class IToolControlProxy
extends Dispatch
implements IToolControl, java.io.Serializable

Provides access to members that define a toolcontrol.

Product Availability

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

See Also:
Serialized Form

Field Summary
static java.lang.Class targetClass
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF
 
Constructor Summary
  IToolControlProxy()
          For internal use only
  IToolControlProxy(java.lang.Object obj)
           
protected IToolControlProxy(java.lang.Object obj, java.lang.String iid)
           
  IToolControlProxy(java.lang.String CLSID, java.lang.String host, AuthInfo authInfo)
           
protected IToolControlProxy(java.lang.String CLSID, java.lang.String iid, java.lang.String host, AuthInfo authInfo)
           
 
Method Summary
 void addListener(java.lang.String iidStr, java.lang.Object theListener, java.lang.Object theSource)
          Adds a Java object to be a listener for a specific kind of event generated by the COM object.
 int getHWnd()
          The handle of the control.
 boolean onDrop(int barType)
          Indicates if the drag-drop operation is valid.
 void onFocus(ICompletionNotify complete)
          Occurs when the control gains focus.
 void removeListener(java.lang.String iidStr, java.lang.Object theListener)
          Removes a Java object as a listener to events generated by a COM object.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, hashCode, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, queryInterface, readExternal, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

targetClass

public static final java.lang.Class targetClass
Constructor Detail

IToolControlProxy

public IToolControlProxy(java.lang.String CLSID,
                         java.lang.String host,
                         AuthInfo authInfo)
                  throws java.net.UnknownHostException,
                         java.io.IOException

IToolControlProxy

public IToolControlProxy()
For internal use only


IToolControlProxy

public IToolControlProxy(java.lang.Object obj)
                  throws java.io.IOException

IToolControlProxy

protected IToolControlProxy(java.lang.Object obj,
                            java.lang.String iid)
                     throws java.io.IOException

IToolControlProxy

protected IToolControlProxy(java.lang.String CLSID,
                            java.lang.String iid,
                            java.lang.String host,
                            AuthInfo authInfo)
                     throws java.io.IOException
Method Detail

addListener

public void addListener(java.lang.String iidStr,
                        java.lang.Object theListener,
                        java.lang.Object theSource)
                 throws java.io.IOException
Description copied from class: Dispatch
Adds a Java object to be a listener for a specific kind of event generated by the COM object. when you wish to invoke method on the COM object using IDispatch (not using custom marshalling).

Overrides:
addListener in class Dispatch
Parameters:
iidStr - the ID of the outgoing interface, implemented by the listener
theListener - the object to be informed of the events
theSource - the proxy class that represents the COM class that is the source of the events
Throws:
java.io.IOException

removeListener

public void removeListener(java.lang.String iidStr,
                           java.lang.Object theListener)
                    throws java.io.IOException
Description copied from class: Dispatch
Removes a Java object as a listener to events generated by a COM object. when you wish to invoke method on the COM object using IDispatch (not using custom marshalling).

Overrides:
removeListener in class Dispatch
Parameters:
iidStr - the ID of the outgoing interface, implemented by the listener
theListener - the object that no longer wishes to be informed of the events
Throws:
java.io.IOException

getHWnd

public int getHWnd()
            throws java.io.IOException,
                   AutomationException
Description copied from interface: IToolControl
The handle of the control.

Supported Platforms

Windows, Solaris, Linux

Remarks

When implementing IToolControl to create a custom tool, use the hWnd property to pass window handle of the control to the application.

For example, if you want your ToolControl to be a simple ComboBox control, put a ComboBox control on a form and then pass the hWnd of the ComboBox control to the ToolControl. If you want you ToolControl to be more complex such as a ComboBox with a label, you can put the ComboBox and Label in a Frame control or PictureBox control, and then pass the hWnd of the Frame or PictureBox to the ToolControl.

Only one instance of a ToolControl can exist within an application framework at any give time. This
is because the hWnd property is passed a window handle to the control. To prevent a user from dragging two instances of a ToolControl into an application framework set the ICommand::Category property to an empty string. This will prevent the ToolControl from appearing in the customzie dialog.

Specified by:
getHWnd in interface IToolControl
Returns:
The hWnd (A COM typedef)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

onFocus

public void onFocus(ICompletionNotify complete)
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IToolControl
Occurs when the control gains focus.

Supported Platforms

Windows, Solaris, Linux

Description

complete is a reference to a ICompletionNotify object. The ToolControl object uses this complete object to indicate when it's finished.

Remarks

When the ToolControl object gains focus, an ICompletionNotify object is passed to the ToolControl as the complete parameter in the OnFocus method. In your code in the OnFocus method, you would set a variable to the complete object.

The ToolControl needs to call the ICompletionNotify::SetComplete method when it's finished to let the application know that the control should lose focus.

Specified by:
onFocus in interface IToolControl
Parameters:
complete - A reference to a com.esri.arcgis.systemUI.ICompletionNotify (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
See Also:
ICompletionNotify

onDrop

public boolean onDrop(int barType)
               throws java.io.IOException,
                      AutomationException
Description copied from interface: IToolControl
Indicates if the drag-drop operation is valid.

Supported Platforms

Windows, Solaris, Linux

Description

barType specifies which type of commandbar on which this ToolControl can be dropped. Use one of the esriCmdBarType constants.

Remarks

In most cases, a ToolControl should only be used on a toolbar.

Specified by:
onDrop in interface IToolControl
Parameters:
barType - A com.esri.arcgis.systemUI.esriCmdBarType constant (in)
Returns:
The bValid
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriCmdBarType