There are lots of Eclipse RCP tutorials that begin with the obvious first step: "Create a new plugin project..."
It seems that approx. 70% of them specify checking the "Generate an activator, a Java class that controls the plug-in life cycle". The others specifically say don't check that toggle.
alt text http://img179.imageshack.us/img179/6710/newpluginoptions.png
Its not clear to me, what generating an activator class does for you, when you need one, and when you don't.
For being a prominent option you get every time you create a new plugin project (it seems to be set on by default) this option isn't very well explained anywhere that I have found.
Any advice/rules of thumb on choosing this option when creating Eclipse plugin projects?
Activator class is the start point of the plugin. Activator class is loaded initially and if you look into the hierarchy of the Activator class, it extends the AbstractUIPlugin, which tells the Eclipse Run-time that this Plugin is someway related to the Eclipse Platform UI.
Correct answer by Activator. java can be used to initialize(start) things.
The Plug-in Development Kit (PDK) includes an Eclipse plug-in that you can use in your Eclipse or Rational® Application Developer environment to create and edit some of the configuration files in the plug-ins that are used in your virtual applications. Overview.
One way to find out is to look at the generated class. Turns out that it is a subclass of AbstractUIPlugin. Check out the JavaDoc, it provides services like preference management, image registry and the like. If you need any of this, you may want to use it. It is a subclass of Plugin, which kind of makes sense.
Also, it implements BundleActivator, which has some useful JavaDoc. This provides you with stubs for start() and stop(), which allows you to hook your own code in here. It also generates a static convenience method getDefault(), which gives you the Activator. And that's all there is to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With