Package docking
Class DockingKeyBindingAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- docking.DockingKeyBindingAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
MultipleKeyAction
public class DockingKeyBindingAction extends javax.swing.AbstractAction
A class that can be used as an interface for using actions associated with keybindings. This class is meant to only by used by internal Ghidra key event processing.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.KeyStroke
keyStroke
protected DockingWindowManager
winMgr
-
Constructor Summary
Constructors Constructor Description DockingKeyBindingAction(DockingWindowManager winMgr, DockingActionIf action, javax.swing.KeyStroke keyStroke)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
KeyBindingPrecedence
getKeyBindingPrecedence()
protected ActionContext
getLocalContext(ComponentProvider localProvider)
boolean
isEnabled()
boolean
isReservedKeybindingPrecedence()
static javax.swing.KeyStroke
parseKeyStroke(java.lang.String keyStroke)
Parses the given text into a KeyStroke.static java.lang.String
parseKeyStroke(javax.swing.KeyStroke keyStroke)
Convert the toString() form of the keyStroke.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
keyStroke
protected javax.swing.KeyStroke keyStroke
-
winMgr
protected final DockingWindowManager winMgr
-
-
Constructor Detail
-
DockingKeyBindingAction
public DockingKeyBindingAction(DockingWindowManager winMgr, DockingActionIf action, javax.swing.KeyStroke keyStroke)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfacejavax.swing.Action
- Overrides:
isEnabled
in classjavax.swing.AbstractAction
-
isReservedKeybindingPrecedence
public boolean isReservedKeybindingPrecedence()
-
getKeyBindingPrecedence
public KeyBindingPrecedence getKeyBindingPrecedence()
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
getLocalContext
protected ActionContext getLocalContext(ComponentProvider localProvider)
-
parseKeyStroke
public static java.lang.String parseKeyStroke(javax.swing.KeyStroke keyStroke)
Convert the toString() form of the keyStroke.
In Java 1.4.2 & earlier, Ctrl-M is returned as "keyCode CtrlM-P" and we want it to look like: "Ctrl-M".
In Java 1.5.0, Ctrl-M is returned as "ctrl pressed M" and we want it to look like: "Ctrl-M".
-
parseKeyStroke
public static javax.swing.KeyStroke parseKeyStroke(java.lang.String keyStroke)
Parses the given text into a KeyStroke. This method relies uponKeyStroke.getKeyStroke(String)
for parsing. Before making that call, this method will perform fixup on the given text for added flexibility. For example, the given text may contain spaces or dashes as the separators between parts in the string. Also, the text is converted such that it is not case-sensitive. So, the following example formats are allowed:Alt-F alt p Ctrl-Alt-Z ctrl Z
- Parameters:
keyStroke
-- Returns:
-
-