Kent Beck
Kent Beck

Reputation: 5011

In Eclipse, how can I get my plugin to load when another plugin is loaded?

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?

Upvotes: 2

Views: 1449

Answers (1)

Kent Beck
Kent Beck

Reputation: 5011

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.

Upvotes: 2

Related Questions