com.esri.arcgis.framework
Class AcceleratorTable

java.lang.Object
  extended by com.esri.arcgis.framework.AcceleratorTable
All Implemented Interfaces:
IAcceleratorTable, com.esri.arcgis.interop.RemoteObjRef, IPersist, IPersistStream, Externalizable, Serializable

public class AcceleratorTable
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAcceleratorTable, IPersist, IPersistStream, Externalizable

Accelerator Table 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.

The AcceleratorTable is an object with a list of accelerator keys and the command identifiers associated with them. You can get a reference to the AcceleratorTable of a document using the IDocument.Accelerators property.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
IAccelerator, Serialized Form

Constructor Summary
AcceleratorTable(Object obj)
          Construct a AcceleratorTable using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean add(Object iD, int key, boolean bCtrl, boolean bAlt, boolean bShift)
          Adds a new accelerator to the accelerator table.
 boolean equals(Object o)
          Compare this object with another
 IArray find(Object iD)
          Finds the accelerator object/s currently associated with the specified command ID.
 IAccelerator findByKey(int key, boolean bCtrl, boolean bAlt, boolean bShift)
          Finds the accelerator object associated with the specified key combination.
 void getClassID(GUID[] pClassID)
          getClassID
 int getCount()
          The count of accelerator items in the table.
 IAccelerator getItem(int index)
          The accelerator object at the specified index.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 int hashCode()
          the hashcode for this object
 void isDirty()
          isDirty
 void load(IStream pstm)
          load
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void writeExternal(ObjectOutput out)
           
 
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

AcceleratorTable

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

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

Throws:
IOException - if there are interop problems AcceleratorTable theAcceleratorTable = (AcceleratorTable) 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

getCount

public int getCount()
             throws IOException,
                    AutomationException
The count of accelerator items in the table.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getCount in interface IAcceleratorTable
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

public IAccelerator getItem(int index)
                     throws IOException,
                            AutomationException
The accelerator object at the specified index.

Product Availability

Available with ArcGIS Desktop.

Specified by:
getItem in interface IAcceleratorTable
Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.framework.IAccelerator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

add

public boolean add(Object iD,
                   int key,
                   boolean bCtrl,
                   boolean bAlt,
                   boolean bShift)
            throws IOException,
                   AutomationException
Adds a new accelerator to the accelerator table.

Description

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


Key specifies the keycode used for this accelerator. Use the Visual Basic Key Code constants for the value of Key.


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


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


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

Remarks

In VBA, you can use the builtin ArcID module to find the unique identifier for a particular command.

In the following example, the keyboard accelerator CTRL+A is assigned to the built-in ArcMap Add Data command. You would get m_app from the hook in ICommand::OnCreate() .

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
add in interface IAcceleratorTable
Parameters:
iD - A Variant (in)
key - The key (in)
bCtrl - The bCtrl (in, optional, pass false if not required)
bAlt - The bAlt (in, optional, pass false if not required)
bShift - The bShift (in, optional, pass false if not required)
Returns:
The bSucceeded
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IAccelerator

find

public IArray find(Object iD)
            throws IOException,
                   AutomationException
Finds the accelerator object/s currently associated with the specified command ID.

Description


ID specifies the unique identifier of a 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:
find in interface IAcceleratorTable
Parameters:
iD - A Variant (in)
Returns:
A reference to a com.esri.arcgis.system.IArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findByKey

public IAccelerator findByKey(int key,
                              boolean bCtrl,
                              boolean bAlt,
                              boolean bShift)
                       throws IOException,
                              AutomationException
Finds the accelerator object associated with the specified key combination.

Description


Key The keycode used for this accelerator.


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


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


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

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
findByKey in interface IAcceleratorTable
Parameters:
key - The key (in)
bCtrl - The bCtrl (in, optional, pass false if not required)
bAlt - The bAlt (in, optional, pass false if not required)
bShift - The bShift (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.framework.IAccelerator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IAccelerator

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException