Hi!
My approach would be to create a sub-menu and add the actions to this submenu...
Heres a quick snippet which should clarify the usage:
// submenu for selecting a color for a specific user
MenuManager subMenu = new MenuManager("Change Status", null);
// Actions for the color changing
subMenu.add(someAction);
// add the action to the submenu
manager.add(subMenu);
HTH!
Put together:
public SessionViewContextMenu(ViewPart sessionView, TableViewer viewer,
final Action action) {
MenuManager manager = new MenuManager("#PopupMenu");
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
manager.add(action);
// submenu for selecting a color for a specific user
MenuManager subMenu = new MenuManager("Change Status", null);
// Actions for the color changing
subMenu.add(someAction);
// add the action to the submenu
manager.add(subMenu);
}
});
Gnark
2010-09-12 13:46:08