Modifier and Type | Field and Description |
---|---|
static Action |
BEEP_ACTION
Action that beeps.
|
static Action |
EMPTY_ACTION
Action that does nothing
|
Constructor and Description |
---|
MultiKeymap(String name)
Construct new keymap.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionForKeyStroke(KeyStroke key,
Action a) |
Action |
getAction(KeyStroke key) |
Action[] |
getBoundActions() |
KeyStroke[] |
getBoundKeyStrokes() |
Action |
getDefaultAction()
Get default action of this keymap or parent keymap if this
one doesn't have one.
|
KeyStroke[] |
getKeyStrokesForAction(Action a) |
String |
getName() |
Keymap |
getResolveParent() |
boolean |
isLocallyDefined(KeyStroke key) |
void |
load(JTextComponent.KeyBinding[] bindings,
Action[] actions)
Loads the key to action mappings into this keymap in similar way
as JTextComponent.loadKeymap() does.
|
void |
load(JTextComponent.KeyBinding[] bindings,
Map actions)
Loads key to action mappings into this keymap
|
void |
removeBindings() |
void |
removeKeyStrokeBinding(KeyStroke key) |
void |
resetContext()
Reset keymap to base context
|
void |
setContextKeyNotFoundAction(Action a)
What to do when key is not resolved for context
|
void |
setDefaultAction(Action a) |
void |
setResolveParent(Keymap parent) |
String |
toString() |
public static final Action EMPTY_ACTION
public static final Action BEEP_ACTION
public MultiKeymap(String name)
name
- name of new keymappublic void resetContext()
public void setContextKeyNotFoundAction(Action a)
public void load(JTextComponent.KeyBinding[] bindings, Action[] actions)
public void load(JTextComponent.KeyBinding[] bindings, Map actions)
bindings
- array of bindingsactions
- map of [action_name, action] pairspublic Action getDefaultAction()
getDefaultAction
in interface Keymap
public void setDefaultAction(Action a)
setDefaultAction
in interface Keymap
public KeyStroke[] getBoundKeyStrokes()
getBoundKeyStrokes
in interface Keymap
public Action[] getBoundActions()
getBoundActions
in interface Keymap
public KeyStroke[] getKeyStrokesForAction(Action a)
getKeyStrokesForAction
in interface Keymap
public boolean isLocallyDefined(KeyStroke key)
isLocallyDefined
in interface Keymap
public void addActionForKeyStroke(KeyStroke key, Action a)
addActionForKeyStroke
in interface Keymap
public void removeKeyStrokeBinding(KeyStroke key)
removeKeyStrokeBinding
in interface Keymap
public void removeBindings()
removeBindings
in interface Keymap
public Keymap getResolveParent()
getResolveParent
in interface Keymap
public void setResolveParent(Keymap parent)
setResolveParent
in interface Keymap