Introduction to eclipse RCP Technology

Source: Internet
Author: User
Tags version control system
1. Introduction

Eclipse is an open-source, Java-based, and scalable development platform. In itself, it is only a framework and a group of services used to build a development environment through plug-ins. When we mentioned eclipse, the first response of many Java developers was the Java integrated development platform with good performance, beautiful interfaces, and exceptional debug functions.

It is undeniable that eclipse often appears in front of developers as an excellent IDE (integrated development environment. It is not only a Java IDE, but also a C language IDE and a python ide-eclipse can become an IDE in any language as long as the plug-in of the corresponding language is developed. However, these are strictly the applications of eclipse RCP. Real eclipse is a platform that provides a complete plug-in mechanism RCP (rich client platform, fat client platform). It uses SWT/jface as the interface element component, provides a user with a UI platform named workbench. With its excellent plug-in mechanism, it constructs a server client platform with strong scalability, excellent performance, and excellent UI experience.

2. Introduction to eclipse RCP

Eclipse RCP is a core function of the eclipse platform. Most people think of eclipse and the Java integrated development environment (IDE ). If you strip the IDE content in eclipse, the rest is the core that provides basic workbench functions, including movable and stackable window components (editors and views), menu, toolbar, button, table, tree structure, and other support, and this core is eclipse RCP.

My personal understanding is that eclipse RCP is switched from plug-in development to desktop application development. To build a minimal eclipse platform (8 m) and run your desktop application, you don't have to worry about the program framework any more, get rid of the failed AWT and swing, so that the program has a professional-level effect, and the implementation is very simple and elegant.

RCP provides a variety of interface controls, which makes it much easier to develop desktop applications based on Java, although it cannot be compared with VB and Delphi. For developers, although RCP is also used to develop desktop applications, RCP gives developers the feeling that it gives full play to the advantages of plug-in systems, RCP can be seen as a guide to best practices for building a plug-in system based on osgi (Open Service Gateway Initiative). From the design of RCP, you can learn how to modularize the application, make the application dynamic, and even learn how to automatically generate the interface. RCP can be seen as the best practice for plug-in Application Systems Based on osgi. Many of the design methods can even be organized into a design model for plug-in Application Systems Based on osgi, let's embark on the RCP journey, unveil it, and explore its nature! I believe that after reading the code of the RCP, you have to pay high respect to the RCP. The work of the master is remarkable.

Eclipse RCP provides application developers with the following features:

◆ Consistent and local appearance of applications and features;

◆ Public application services, such as window management, update management, help and selection management;

◆ Local appearance, using actual platform windows on Windows, Mac OS X, Linux, Solaris, HP-UX, Aix, and embedded devices;

◆ Standardized Component Model;

◆ Universal scalability;

◆ Integrated update mechanism;

◆ Top-level development tools (eclipse software development kit (SDK) is a world-class software development environment ).

The eclipse RCP project replaces AWT and swing in the java standard with the SWT graphics library and toolkit. SWT directly calls the graphics library of the operating system, so that the look and feel of Java applications are exactly the same as those of the operating system. More importantly, direct calls to local methods greatly increase the speed of running SWT-based Java applications. SWT has two disadvantages: (1) It is not a Java language standard; (2) it supports too few platforms.

3. Eclipse RCP Architecture

An eclipse RCP can be divided into the following five parts, as shown in:

Figure 1

(1) wrokbench workbench

Provides a user interface for eclipse. It is built using SWT (Standard Widget Toolkit) and a more advanced API (jface). SWT is a non-standard replacement of Java's swing/awt gui APIs, jface provides user interface components based on SWT.

(2) Workspace

The workspace is a plug-in for managing user resources. It includes projects created by users, files in projects, file changes, and other resources. The workspace also notifies other plug-ins about resource changes, such as file creation, deletion, or change.

(3) Help System

It helps to build a scalable capability equivalent to the eclipse platform itself. Similar to adding a plug-in to eclipse, the plug-in provides an additional navigation structure that allows tools to add documents as HTML files.

(4) team support system

The team support component provides support for version control and configuration management. It adds views as needed to allow users to interact with any version control system in use. Most plug-ins do not need to interact with the team's support components unless they provide version control services.

(5) platform runtime running platform

The Platform Runtime Library is the entire eclipse kernel. It checks which plug-ins are installed at startup and creates registry information about them. To reduce the startup time and resource usage, a plug-in is loaded only when a plug-in is required. Everything except the kernel is implemented as a plug-in.

One of the most obvious advantages of eclipse is plug-and-play and no-deletion. When building a plug-in application system, we usually want to do the following:

(1) Add a plug-in to dynamically expand system functions, including function portals. The most important thing is not to modify the original plug-in because a new plug-in is added, implement plug-and-play. osgi itself provides support for dynamic extension of system functions based on plug-ins, but can it be used for plug-and-play? Can it not cause modifications to the original plug-in, this depends on the skill of the designer;

(2) You can delete a plug-in to dynamically remove system functions, including function entries. The most important thing is that the uninstallation of the plug-in does not affect the operation of the system, this is the same as what is mentioned in 1. osgi can support this requirement, but whether the application system can do so depends on the skill of the designer;

(3) dynamically change system behavior by adding or updating plug-ins.

Based on osgi, RCP also defines the extension point mechanism to ensure its plug-in and dynamic implementation. It is precisely because of the extension point mechanism, this enables RCP to better achieve the first two goals of building a plug-in application system, at the same time, through its design of desktop application support, RCP shows us the best practice of the expansion point, divides the interface according to the object idea, and forms a plug-in according to the responsibility during the division process, the extension points are exposed, and finally a tree-like structure system is formed ,:

Figure 2

One of the best aspects of this design method is that it fully achieves true plug-and-play, I .e., delete-and-nothing. A typical example is that in RCP, perspective can be implemented through extension, after installing this plug-in, you can see this perspective in RCP. After deleting this plug-in, RCP will naturally not see this perspective.

From the structure of RCP, we can see how RCP is designed based on the design concept of the extension point, the design idea of the plug-in is to divide from top to bottom, according to duties, and form the plug-in method. The part of the plug-in that needs to support dynamic expansion is made into an extension point, to form a very scalable development platform.

Plug-and-play and delete-and-no support allows the system to be assembled in Plug-In mode. When a system is built, it is like planting a tree. First, the root of the system is planted, let the root grow the trunk, cultivate the branches and leaves on the trunk, and bear fruit on the branches. The whole tree is cultivated like this. When a fruit is not needed, I picked it and ate it. When I don't need a leaf, I cut it down without affecting the main stem, when you want the tree to form other fruits, you can even connect different branches to make them grow different fruits.

4. Summary

Currently, many plug-ins are developed based on Eclipse, involving various aspects of the software field. However, independent software developed based on Eclipse RCP is not common, among which several well-known eclipse RCP software include:

Jlabrary: Open-Source CMS system. Use eclipse RCP to implement the client;

Noa office integration Editor: An office software integrating open office into RCP;

Nomad Pim: A recommended personal information management system that manages personal information, such as calendar, expenses, and diaries.

Interested readers can download the source code of these software for learning. In addition, eclipse also has a very detailed RCP development help documentation (both in English). The full use of these resources will greatly accelerate eclipse RCP development.

 

 

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.