sub-menu off of a View's ContextMenu? [message #276171] |
Thu, 18 November 2004 14:43 |
Eclipse User |
|
|
|
I'm just starting with Eclipse so I may be missing something simple. I
have created a View that contains a TreeViewer and added a ContextMenu (or
popup menu, the terms seem to be used interchangably) using the default
examples: Create a MenuManager, make it dynamic, and then add a menu
listener for menuAboutToShow(). When menuAboutToShow() fires I call a
function to populate the menu with Actions. This works fine.
Now, I would like to have the base context menu contain two submenus
instead of two actions. The submenus would then contain their own
actions. I eventually found some SWT examples that add SWT.CASCADE
MenuItems to a root menu and then add the submenus to the cascading
MenuItems. I was getting excited until I realized that my MenuManager
only has funtions to add types of IAction and IContributionItem and I need
to add MenuItems. So I can't add the two cascading MenuItems in my
menuAboutToShow() method. I think I'm running into a a JFace vs. SWT
architecture issue but can't figure out how to do it in a pure JFace way.
How do you add submenus to the base ContextMenu in a View and then add
Actions to those submenus?
Any help would be appreciated,
Jason
|
|
|
Powered by
FUDForum. Page generated in 0.02947 seconds