Saturday, October 24, 2009

Section 14.2.  Configuring the Update Plug-ins










14.2. Configuring the Update Plug-ins


To allow Hyperbola to update itself with new versions, you first need to add the Update plug-ins to the product configuration. Follow these steps to add the required plug-ins:






1.
Go to the Configuration page of the Hyperbola product editor and click Add to add plug-ins.


2.
In the dialog, choose org.eclipse.update.ui and click OK. The Update UI plug-in is added to the list.


3.
Click Add Required Plug-ins. Notice that org.eclipse.update.core was added to the configuration.



When you added the Help plug-ins to Hyperbola in the previous chapter, just adding the plug-ins to the configuration was enough to enable the functionHyperbola's help content was enabled via extension contributions. For Update, Hyperbola needs to access code. As such, you must add the Update plug-ins to Hyperbola's list of required plug-ins.


Open Hyperbola's plug-in editor and on the Dependencies page, click Add... to see a list of plug-ins that are currently not required by Hyperbola. Select


  1. org.eclipse.update.core

  2. org.eclipse.update.ui


and click OK to add them. You do not need to add all the Update plug-ins, only the ones whose code is directly referenced from Hyperbola. Don't forget to save the changes.


Tip



If you are looking for a class that you know exists and is in your target but you still cannot find it, it is likely that your plug-in dependencies are wrong. Eclipse only shows classes that are directly visible on your prerequisite chain. That is, Hyperbola requires the UI plug-in and the UI requires the Help plug-in. Hyperbola can see the classes in the UI, but not those in Help.


On rare occasions, a plug-in such as the UI is configured to re-export some of its prerequisites. We saw this in Section 4.1, "Hyperbola Hello World," where the UI required and re-exported SWT. In that case, Hyperbola was able to see SWT's classes through the UI. Eclipse contains a few other examples of this. Notably, org.eclipse.core.runtime re-exports org.eclipse.osgi.


So, when you are missing classes, hunt down the plug-in that contains them and add a direct dependency on it.














No comments:

Post a Comment