|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActionHandler
interface to access user actions and handle them in a global manner. The
handling of user actions is based on enum definitions and the usage of the
enum names. See ApplicationCommandFactory
for details.
ApplicationCommandFactory
Method Summary | |
---|---|
JPopupMenu |
createPopup(Object contextObj)
|
JMenu |
createSubMenu(String cmd)
will be called for any enum, that has the suffix '_sub'. |
void |
enableAction(String key)
enable a single action |
void |
enableAction(String key,
boolean enabled)
enable/disable a single action. |
AbstractAction |
findAction(String composed)
retrieve an action from the action pool. |
AbstractAction |
findAction(String name,
Enum<?> cmd)
retrieve an action from the action pool. |
AbstractAction |
findAction(String name,
String key)
retrieve an action from the action pool. |
AbstractAction |
getAction(String key)
retrieve action for the key. |
Enum<?>[] |
getCommands()
return the (sub-)set of action-enums, that should go into the menuebar. |
String |
getName()
return the name of this handler - usually the same name as the surrounding application. |
Enum<?>[] |
getPopupCommands(Object context)
return the (sub-)set of action-enums, that should form the popup context menue |
Enum<?>[] |
getToolBarCommands()
return the (sub-)set of action-enums, that should be accessible by toolbar buttons |
void |
init()
used to setup all handled actions |
void |
putAction(String key,
AbstractAction action)
save an action into the actions pool |
void |
setEnabled(boolean enable)
enables/disables all actions managed by the related handler |
Method Detail |
---|
JPopupMenu createPopup(Object contextObj)
JMenu createSubMenu(String cmd)
cmd
- the string representation of the enum that triggered the
submenu creation
void enableAction(String key)
key
- the action to enablevoid enableAction(String key, boolean enabled)
key
- the key to identify the actionenabled
- true
to enable, false
to disable an actionAbstractAction findAction(String composed)
Handler.getName()
.Enum.name()
composed
- the key to identify the action
AbstractAction findAction(String name, Enum<?> cmd)
name
- the handlers namecmd
- the action enum to search for
AbstractAction findAction(String name, String key)
name
- the handlers namekey
- the action enum name
AbstractAction getAction(String key)
key
- - the identifier of the action
Enum<?>[] getCommands()
String getName()
Enum<?>[] getPopupCommands(Object context)
context
- the context object to create the popup for. May be null.
Enum<?>[] getToolBarCommands()
void init()
void putAction(String key, AbstractAction action)
key
- - the identifier of the actionaction
- - the action itselfvoid setEnabled(boolean enable)
enable
- - true to enable the actions, false to disable all actions
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |