Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top