Trying to put new "Generate" option under Source menu in Eclipse -
i'm trying add together new "generate..." alternative under source menu when right-click on java file. @ point, i'm trying menu alternative show haven't had success yet.
is there wrong plugin.xml file below far can see?
class="lang-xml prettyprint-override"><?xml version="1.0" encoding="utf-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.ui.popupmenus"> <objectcontribution id="generatebuilderplugin.contribution1" objectclass="org.eclipse.core.resources.ifile"> <action class="generatebuilderplugin.popup.actions.generatebuilder" enablesfor="1" id="generatebuilderplugin.newaction" label="generate builder..." menubarpath="org.eclipse.jdt.ui.source.menu/generategroup"> </action> </objectcontribution> </extension> </plugin>
i ended going "hello, world command" template , adjusting needs.
below updated plugin.xml displays new "generate..." alternative on source menu. 1 needs setup command , handler class actual work. i'd recommend next "hello, world command" plugin template , tweaking needs.
<?xml version="1.0" encoding="utf-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.ui.commands"> <command name="generate builder..." id="generatebuilderproject.commands.generatebuilder"> </command> </extension> <extension point="org.eclipse.ui.handlers"> <handler commandid="generatebuilderproject.commands.generatebuilder" class="generatebuilderproject.handlers.generatebuilderhandler"> </handler> </extension> <extension point="org.eclipse.ui.menus"> <menucontribution locationuri="popup:org.eclipse.jdt.ui.source.menu?after=generategroup"> <command commandid="generatebuilderproject.commands.generatebuilder" id="generatebuilder.menus.generatebuilder"> </command> </menucontribution> </extension> </plugin>
eclipse eclipse-plugin eclipse-rcp
No comments:
Post a Comment