|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--au.edu.swin.synergy.kernel.BCommandEvent | +--au.edu.swin.synergy.plugin.mod13.event.BWindowCE | +--au.edu.swin.synergy.plugin.mod13.event.BAddMenuCE
Add menu allows you to add an entire JMenu of components to the menu bar. It is recommended that you use BAddMenuItem instead and simply specify the name of the menu you want it to go in since adding an entire JMenu results in taking everything out of it and adding it to a BAddMenuItemCE event anyway.
The reason for this is because if two Menus exist, it needs to be merged into one in which case the specified location will be ignored and the existing location will be used and custom menu items may be lost.
For similar reasons there is no associated BRemoveMenuCE. Because the names of the menus can coincide with other plugins naming conventions, we can't assume that the plugin that initially created the menu is the only one that has items in it. Therefore, to remove a menu, the plugin must place all of the menu items in a BRemoveMenuItemCE and send that to the kernel.
This way if it is the only plugin with items in the menu, the menu will be removed, if not, the other plugins menu items will stay
If the menu doesn't exist it will simply be added as normal in the specified location.
Field Summary | |
static int |
kAlwaysRightAligned
Using this policy will ensure that the menu is right aligned. |
static int |
kNormalPolicy
Using this location policy, the menu added will go after all the existing menus, but before the menus with the kAlwaysRightAligned policy. |
Fields inherited from class au.edu.swin.synergy.kernel.BCommandEvent |
connectionID,
index,
kBroadcast,
kClient,
kClientDone,
kLocal,
kServer,
kServerDone,
networkStatus,
serialVersionUID |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary | |
BAddMenuCE(Object source,
BString menuName,
JMenu fMenu)
Creates a new add menu ce with the default location policy. |
|
BAddMenuCE(Object source,
BString menuName,
JMenu fMenu,
int locationPolicy)
Creates a new add menu event with the specified location policy. |
Method Summary | |
int |
getLocationPolicy()
This will return the requested location policy for this menu. |
JMenu |
getMenu()
Please complete the missing tags for getMenu |
BString |
getMenuName()
Gets the locale sensitive name of this menu |
BString |
getPreferredMnemonic()
This will return the preferred mnemonic for this menu. |
void |
setPreferredMnemonic(BString preferredMnemonic)
You can set the mnemonic you prefer for this menu here. |
Methods inherited from class au.edu.swin.synergy.kernel.BCommandEvent |
decrementThreadCount,
doComplete,
doInit,
getAutoComplete,
getCompletionObject,
getCompletionStatus,
getConnectionID,
getIndex,
getNetworkStatus,
getPipe,
getUndoable,
setAutoComplete,
setCompletionObject,
setCompletionStatus,
setConnectionID,
setIndex,
setNetworkStatus,
setPipe,
setThreadCount,
setUndoable |
Methods inherited from class java.util.EventObject |
getSource,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int kAlwaysRightAligned
public static final int kNormalPolicy
Constructor Detail |
public BAddMenuCE(Object source, BString menuName, JMenu fMenu)
source
- The source of the eventfMenu
- The menu to add to the menu bartpublic BAddMenuCE(Object source, BString menuName, JMenu fMenu, int locationPolicy)
source
- The source of the eventmenuName
- The locale sensitive name of the menufMenu
- The menu to add to the menu bartlocationPolicy
- The location policy for the menu kAlwaysRightAligned, kNormalPolicyMethod Detail |
public BString getMenuName()
public JMenu getMenu()
- public int getLocationPolicy()
public void setPreferredMnemonic(BString preferredMnemonic)
preferredMnemonic
- The preferred mnemonic for this menupublic BString getPreferredMnemonic()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |