In the previous article, we added Application Extensions for a common Eclipse plug-in. The rest of the work is very simple, and we don't even need to write a line.Code. In
In eclipse 3.1, the process of packaging plug-ins with applications into RCP and outputting is through the establishment of the product configuration file (
Configuration.
Select File> New> other in the main menu, and create a new product configuration file in the dialog box. This file can be created anywhere.
Put it in the main directory of the plug-in that needs to be converted to RCP. The product configuration file is in XML format, but eclipse
3.1 provides an Editor interface to edit its content, so you don't need to remember all the tags as before. This editor is divided into three pages: Overview,
Configuration and branding.
First, specify the product ID on the overview page, and press "Product
In the dialog box, enter the plug-in ID, new product ID, and default Application ID, as shown in figure 1. Close the dialog box and select
Run the application and enter the product name. Below is an option for you to choose whether the product is based on plug-in or feature. feature is a collection of multiple plug-ins, as shown in
If only one plug-in is included, you can choose based on plug-in. If multiple plug-ins are included, use feature to classify these plug-ins by function for ease of management. We recommend that you use feature-based
But you must first create a feature.
Figure 1 Create Product ID dialog box
Then, go to the configuration page and add our plug-ins to the plug-ins list on the left (if the features-based method is selected, here is
Feature list), and then press "add required
The plug-ins button allows eclipse to automatically add other dependent plug-ins. The config. ini file is used to set some variable values, RCPProgramThe runtime will change according to them
For example, you can specify the position of the perspective switch (Org. Eclipse. UI/dock_perspective_bar = left ).
In the lower-right corner of the page, you can set some running parameters.
Figure 2 select the required plug-in
Finally, go to the branding page. The function of this page is to customize some appearance elements, such as the splash image displayed at startup.
“Splash.bmp is named and saved to the root directory of the plug-in.
The hosts file, and the image in the "about..." dialog box.
And text, as needed. Initiator name (Launcher
The name of the command used to start rcpis. It is a script file in linuxand an .exe file in windows. You can also customize the launcher icon.
In this example, this custom project is saved.
Note that no matter which directory these images are placed (such as the icons directory), they should be output to the product. Otherwise, the product cannot be seen or a small Red Square is displayed when running the product, the method is in the build of the plug-in. select the files and directories to be output in the properties editor.
After the above configurations are complete, return to the overview page and click "launch
Product, you can click "Eclipse Product Export
Format), as shown in figure 3.
Figure 3 output product
After the output, check the running effect again. If it is different from the previous one, it is likely that some problems are written in build. properties. Please check carefully.
It's easy!