com.esri.arcgis.framework
Class Accelerator

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

public class Accelerator
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAccelerator

Accelerator object.

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.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
Accelerator(Object obj)
          Construct a Accelerator using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 void delete()
          Removes this accelerator from the accelerator table.
 boolean equals(Object o)
          Compare this object with another
 Object getCommandID()
          The identifier of the command that this accelerator activates.
 int getKey()
          The keycode for this accelerator.
 int hashCode()
          the hashcode for this object
 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 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 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

Accelerator

public Accelerator(Object obj)
            throws IOException
Construct a Accelerator using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Accelerator.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
Accelerator o = (Accelerator)obj; // will not work

Accelerator o = new Accelerator(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems Accelerator theAccelerator = (Accelerator) obj;
Method Detail

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

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.