JIDE 3.5.15

com.jidesoft.shortcut
Class KeyboardShortcut

java.lang.Object
  extended by com.jidesoft.shortcut.Shortcut
      extended by com.jidesoft.shortcut.KeyboardShortcut
All Implemented Interfaces:
Serializable, Cloneable

public class KeyboardShortcut
extends Shortcut

KeyboardShortcut represents a kind of shortcuts that triggered by keyboard. It can be one keystroke such as ctrl+c or several keystrokes such ctrl+x followed ctrl+c (to exit Emacs).

See Also:
Serialized Form

Constructor Summary
KeyboardShortcut()
           
KeyboardShortcut(KeyEvent e)
           
KeyboardShortcut(KeyStroke keyStroke)
           
KeyboardShortcut(KeyStroke[] keyStrokes)
           
KeyboardShortcut(KeyStroke[] keyStrokes, String context)
           
KeyboardShortcut(KeyStroke keyStroke, String context)
           
 
Method Summary
 void addKeyStroke(KeyStroke keyStroke)
           
 void clear()
           
static String convertFromMacOSX(String shortcut)
          Converts the shortcut string from MacOSX type of shortcut.
 Shortcut convertToMacOSX()
          Converts the shortcut for Mac OS X.
static String convertToMacOSX(String shortcut)
          Converts the shortcut string to MacOSX type of shortcut.
 boolean equals(Object o)
           
 int getCount()
           
 KeyStroke[] getKeyStrokes()
           
static String getKeyStrokeString(KeyStroke keyStroke)
           
 int hashCode()
           
static KeyStroke parseKeyStroke(String s)
           
 void removeLastKeyStroke()
           
 String toString()
           
 
Methods inherited from class com.jidesoft.shortcut.Shortcut
clone, getContext, getIcon, getName, setContext, setIcon, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyboardShortcut

public KeyboardShortcut()

KeyboardShortcut

public KeyboardShortcut(KeyStroke keyStroke)

KeyboardShortcut

public KeyboardShortcut(KeyStroke keyStroke,
                        String context)

KeyboardShortcut

public KeyboardShortcut(KeyStroke[] keyStrokes)

KeyboardShortcut

public KeyboardShortcut(KeyStroke[] keyStrokes,
                        String context)

KeyboardShortcut

public KeyboardShortcut(KeyEvent e)
Method Detail

getKeyStrokes

public KeyStroke[] getKeyStrokes()

addKeyStroke

public void addKeyStroke(KeyStroke keyStroke)

removeLastKeyStroke

public void removeLastKeyStroke()

clear

public void clear()

getCount

public int getCount()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Shortcut

hashCode

public int hashCode()
Overrides:
hashCode in class Shortcut

parseKeyStroke

public static KeyStroke parseKeyStroke(String s)

getKeyStrokeString

public static String getKeyStrokeString(KeyStroke keyStroke)

convertToMacOSX

public Shortcut convertToMacOSX()
Converts the shortcut for Mac OS X.

Returns:
a shortcut for Mac OS X.

convertToMacOSX

public static String convertToMacOSX(String shortcut)
Converts the shortcut string to MacOSX type of shortcut. The different is Mac OS X uses "meta" to replace "control" key as on other operating systems.

Parameters:
shortcut - the shortcut string.
Returns:
the shortcut string for Mac OS X.

convertFromMacOSX

public static String convertFromMacOSX(String shortcut)
Converts the shortcut string from MacOSX type of shortcut. The different is Mac OS X uses "meta" to replace "control" key as on other operating systems.

Parameters:
shortcut - the shortcut string for Mac OS X.
Returns:
the shortcut string for non-Mac OS X.

JIDE 3.5.15