com.jidesoft.shortcut
Class KeyboardShortcut
java.lang.Object
com.jidesoft.shortcut.Shortcut
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
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)
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.