|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schwarzrot.ui.action.support.AbstractActionHandler
public abstract class AbstractActionHandler
class to handle user-actions and to allow access to defined actions. The class has a static repository, where all ActionHandler register their actions and so it is possible to find an Action from an unknown but active ActionHandler.
| Field Summary | |
|---|---|
protected static CommandFactoryBuilder |
facBuilder
|
| Constructor Summary | |
|---|---|
AbstractActionHandler(String name)
|
|
| Method Summary | |
|---|---|
JToolBar |
createExtraToolBar()
|
JPopupMenu |
createPopup(Object context)
|
JPopupMenu |
createPopup(Object context,
Enum<?>[][] cmdList)
|
JMenu |
createSubMenu(Enum<?> cmd)
|
JMenu |
createSubMenu(String cmd)
will be called for any enum, that has the suffix '_sub'. |
JToolBar |
createToolBar(Enum<?>[] commands,
int orientation)
|
void |
enableAction(String key)
enable a single action by identifier |
void |
enableAction(String key,
boolean enabled)
enable/disable a single action by identifier |
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<?>[] |
getExtraToolBarCommands()
|
String |
getName()
return the name of this handler - usually the same name as the surrounding application. |
void |
init()
used to setup all handled actions |
void |
init(Object context)
|
void |
putAction(String key,
AbstractAction action)
save an action into the actions pool |
void |
setEnabled(boolean enable)
enable/disable all actions related to the handler. |
void |
setName(String name)
|
void |
setupAction(Application<?> app,
Enum<?> cmd,
AbstractActionCallback cb)
|
void |
setupAction(Application<?> app,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
the major reason for ActionHandler: have a central place to customize actions and action related components. |
void |
setupAction(String appID,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic)
|
void |
setupAction(String appID,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
|
void |
setupAction(String appID,
String actionKey,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.schwarzrot.ui.action.ActionHandler |
|---|
getCommands, getPopupCommands, getToolBarCommands |
| Field Detail |
|---|
protected static CommandFactoryBuilder facBuilder
| Constructor Detail |
|---|
public AbstractActionHandler(String name)
| Method Detail |
|---|
public JToolBar createExtraToolBar()
public JPopupMenu createPopup(Object context)
createPopup in interface ActionHandler
public JPopupMenu createPopup(Object context,
Enum<?>[][] cmdList)
public final JMenu createSubMenu(Enum<?> cmd)
public JMenu createSubMenu(String cmd)
ActionHandler
createSubMenu in interface ActionHandlercmd - the string representation of the enum that triggered the
submenu creation
public JToolBar createToolBar(Enum<?>[] commands,
int orientation)
public void enableAction(String key)
enableAction in interface ActionHandlerkey -
public void enableAction(String key,
boolean enabled)
enableAction in interface ActionHandlerkey - enabled - public AbstractAction findAction(String composed)
ActionHandlerHandler.getName().Enum.name()
findAction in interface ActionHandlercomposed - the key to identify the action
public AbstractAction findAction(String name,
Enum<?> cmd)
ActionHandler
findAction in interface ActionHandlername - the handlers namecmd - the action enum to search for
public AbstractAction findAction(String name,
String key)
ActionHandler
findAction in interface ActionHandlername - the handlers namekey - the action enum name
public AbstractAction getAction(String key)
ActionHandler
getAction in interface ActionHandlerkey - - the identifier of the action
public Enum<?>[] getExtraToolBarCommands()
public final String getName()
ActionHandler
getName in interface ActionHandlerpublic void init()
ActionHandler
init in interface ActionHandlerpublic void init(Object context)
public void putAction(String key,
AbstractAction action)
ActionHandler
putAction in interface ActionHandlerkey - - the identifier of the actionaction - - the action itselfpublic void setEnabled(boolean enable)
setEnabled in interface ActionHandlerenable - public final void setName(String name)
public void setupAction(Application<?> app,
Enum<?> cmd,
AbstractActionCallback cb)
public void setupAction(Application<?> app,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
cmd - - the enum identifier for the actioncb - - the anonymous callbackmnemonic - - a mnemonic key
public void setupAction(String appID,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic)
public void setupAction(String appID,
Enum<?> cmd,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
public void setupAction(String appID,
String actionKey,
AbstractActionCallback cb,
int mnemonic,
AccessMode mode)
|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||