Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using eclipse menu for code generation
Using eclipse menu for code generation [message #1137171] Mon, 14 October 2013 09:57 Go to next message
Davide G is currently offline Davide GFriend
Messages: 36
Registered: October 2013
Member
Hi, i'm creating an eclipse plugin that generate documentation using xtend/xtext. What i want to do is creating documentation by pressing a custom menu entry in the eclipse menu bar, disabling the automatic translation.
I tried to add a custom menu entry (following a tutorial found on the net) adding this code to the UI project's plugin.xml automatically created by xtext:

...
<extension point="org.eclipse.ui.menus">
	...
	<menuContribution
               allPopups="false"
               locationURI="org.xtext.example.mydsl2.ui.menuContribution">
            <menu
                  label="Generate Documentation"
                  mnemonic="Generate &amp;Documentation">
               <command
                     commandId="org.xtext.example.mydsl2.ui.genDocCommand"
                     label=" Generate Doc"
                     mnemonic=" Generate Doc"
                     style="push">
               </command>
            </menu>
         </menuContribution>
</extension>

...

<extension point="org.eclipse.ui.commands">

	<command
            defaultHandler="org.xtext.example.mydsl.ui.GenerateDocumentationHandler"
            id="org.xtext.example.mydsl2.ui.genDocCommand"
            name="Generate Documentation">
    </command>
</extension>

...


As i launch an eclipse istance, nothing appears on the menu bar. So, where did i go wrong??
Re: Using eclipse menu for code generation [message #1150431 is a reply to message #1137171] Tue, 22 October 2013 19:29 Go to previous message
Mohamed IBN EL AZZOUZI is currently offline Mohamed IBN EL AZZOUZIFriend
Messages: 1
Registered: October 2013
Junior Member
Hi I used this tutorial to call generator from context menu.
http://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/

[Updated on: Tue, 22 October 2013 19:44] by Moderator

Report message to a moderator

Previous Topic:[solved] how to get the parent name in XTEND
Next Topic:Problem with expensive validation
Goto Forum:
  


Current Time: Thu Apr 25 21:08:08 GMT 2024

Powered by FUDForum. Page generated in 0.03135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top