开发者

problem with submenu item in Rcp eclipse

开发者 https://www.devze.com 2023-02-28 21:48 出处:网络
i have shown different menu on the top like FILE, EDIT now i need to show the sub menu item like FIle-开发者_C百科>Edit->

i have shown different menu on the top like FILE, EDIT now i need to show the sub menu item like FIle-开发者_C百科>Edit->

i could not do this one can anybody please give me certain idea or give me the site name so i could do this one.


Use org.eclipse.ui.menus extension point. Remember, menu can have commands and menu can have menu too. This self-containment allows you to implement sub-menus.

Sample Plugin.xml

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="eDoc.menuContribution1">
         <menu
               label="Top">
            <command
                  commandId="eDoc.command1"
                  label="Command 1"
                  style="push">
            </command>
            <command
                  commandId="eDoc.command2"
                  label="Command 2"
                  style="push">
            </command>
            <menu
                  label="Sub Menu">
               <command
                     commandId="eDoc.command3"
                     label="Sub Menu Command 1"
                     style="push">
               </command>
            </menu>
         </menu>
      </menuContribution>
   </extension>

Checkout this eclipse-rcp tutorial for more details: http://www.vogella.de/articles/EclipseRCP/article.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号