An Eclipse product is a branding and a reference to an application. The product also has control over what features or plug-ins will be available, and whether those plug-ins will be started or not (and if so, in what order).
Chapter 7, Understanding the Eclipse 4 Model created a product to bootstrap the E4 application (provided by the org.eclipse.e4.ui.workbench.swt.E4Application
class) but this section will create a product that binds to the headless application created previously to demonstrate how the linkage works.
com.packtpub.e4.headless.application
project and put headless
as the filename.headless.product
in an editor.com.packtpub.e4.headless.application.product
1.0.0
Headless Product
com.packtpub.e4.headless.application
product
com.packtpub.e4.headless.application.id
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
because the runtime can't find the required plug-ins. Switch to the Dependencies tab, and add:com.packtpub.e4.headless.application
org.eclipse.core.runtime
eclipse
to see the message being printed. On Windows, run eclipsec.exe
to see the output. On OS X, run Eclipse.app/Contents/MacOS/eclipse
.Using and running a product may not seem that different from running an application, but the key difference between the two is that an application is a start point and one which can be installed into an existing Eclipse runtime, whereas a product is a standalone system that can be run independently.
A product defines the look and feel of the application's launch icons, specifies what will be bundled, and how it is launched. The product then hands over control to an application, which executes the runtime code.
The editor is a GUI for the product file, which is an XML file that will look similar to the following:
<?xml version="1.0" encoding="UTF-8"?> <?pde version="3.5"?> <product name="Headless Product" uid="com.packtpub.e4.headless.application.product" id="com.packtpub.e4.headless.application.product" application="com.packtpub.e4.headless.application.id" version="1.0.0" useFeatures="false" includeLaunchers="true"> <configIni use="default"/> <launcherArgs> <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac> </launcherArgs> <launcher> <solaris/> <win useIco="false"> <bmp/> </win> </launcher> <vm/> <plugins> <plugin id="com.packtpub.e4.headless.application"/> <plugin id="org.eclipse.core.contenttype"/> <plugin id="org.eclipse.core.jobs"/> <plugin id="org.eclipse.core.runtime"/> <plugin id="org.eclipse.core.runtime.compatibility.registry"fragment="true"/> <plugin id="org.eclipse.equinox.app"/> <plugin id="org.eclipse.equinox.common"/> <plugin id="org.eclipse.equinox.preferences"/> <plugin id="org.eclipse.equinox.registry"/> <plugin id="org.eclipse.osgi"/> </plugins> </product>
The product created previously specified an exact set of plug-ins that are needed to run the code. Many Eclipse applications are based on features, and products can also be defined by features as well.
Move the plug-in dependencies from the product to a feature, and then have the product depend on the feature instead. That way, when the feature is updated, it can be done externally to the product definition.
Q1. What is the keyword used in the version number that gets replaced by the timestamp?
Q2. What files get generated in an update site build?
Q3. What is the name of the file that allows an update site to be categorized?
Q4. What is the difference between feature "requires" and "includes"?
Q5. What is the difference between an application and a product?
Q6. What is an application's entry point?