[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Menus and submenus

I am trying to create a cascading menu under my own menu.

MyMenu
Menu1->Submenu1
       Submenu2


I cannot get this to work.

I can, using the same technique as outlined in the help,  add the submenu
to the Window menu, and it works. 

Window
Menu1->Submenu1
       Submenu2

But when I try to add the submenu to my menu, the menu shows up but it is
grayed and none of the Submenu items are available. 

MyMenu
Menu1 (grayed)

The log reports
1 org.eclipse.core.resources 4 Invalid Menu Extension (Path is invalid):
SubMenu1Id

Here is the sample I based the code on. This is from the Eclipse
documentation.
<extension 
    point = "org.eclipse.ui.actionSets">
    <actionSet id="org_eclipse_ui_examples_readmetool_actionSet"
        label="ReadMe Actions"
        visible="true">
        <menu id="org_eclipse_ui_examples_readmetool"
            label="Readme &amp;File Editor"
            path="window/additions"> 
            <separator name="slot1"/>
            <separator name="slot2"/>
            <separator name="slot3"/>
        </menu>
        <action id="org_eclipse_ui_examples_readmetool_readmeAction"
            menubarPath="window/org_eclipse_ui_examples_readmetool/slot1"
            toolbarPath="readme"
            label="&amp;Open Readme Browser@Ctrl+R"
            tooltip="Open Readme Browser"
           
helpContextId="org.eclipse.ui.examples.readmetool.open_browser_action_context"
            icon="icons/basic/ctool16/openbrwsr.gif"
            class="org.eclipse.ui.examples.readmetool.WindowActionDelegate"
            enablesFor="1">
            <selection class="org.eclipse.core.resources.IFile"
                name="*.readme">
            </selection>

Here is a version that I got to work in my own application.

<actionSet
   id="com.rational.test.ft.wswplugin.TestActionSet"
    visible="true"
   label="MyMenu">
   <menu
    id = "MyMenuId"
    label = "&amp;MyMenu">
    <separator name = "Menu1Slot" />
   </menu>
   <menu id="Menu1Id"
    label = "&amp;Menu1"
    path ="window/additions">
    <separator name="slot1" />
    <separator name="slot2" />
    <separator name="slot3" />
   </menu>
   <action
    id = "SubMenu1Id"
    menubarPath = "window/Menu1Id/slot1"
    label = "&amp;SubMenu1"
    class = "com.rational.test.ft.wswplugin.x">
   </action>


Here is a version that fails in my application. The only difference is
that instead of window, I use MyMenu and instead of additions, I use
MyMenu1Slot. I tried variations on ids and slots, but nothing changed.

<actionSet
   id="com.rational.test.ft.wswplugin.TestActionSet"
    visible="true"
   label="MyMenu">
   <menu
    id = "MyMenuId"
    label = "&amp;MyMenu">
    <separator name = "Menu1Slot" />
   </menu>
   <menu id="Menu1Id"
    label = "&amp;Menu1"
    path ="MyMenuId/Menu1Slot">
    <separator name="slot1" />
    <separator name="slot2" />
    <separator name="slot3" />
   </menu>
   <action
    id = "SubMenu1Id"
    menubarPath = "MyMenuId/Menu1Id/slot1"
    label = "&amp;SubMenu1"
    class = "com.rational.test.ft.wswplugin.x">
   </action>



Glenn Bardwell