Eclipse RCP plugin - ActivatorClass

193 Views Asked by At

I am new with Eclipse RCP and I am working on a plugin where I should decouple application logic from User interface and create two new plugins :

  1. Plugin one is for classes defining application logic.
  2. Plugin two is for classes defining user interface.

There was an images folder on the original plugin and I put it in the UI plugin. Now, I found out that these images were loaded using the Activator Class which I put in the application logic plugin. My problem now is how to load these classes from the UI plugin. Should I create an Activator Class for this plugin ? Is it safe to do it ?

I really need help. Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

You can have an activator in any or all of your plugins.

For your UI plugin the activator can extend AbstractUIPlugin which has an getImageRegistry() method. The ImageRegistry can be used to manage images.

The activator for your logic plugin should probably extend Plugin so that it does not have access to the UI code in AbstractUIPlugin.

Note: when you create a plugin with the New Plugin wizard the 'This plug-in will make contributions to the UI' option controls which class the activator extends.