|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.commons.gui.shortcut.AbstractShortcut org.xnap.commons.gui.shortcut.ActionShortcut
public class ActionShortcut
Provides an action based shortcut.
The action has to provide several values to make use of the shortcut.
It must provide the following values:
Action.ACTION_COMMAND_KEY, the preferences key
It should provide values for the following keys:
Field Summary |
---|
Fields inherited from interface org.xnap.commons.gui.shortcut.Shortcut |
---|
CATEGORY, DESCRIPTION, KEYSTROKE |
Constructor Summary | |
---|---|
ActionShortcut(Action action)
|
|
ActionShortcut(Action action,
JComponent c)
|
Method Summary | |
---|---|
void |
addComponent(JComponent c,
Action a)
Installs the action into the action map of the component and sets up the shortcut mapping. |
Action |
getAction()
|
JMenuItem |
getMenuItem()
|
int |
getNumberOfComponents()
Returns the number of components this shortcut is registered upon. |
void |
removeComponent(JComponent c)
Removes the action mapping from the given component and removes it from its list of components. |
void |
setKeyStroke(KeyStroke stroke)
|
void |
setMenuItem(JMenuItem menuItem)
|
Methods inherited from class org.xnap.commons.gui.shortcut.AbstractShortcut |
---|
addPropertyChangeListener, firePropertChange, getKeyStroke, getValue, putValue, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionShortcut(Action action, JComponent c)
public ActionShortcut(Action action)
Method Detail |
---|
public void addComponent(JComponent c, Action a)
public JMenuItem getMenuItem()
public Action getAction()
public void setMenuItem(JMenuItem menuItem)
public void removeComponent(JComponent c)
c
- the component this shortcuts is registered onpublic int getNumberOfComponents()
public void setKeyStroke(KeyStroke stroke)
setKeyStroke
in interface Shortcut
setKeyStroke
in class AbstractShortcut
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |