com.esri.arcgis.framework
Class IAcceleratorProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.framework.IAcceleratorProxy
All Implemented Interfaces:
IAccelerator, Externalizable, Serializable

public class IAcceleratorProxy
extends com.esri.arcgis.interop.Dispatch
implements IAccelerator, Serializable

Provides access to members that define an accelerator.

Description

An accelerator is a mapping between a particular keyboard combination and a command. When you press the combination of keys on the keyboard, the command is executed. For example, Ctrl-C is a well-known accelerator for copying something in Windows. Some commands in the application already have accelerators assigned to them but you can also assign additional accelerators to these commands.

Use the IAcceleratorTable::Add method to create an accelerator.

Remarks

The following example prints the keyboard accelerator assigned to the built-in Copy command. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

See Also:
IAcceleratorTable.getItem(int), IAcceleratorTable.findByKey(int, boolean, boolean, boolean), IAcceleratorTable.add(java.lang.Object, int, boolean, boolean, boolean), Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IAcceleratorProxy()
           
  IAcceleratorProxy(Object obj)
           
protected IAcceleratorProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void delete()
          Removes this accelerator from the accelerator table.
 Object getCommandID()
          The identifier of the command that this accelerator activates.
 int getKey()
          The keycode for this accelerator.
 boolean isAlt()
          Indicates if the Alt key is pressed for this accelerator.
 boolean isCtrl()
          Indicates if the Ctrl key is pressed for this accelerator.
 boolean isShift()
          Indicates if the Shift key is pressed for this accelerator.
 void removeListener(String iidStr, Object theListener)
           
 void setAlt(boolean bAlt)
          Indicates if the Alt key is pressed for this accelerator.
 void setCommandID(Object cmdID)
          The identifier of the command that this accelerator activates.
 void setCtrl(boolean bCtrl)
          Indicates if the Ctrl key is pressed for this accelerator.
 void setKey(int keyCode)
          The keycode for this accelerator.
 void setShift(boolean bShift)
          Indicates if the Shift key is pressed for this accelerator.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IAcceleratorProxy

public IAcceleratorProxy()

IAcceleratorProxy

public IAcceleratorProxy(Object obj)
                  throws IOException
Throws:
IOException

IAcceleratorProxy

protected IAcceleratorProxy(Object obj,
                            String iid)
                     throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

setShift

public void setShift(boolean bShift)
              throws IOException,
                     AutomationException
Indicates if the Shift key is pressed for this accelerator.

Remarks

Use True if the Shift key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

isShift

public boolean isShift()
                throws IOException,
                       AutomationException
Indicates if the Shift key is pressed for this accelerator.

Description



Remarks

Use True if the Shift key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isShift in interface IAccelerator
Returns:
The bShift
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAlt

public void setAlt(boolean bAlt)
            throws IOException,
                   AutomationException
Indicates if the Alt key is pressed for this accelerator.

Remarks

Use True if the Alt key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

isAlt

public boolean isAlt()
              throws IOException,
                     AutomationException
Indicates if the Alt key is pressed for this accelerator.

Remarks

Use True if the Alt key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isAlt in interface IAccelerator
Returns:
The bAlt
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCtrl

public void setCtrl(boolean bCtrl)
             throws IOException,
                    AutomationException
Indicates if the Ctrl key is pressed for this accelerator.

Remarks

Use True if the Ctrl key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

isCtrl

public boolean isCtrl()
               throws IOException,
                      AutomationException
Indicates if the Ctrl key is pressed for this accelerator.

Remarks

Use True if the Ctrl key is one of the keys used in the accelerator; otherwise use False.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isCtrl in interface IAccelerator
Returns:
The bCtrl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setKey

public void setKey(int keyCode)
            throws IOException,
                   AutomationException
The keycode for this accelerator.

Remarks

Use the Visual Basic Key Code constants for the value of Key. For example, the VB Key Code constant vbKeyA would be used for value if your accelerator key is A.

Here is an example of how to set the Key value of an Accelerator to the A key.
anAccelerator.Key = vbKeyA 

Here is an example of how to get the Key value of an Accelerator.
Dim x as Long

x = anAccelerator.Key 

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

getKey

public int getKey()
           throws IOException,
                  AutomationException
The keycode for this accelerator.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getKey in interface IAccelerator
Returns:
The keyCode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCommandID

public void setCommandID(Object cmdID)
                  throws IOException,
                         AutomationException
The identifier of the command that this accelerator activates.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setCommandID in interface IAccelerator
Parameters:
cmdID - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCommandID

public Object getCommandID()
                    throws IOException,
                           AutomationException
The identifier of the command that this accelerator activates.

Description

value specifies the unique identifier of the command. For built-in commands, use the UID. For VBA macros and UIControls, use a string representing the full name of the command.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getCommandID in interface IAccelerator
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

delete

public void delete()
            throws IOException,
                   AutomationException
Removes this accelerator from the accelerator table.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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