|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fife.ui.app.ActionRegistry
public class ActionRegistry
A mapping of keys to actions. Instances of
AbstractGUIApplication
use this class to keep track of their
actions, and to simply loading and saving their customized shortcuts.
Constructor Summary | |
---|---|
ActionRegistry()
|
Method Summary | |
---|---|
void |
addAction(java.lang.String key,
javax.swing.Action action)
Adds an action to this action registry. |
javax.swing.Action |
getAction(java.lang.String key)
Returns an action by its key. |
java.util.SortedSet<java.lang.String> |
getActionKeys()
Returns the list of keys of all actions known to this registry. |
javax.swing.Action[] |
getActions()
Returns all actions as an array. |
void |
loadShortcuts(java.io.File file)
Loads shortcuts for the actions from a file. |
void |
saveShortcuts(java.io.File file)
Saves the shortcuts of all actions in this registry to a properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionRegistry()
Method Detail |
---|
public void addAction(java.lang.String key, javax.swing.Action action)
key
- The key with which to fetch the action via
getAction
.action
- The action to add.getAction(String)
public javax.swing.Action getAction(java.lang.String key)
null
if no action exists for the
specified key.addAction(String, Action)
,
getActions()
public java.util.SortedSet<java.lang.String> getActionKeys()
public javax.swing.Action[] getActions()
getAction(String)
public void loadShortcuts(java.io.File file) throws java.io.IOException
KeyStroke
s to use for action accelerators.
If any property key doesn't have a corresponding action in this registry,
it is ignored. If any property value isn't a valid
KeyStroke
, it is ignored.
file
- The properties file to load.
java.io.IOException
- If an IO error occurs reading the file.saveShortcuts(File)
public void saveShortcuts(java.io.File file) throws java.io.IOException
KeyStroke
s for the shortcuts for each action. Actions
with no shortcut will have an empty string value for their property.
file
- The file to save to.
java.io.IOException
- If an IO error occurs writing the file.loadShortcuts(File)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |