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 and RCP Applications, 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 file name.headless.product
file 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
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 macOS, 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 that 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 looks like:
<?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="javax.xml"/> <plugin id="org.eclipse.core.contenttype"/> <plugin id="org.eclipse.core.jobs"/> <plugin id="org.eclipse.core.runtime"/> <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 is needed to run the code. Many Eclipse applications are based on features, and products can also be defined by features.
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.
3.133.123.34