[Original] Eclipse 3.1m5a created an RCP program

xiaoxiao2021-03-06  18

Eclipse 3.1m5a has strengthened the support of RCP, and the RCP team is a very delicate way to create, configure, and release of RCP programs. Here, only 4 steps of creating RCPs in 3.1 m5a are introduced, basically can be done through window operations, and avoid direct editing of Plug-in.xml and .product files.

Step 1: Create a plug-in that contains the RCP frame code

"File> New> Project ..." Select "Plug-in Project" and "Next>" Enter your project name (such as "myrcpapp") and "Next>" below "Rich Client Application" below "Rich Client Application" "Would you like to create a rich client application?" Select "YES", then "Next>" In "Templates", select "RCP Application With a view" Click "Finish", Plug-in's Overview Edit page Will open

Your RCP will have a simple viewer and contain the foundation frame code of the RICH Client app. In the "* .rcp" package, you can edit the generated View.java file, add SWT or JFACE components via createPartControl (). Select "Run As> Eclipse Application" to test your RCP program. You can save the runtime configuration: Select "Run ..." and create a new configuration file (such as name myrcpapp), select MyRcPapp.Application in the "Run An Application" in the main page. Then in the PLUG-IN page, select "Choose Plug-Ins and Fragments to Launch From The List", click "DeSelect All" to clear all PLUG-I, then select MyrCPAPP (1.0.0), click "Add Required Plug" INS "adds a must-have PLUG-INS. Finally, you can run.

Step 2: Create a .product configuration file

Select MyrcPApp in Package Explorer, right-click Select "New> Product Configuration.". This is a new increase in 3.1m5a! Enter the file name, you must end with .product (such as MyrcPapp.Product). In the "Initialize the File Content" section, select "Create a configuration file with basic settings" created a minimized configuration. Click "Finish".

.Product's "Overview" page will be opened, this page is very similar to the editing page of PLUG-IN.XML.

Step 3: Configure your RCP program .product

Define "Product ID:" in the overview page of the .product file, click "New ..." in the "Product Definition" dialog box, select "Defining plug-in:" and click "Browse ..." to select RCP The core Plug-in, such as MyrCPAPP (1.0.0), "Product ID:", such as "MyrCPAPP_Product_1" in the "Product Application" section, select MyrCPAPP.Application Click "Finish" to return to the Overview page, can be in Product Name Develop the name of the program displayed on the Title Bar in Title Bar, such as MyrCPApp. Click the "Product Configuration" hyperlink, which opens the Configuration page, allowing you to add your RCP programs to other PLUG-IN. Add you to Plug-in, such as add myrcpapp, then select MyrcPApp, click "Add Required Plug-Ins", which will solve the dependencies between PLUG-IN, you will see all necessary All PLUG-I is automatically added to the Overview page, you can start your RCP program by clicking "Launch The Product".

Step 4: Export your RCP program

You have created a .product file, and made a basic configuration for your RCP, and tested it, then you can export your RCP program for release.

In the exporting section of the Overview page, click the "Synchronize" hyperlink to synchronize .Product and Plug-in configured to enter a "Archive:" name, the default output file is the default, click "Export" hyperlink at the end of .zip. All PLUG-IN, RCP's basic runtime runtime (everything you need) will be packaged in the .zip file you named.

You can also distribute your RCP, unveil the .zip file, run Eclipse.exe, everything is OK!

So how do you "BRANDING" your RCP? Open the .product file and open the "Branding" page. You can specify Launcher Name, so that your RCP is not Eclipse.exe but MYRCPAPP.EXE. You can also specify root directory so that .zip files will automatically decompress in your specified directory. You can also specify an icon for the RCP program. Re-export, you have an RCP program with your own logo.

There is also a way of distribution is Java WebStart. You can download an Example on the SourceForge to see how you configure Java WebStart.

The release, configuration, and export release of RCP have become very convenient. The core of the RCP is also a Plug-in, you can write your own Perspective, Viewer, Editor through a variety of Perspective, Viewer, Editor to add various functions.

转载请注明原文地址:https://www.9cbs.com/read-42245.html

New Post(0)