Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run plugin code in Eclipse automatically on startup?

I want to create an Eclipse plugin that automatically runs in the background, as soon as the user opens the Eclipse IDE.

For example, I am building a Java Eclipse plugin that gets the current active file address, but I would like this plugin to always run in the background without user having to run it manually.

How to achieve this?

like image 242
Erfan Farhangy Avatar asked Mar 08 '15 11:03

Erfan Farhangy


People also ask

What is Eclipse plugin development?

The Eclipse PDE™ (Plug-in Development Environment) provides tools to create, develop, test, debug, build and deploy Eclipse plug-ins, fragments, features, update sites and RCP products.


1 Answers

The org.eclipse.ui.startup extension point lets you define a class that is run early during workbench initialization.

The extension point looks something like:

<extension point="org.eclipse.ui.startup">
   <startup class="package.StartupClass"/>
</extension>

the class specified must implement the org.eclipse.ui.IStartup interface.

More details here

like image 180
greg-449 Avatar answered Sep 17 '22 21:09

greg-449