views:

802

answers:

2

I want to register to get notified of all Java changes in Eclipse. I can do this by calling JavaCore.addElementChangedListener(). However, I don't want my plugin to be loaded until org.eclipse.jdt.core is loaded. My hack attempt to do this was declare a dummy extension to an org.eclipse.jdt.core extension point, but it doesn't work on all versions of Eclipse. Plus it's ugly. How can I cleanly ensure that my plugin is loaded when another plugin is loaded?

+2  A: 

It turns out there is no built-in way to load my plugin when another plugin is loaded. The most general way to solve the problem is to force my plugin to load on startup and setup a listener for other plugins getting loaded. Then, when jdt.core loads I can add my element changed listener. However, even though it seems theoretically possible I can't figure out how to force my plugin to load on startup. I went with the ugly hack.

Kent Beck
That was the best I could come up with. But you asked for clean. Thanks for JUnit and agile btw.
jamesh
A: 

Hi... if you can help me in telling how you are setting listeners in your plug-in for other plug-ins. Small code from your plug-in will suffice to solve my problem. Pleases suggest as its really very urgent for me to fix some critical issue.