Extension SDK

oracle.ide.keyboard
Class KeyUtil

java.lang.Object
  extended byoracle.ide.keyboard.KeyUtil

public final class KeyUtil
extends java.lang.Object

Some generic methods related to KeyEvents and KeyStrokes.


Constructor Summary
KeyUtil()
           
 
Method Summary
static java.lang.String getAcceleratorTooltip(int cmdID)
           
static boolean isActionKey(javax.swing.KeyStroke ks)
          Only the KeyEvent knows what is an action key, the KeyStroke does not.
static boolean isModifierKey(int keyCode)
          Determines if the key is a modifier (Ctrl, Shift, ...)
static boolean isModifierKey(javax.swing.KeyStroke keyStroke)
          Determines if the key is a modifier (Ctrl, Shift, ...)
static void removeKeyStrokesFromInputMap(javax.swing.JComponent component, javax.swing.KeyStroke[] keyStrokes, int mapType)
          Remove all mappings bound to the specified set of KeyStrokes for the InputMap of the specified type that is associated with the specified JComponent.
static void removeKeyStrokesFromInputMaps(javax.swing.JComponent component, javax.swing.KeyStroke[] keyStrokes)
          Remove all mappings bound to the specified set of KeyStrokes for each InputMap that is associated with the specified JComponent.
static java.lang.String toString(javax.swing.KeyStroke ks)
          Returns a user readable version of the keystroke like "Ctrl+K".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyUtil

public KeyUtil()
Method Detail

toString

public static java.lang.String toString(javax.swing.KeyStroke ks)
Returns a user readable version of the keystroke like "Ctrl+K".

Parameters:
ks - the keystroke
Returns:
the text

isActionKey

public static boolean isActionKey(javax.swing.KeyStroke ks)
Only the KeyEvent knows what is an action key, the KeyStroke does not.


isModifierKey

public static boolean isModifierKey(int keyCode)
Determines if the key is a modifier (Ctrl, Shift, ...)


isModifierKey

public static boolean isModifierKey(javax.swing.KeyStroke keyStroke)
Determines if the key is a modifier (Ctrl, Shift, ...)


removeKeyStrokesFromInputMaps

public static void removeKeyStrokesFromInputMaps(javax.swing.JComponent component,
                                                 javax.swing.KeyStroke[] keyStrokes)
Remove all mappings bound to the specified set of KeyStrokes for each InputMap that is associated with the specified JComponent.


removeKeyStrokesFromInputMap

public static void removeKeyStrokesFromInputMap(javax.swing.JComponent component,
                                                javax.swing.KeyStroke[] keyStrokes,
                                                int mapType)
Remove all mappings bound to the specified set of KeyStrokes for the InputMap of the specified type that is associated with the specified JComponent.

The mapType parameter should be one of the following values:


getAcceleratorTooltip

public static java.lang.String getAcceleratorTooltip(int cmdID)
Parameters:
cmdID - the ID of a command present in the global keymap
Returns:
the accelerator string of the specified command

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.