Using eclipse RCP for desktop program development (1): Quick Start

Source: Internet
Author: User
Guidance:
The so-called RCP is short for the rich client platform, that is, the rich customer platform, which is the product of eclipse evolution (since version 3.0 ), it is a powerful open development platform provided by the eclipse organization to users, allowing users to easily create their own eclipse-based applications, and these applications can get the underlying support of Eclipse. More importantly, we can use Java to create a desktop program that is as beautiful as Eclipse.
I believe that in the next few years, RCP will become very popular. With RCP, we can develop beautiful desktop programs like Eclipse, such as hospital management systems and CAD software. Unfortunately, at present, Chinese documents about RCP are basically not found in China. We can only add the desired features for our program through our own exploration.
Next let's build an eclipse RCP program step by step. The following content can be found on Google. Some people will find it boring, but it doesn't matter. This is just a quick start.
Select "New -- project" and select "plug-in project ":
Click Next, enter the project name, and select the eclipse version. Here, 3.2 is selected:
Click Next, the plug-in ID and plug-in name can be changed, and other content can be kept by default. Be sure to select the support for the rich client application:
Click "Next" and select a template. Here you can select the simplest one. It is easy to understand the source code:
Click Next and change the application title:
Click Finish. Right-click the project and choose "run by Eclipse" to view the effect:
In this program, a perspective is displayed in the window, and the perspective contains an editor area. Later, we can gradually add menus and toolbar for this program and add views and editors for this perspective.
Now, this program can only be run in the eclipse environment, and the RCP aims to create an application that can run independently. Our work is not complete yet. Next, right-click the project and create the product configuration file:
Enter the product configuration file name:
The generated product configuration file should be opened in the editor as follows:
At the beginning, the text boxes above are empty. Click the new button and the following dialog box is displayed. Enter the product name and click Finish.
Click "Start Program" in the configuration file. We can try to start our RCP program. As a result, an error occurs. The reason is simple, because we didn't select the plug-ins it depends on for our program.
Select the "configuration" tab of the configuration file and add the following dependencies. Remember to add ourselves, that is, com. blogjava. youxia. rcp_start, to the dependencies. Otherwise, an error occurs. At the very beginning, it was such a small problem that I wasted a few days.
Click Add required plug-ins to automatically add other dependencies.
Next, set the project build path, for example:
Next, export our program:
Click Next and enter the directory exported by our program, for example:
After clicking the "finish" button, our program will be exported to the specified directory. Open this directory and you will see a program icon similar to eclipse. Double-click it to run the program. The effect is as follows:
At last, two points should be noted: first, if you want the generated program to have its own icon, you can set it in the last two configuration files in the product configuration file; second, the generated program should have no menu bar. Because MyEclipse is installed in Eclipse, the exported program has two more menus.
Now, the Quick Start is here. I will study the generated code and add functions for our program later.

This article is transferred from
Http://www.blogjava.net/youxia/archive/2006/11/17/81852.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.