Launching Eclipse plug in template

半腔热情 提交于 2019-12-29 09:22:26

问题


I created a Eclipse plug-in project by selecting a plug-in template provides by the eclipse. Then i ran the plug-in it opened another eclipse and the plug-in executed there.Why so? is the plugin taking eclipse's application class to create workbench?


回答1:


As an elaboration of "If you want to run the plugin in your main workspace you will have to export the plugin and install it in your main Eclipse." that @greg-449 had in his answer. You can do this.

Step 1 - Export your plugin

From the File menu, choose Export... and then choose the Deployable plug-ins and fragments wizard.

Step 2 - Configure your Wizard Options

  1. Select the plug-ins you want to export.
  2. As the destination, choose Install into host
  3. Press Finish

Step 3 - Confirm unsigned content

As you are probably not signing your plug-in, but you do trust it, say Yes to the Warning: you are installing software that contains unsigned content.

Step 4 - Restart Eclipse

Restart Eclipse when prompted to to enable the plug-ins.

Result

You should now see your new plug-ins. To make this example I used the new Plug-in wizard and choose the "Hello, World Command" template. The arrows below point to the contributions in the UI that the plug-in made.




回答2:


When you run a plugin (Run As > Eclipse Application) Eclipse starts a new instance of Eclipse including your plugin and uses a new workspace. This enables you to test the plugin without damaging your main Eclipse installation and workspace.

If you want to run the plugin in your main workspace you will have to export the plugin and install it in your main Eclipse.

If you want to run your plugin as part of an RCP you can set the application or product launched in the 'Run > Run Configurations...' entry.

For example:

Here I am running a product called 'greg.music.e4.rcp.product'



来源:https://stackoverflow.com/questions/33124278/launching-eclipse-plug-in-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!