|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.swing18.I18Dispatcher
public abstract class I18Dispatcher
A dispatcher object maintains a collection of I18Action
s
encapsulating the behaviour of GUI buttons and menu items.
Constructor Summary | |
---|---|
I18Dispatcher()
|
Method Summary | |
---|---|
void |
addMenu(java.lang.String actionID)
Add a new menu to the menu bar. |
void |
addMenuItem(java.lang.String menuActionID,
int idx,
java.lang.String itemActionID)
Add a new item to an existing menu. |
void |
addMenuItem(java.lang.String menuActionID,
java.lang.String itemActionID)
Add a new item to an existing menu. |
protected abstract I18Action |
createAction(java.lang.String actionID,
java.lang.Object target,
java.lang.String methodName,
int special)
Create an I18Action subclass instance suited to this dispatcher. |
I18Action |
getAction(java.lang.String actionID)
Retrieve an action object based on its ID. |
I18Action[] |
getMenu(java.lang.String menuActionID)
Return list of actions encapsulating a specified menu. |
java.lang.String[] |
getMenus()
Return the list of menu action IDs. |
void |
putAction(java.lang.String menuActionID,
int idx,
java.lang.String actionID,
java.lang.Object target,
java.lang.String methodName,
int special)
Add a new action to the collection, at a given point within a given menu. |
void |
putAction(java.lang.String actionID,
java.lang.Object target,
java.lang.String methodName,
int special)
Add a new action to the collection. |
void |
putAction(java.lang.String menuActionID,
java.lang.String actionID,
java.lang.Object target,
java.lang.String methodName,
int special)
Add a new action to the collection, within a given menu. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public I18Dispatcher()
Method Detail |
---|
public void putAction(java.lang.String actionID, java.lang.Object target, java.lang.String methodName, int special)
actionID
- The unique ID string for this action. This is used as
the base for several related I18N strings and must obey the conventions
laid down in ccs.utils.MsgHelper
. .target
- The object containing the method that should be called when
this action happens. If null, the action won't do anything.methodName
- the name of the method of target to be called when the
action happens. The method must be accessible and must be declared by the
class of target
directly (not inherited). The required signature
and other behaviour of the method is governed by the I18Action
subclass instance created by your implementation of createAction
.special
- Zero, or the action's "specialisation". This is used to flag
modified signature or exception-throwing behaviour of the invoked method.
Your subclasses may use this, or not.protected abstract I18Action createAction(java.lang.String actionID, java.lang.Object target, java.lang.String methodName, int special)
(ctor).
public void putAction(java.lang.String menuActionID, java.lang.String actionID, java.lang.Object target, java.lang.String methodName, int special)
menuActionID
- The action ID for the menu to add this to.actionID
- The unique ID string for this action. This is used as
the base for several related I18N strings and must obey the conventions
laid down in ccs.utils.MsgHelper
. Specifically, all actionIDs
should begin with 'G'; Menu items will begin "GM", GUI buttons "GB",
items on dialogs "GD", buttons on dialogs "GDB".target
- The object containing the method that should be called when
this action happens. If null, the action won't do anything.methodName
- the name of the method of target to be called when the
action happens. The method must be accessible and must be declared by the
class of target
directly (not inherited). The required signature
and other behaviour of the method is governed by the I18Action
subclass instance created by your implementation of createAction
.special
- Zero, or the action's "specialisation". This is used to flag
modified signature or exception-throwing behaviour of the invoked method.
Your subclasses may use this, or not.public void putAction(java.lang.String menuActionID, int idx, java.lang.String actionID, java.lang.Object target, java.lang.String methodName, int special)
menuActionID
- The action ID for the menu to add this to.idx
- The position within the menu at which to add the action.actionID
- The unique ID string for this action. This is used as
the base for several related I18N strings and must obey the conventions
laid down in ccs.utils.MsgHelper
. Specifically, all actionIDs
should begin with 'G'; Menu items will begin "GM", GUI buttons "GB",
items on dialogs "GD", buttons on dialogs "GDB".target
- The object containing the method that should be called when
this action happens. If null, the action won't do anything.methodName
- the name of the method of target to be called when the
action happens. The method must be accessible and must be declared by the
class of target
directly (not inherited). The required signature
and other behaviour of the method is governed by the I18Action
subclass instance created by your implementation of createAction
.special
- Zero, or the action's "specialisation". This is used to flag
modified signature or exception-throwing behaviour of the invoked method.
Your subclasses may use this, or not.public I18Action getAction(java.lang.String actionID)
public void addMenu(java.lang.String actionID)
actionID
- The actionID of the action representing the menu. The action
must have been added already using putAction
.public void addMenuItem(java.lang.String menuActionID, java.lang.String itemActionID)
menuActionID
- The actionID of the action representing the menu.itemActionID
- The actionID of the action encapsulating the menu ID,
or null to add a separator to the menu.
The action must have been added already using putAction
.public void addMenuItem(java.lang.String menuActionID, int idx, java.lang.String itemActionID)
menuActionID
- The actionID of the action representing the menu.idx
- Where to insert the item.itemActionID
- The actionID of the action encapsulating the menu ID,
or null to add a separator to the menu.
The action must have been added already using putAction
.public java.lang.String[] getMenus()
public I18Action[] getMenu(java.lang.String menuActionID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |