public class MultiKeyBinding extends JTextComponent.KeyBinding implements Externalizable
Modifier and Type | Field and Description |
---|---|
KeyStroke[] |
keys
Successive keystroke.
|
actionName, key
Constructor and Description |
---|
MultiKeyBinding()
Constructor for serialization
|
MultiKeyBinding(JTextComponent.KeyBinding kb)
Constructor for existing KeyBinding
|
MultiKeyBinding(KeyStroke[] keys,
String actionName)
Constructor for assigning keystroke sequence to action
|
MultiKeyBinding(KeyStroke key,
String actionName)
Compatibility constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
void |
readExternal(ObjectInput in) |
String |
toString() |
static void |
updateKeyBindings(JTextComponent.KeyBinding[] target,
JTextComponent.KeyBinding[] changes)
Add or replace key bindings array by changes given in
the second bindings array
|
void |
writeExternal(ObjectOutput out) |
public KeyStroke[] keys
public MultiKeyBinding()
public MultiKeyBinding(KeyStroke[] keys, String actionName)
keys
- successive keystroke that must be pressed in order
to invoke actionactionName
- action that will be invoked. Action is resolved
from name by calling kit.getActions() after the kit is constructedpublic MultiKeyBinding(JTextComponent.KeyBinding kb)
public static void updateKeyBindings(JTextComponent.KeyBinding[] target, JTextComponent.KeyBinding[] changes)
target
- target list of bindingschanges
- list of changes to apply:
binding containing the non-null keystroke(s) and non-null action
will add the binding or replace the old binding with the same
keystroke(s) in the target array,
binding of the non-null keystroke(s) and null action removes
the binding for that keystroke from the target array (if it existed)
binding containing null keystroke and non-null action adds
or replaces default actionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Built on August 30 2023. | Copyright © 2017-2023 Apache Software Foundation. All Rights Reserved.