|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.user.ui.KeyBindings
public class KeyBindings
The KeyBindings object holds information about an action's key bindings. There can be 0 or more default bindings which are set by the program. There can be 0 or more user defined bindings which are stored as preferences by the KeyBindingManager. Finally, there is a set of action listeners that get activated when the action occurs.
The action can also be disabled/enabled.
Constructor Summary | |
---|---|
KeyBindings(java.lang.String actionDesc)
Constructs a new KeyBinding. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Perform all registered actions |
void |
addActionListener(java.awt.event.ActionListener a)
Add an action listener. |
void |
addDefaultKeyBinding(javax.swing.KeyStroke prefixStroke,
javax.swing.KeyStroke stroke)
Add a one or two-stroke key binding to the default bindings list |
void |
addDefaultKeyBinding(KeyStrokePair k)
Add a key stroke pair to the default bindings list |
void |
addKeyBinding(javax.swing.KeyStroke prefixStroke,
javax.swing.KeyStroke stroke)
Add a one or two-stroke key binding. |
void |
addKeyBinding(KeyStrokePair k)
Add a key stroke pair |
void |
addKeyBindings(java.lang.String str)
Add key bindings. |
java.lang.String |
bindingsToString()
Convert key bindings to a string |
void |
clearKeyBindings()
Clear all active bindings |
java.lang.String |
describe()
|
java.lang.String |
getActionDesc()
Get the action description that describes this key binding |
java.util.Iterator |
getActionListeners()
Get an iterator over the actionListeners |
java.util.Iterator<KeyStrokePair> |
getDefaultKeyStrokePairs()
Get an iterator over the default key stroke pairs |
boolean |
getEnabled()
|
java.util.Iterator<KeyStrokePair> |
getKeyStrokePairs()
Get an iterator over the user key stroke pairs |
boolean |
getUsingDefaultKeys()
|
void |
removeActionListener(java.awt.event.ActionListener a)
Remove an action listener |
void |
removeKeyBinding(KeyStrokePair k)
Removes a key binding |
void |
setEnabled(boolean b)
|
void |
setEventSource(java.lang.Object source)
Set the object that will used as the "source" when the actions in this KeyBindings object are activated. |
void |
setUsingDefaultKeys(boolean b)
Set the value of usingDefaultKeys. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyBindings(java.lang.String actionDesc)
actionDesc
- description of the key binding to show to the userMethod Detail |
---|
public void addKeyBinding(javax.swing.KeyStroke prefixStroke, javax.swing.KeyStroke stroke)
prefixStroke
- optional prefix stroke. may be nullstroke
- required strokepublic void addKeyBinding(KeyStrokePair k)
k
- the key stroke pairpublic void addKeyBindings(java.lang.String str)
KeyBindings.sep
.
str
- string representing a list of key stroke pairs.public void removeKeyBinding(KeyStrokePair k)
k
- the key stroke pair to removepublic void addDefaultKeyBinding(javax.swing.KeyStroke prefixStroke, javax.swing.KeyStroke stroke)
prefixStroke
- optional prefix stroke. may be nullstroke
- required strokepublic void addDefaultKeyBinding(KeyStrokePair k)
k
- the key stroke pairpublic void clearKeyBindings()
public void addActionListener(java.awt.event.ActionListener a)
a
- the action listener to addpublic void removeActionListener(java.awt.event.ActionListener a)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the ActionEventpublic java.lang.String bindingsToString()
public java.lang.String describe()
public java.lang.String getActionDesc()
public java.util.Iterator getActionListeners()
public java.util.Iterator<KeyStrokePair> getKeyStrokePairs()
public java.util.Iterator<KeyStrokePair> getDefaultKeyStrokePairs()
public void setEventSource(java.lang.Object source)
source
- the object to be set as the source of the event passed
to the actionListeners on activation.public void setUsingDefaultKeys(boolean b)
b
- true if using default keys, false otherwisepublic boolean getUsingDefaultKeys()
public void setEnabled(boolean b)
public boolean getEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |