Introduction to Eclipse RCP technology

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

Eclipse is an open source, java-based, extensible development platform. For its part, it is just a framework, a set of services that are used to build a development environment through Plug-ins. When we mentioned eclipse, the first reaction of many Java developers was the Java integrated development platform with good performance, nice interface, and a fantastic debug feature.

Admittedly, eclipse is often seen as a great IDE (integrated Development environment, integrated development environment) in front of developers. It's not just a Java IDE, it can be a C-language IDE, Python's ide--as long as the plugin that emits the appropriate language, eclipse can become the IDE of any language. However, these are strictly the applications of Eclipse RCP. True Eclipse is a platform that provides a complete plug-in mechanism RCP (Rich client Platform, Fat client platform), which takes swt/jface as an interface element component and provides the user with a UI platform named Workbench , coupled with its own excellent plug-in mechanism, it can construct a service client platform with strong scalability, excellent performance, and a good UI experience for the user.

2. Introduction to Eclipse rcp

Eclipse RCP is a feature located at the heart of the Eclipse platform. When most people think of eclipse, they think of the Java Integrated development environment (IDE). If you peel the content about the IDE in Eclipse, the rest is a core that provides basic workbench functionality, including support for removable and scalable window components (editors and views), menus, toolbars, buttons, tables, tree structures, and so on, and this core is Eclipse RCP.

Personal understanding Eclipse RCP is a shift from plug-in development to desktop application development, building a minimized Eclipse platform (8M) to run your desktop applications without bothering with the program framework, getting rid of the failed AWT and swing, and giving the program a professional-level effect that is simple and elegant.

RCP provides a wealth of interface controls, which makes it much easier to develop desktop applications based on Java, although it still cannot be compared with VB and Delphi. For developers, while using RCP is also designed to develop desktop applications, RCP gives developers more of a sense of the advantages of a plug-in system, which RCP can consider as an OSGi (Open Service Gateway Initiative) Build plug-in system Best practice guidance, from the design of RCP, can learn how to make the application modular, the application can be dynamic, and even learn how to automatically generate the interface such design ideas. RCP can be seen as the best practice for plug-in applications based on OSGi, and many of the design methods can even be organized into a design pattern based on OSGi as a plug-in application system, let's go to the RCP and uncover the veil and explore its essence. I believe that everyone in the understanding of RCP design ideas, read its code, have to express a high respect for RCP, the master of the work, extraordinary.

Eclipse RCP provides applications developers with the following:

Consistent and local appearance of applications and features;

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

A local look, leveraging the actual platform window widgets on Windows, Mac OS X, Linux, Solaris, HP-UX, AIX, and embedded devices;

A standardized component model;

Popularization of scalability;

The updated mechanism of integration;

Top-level development tools (the 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 invokes the graphics library of the operating system, which makes the look & Feel of the Java application exactly the same as the operating system, and more importantly, direct calls to local methods greatly improve the speed at which SWT-based Java applications run. SWT's shortcomings are mainly in two points: (1) Not the Java language standard; (2) too few supported platforms.

3. Eclipse rcp architecture

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

Figure 1

(1) Wrokbench worktable

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 substitute for the Java SWING/AWT GUI API, and JFace is based on SWT and provides user interface components.

(2) Workspace work area

A workspace is a plug-in that is responsible for managing user resources. It includes user-created projects, files in projects, and file changes and other resources. The workspace is also responsible for notifying other plug-ins of information about resource changes, such as file creation, deletion, or alteration.

(3) Help system

Help build scalable capabilities that are equivalent to the Eclipse platform itself. As with Plug-ins adding functionality to eclipse, it helps provide an additional navigation structure that allows tools to add documents as HTML files.

(4) Team support system

The team support component is responsible for providing version control and configuration management support. It adds views as needed to allow the user to interact with any version control system that is used. Most plug-ins do not need to interact with the team support components unless they provide version control services.

(5) Platform Runtime operating platform

The platform runtime is the kernel of the entire eclipse, which checks which plug-ins are installed at startup and creates registry information about them. To reduce startup time and resource usage, it loads the plug-in when it actually needs a plug-in. In addition to the kernel, everything else is implemented as a plugin.

One of the most obvious advantages of Eclipse is Plug and Play, that is, deletion is nothing. When building a plug-in application system, we usually want to do the following three points:

(1) by adding plug-ins to dynamically expand the system function, including the function of the entrance, and the most important thing is not because of the addition of new Plug-ins, which led to the original plug-in modification, Plug and Play, OSGi itself provides a dynamic expansion of the system based on plug-in support, but whether it can really plug and play, Whether can not lead to the original plug-in modification, this is still to see the designer's skill;

(2) Remove the plug-in to dynamically remove the system function, including the function of the entrance, the most important thing is to let the uninstall does not affect the operation of the system, this and 1 inside the situation is the same, OSGi is able to support such a request, but the application of the system can still see the skills of designers;

(3) Dynamically changing system behavior by adding or updating Plug-ins.

RCP is based on OSGi to ensure its plug-ins and dynamic implementation of the situation, but also defines the extension point mechanism, and precisely because of the extension point of the mechanism, so that RCP in the design perspective to better achieve our plug-in application system, the first two goals, while RCP The design of the desktop application support shows us the best practice method of extension point, divides the interface according to the idea of the object, forms the plug-in according to the duty in the process of dividing, exposes the extension point, and finally forms the structure system like the tree, as shown in the figure:

Figure 2

The best place for this kind of design is to do the real Plug and play, that is, the deletion of the situation, the typical example is in RCP can be extended to implement perspective, this plugin can be installed in RCP to see this perspective, after removing this plugin The perspective is naturally not seen in RCP.

From the structure system of RCP, we can see how RCP is designed in the design ideology based on the extension point, it is designed to take from top to bottom, according to the responsibilities of the Division, the formation of plug-ins, plug-ins need to support the dynamic expansion of the part of the expansion point to form a very easy to expand the development platform.

Plug and Play, that is, the deletion of the support so that the system can be a good plug-in to assemble, when the system is like planting trees, first, the root of the system, so that the roots grow out of the trunk, in the trunk to cultivate the branches and leaves, the fruit, the whole tree is so bred, when no need for a certain fruit, take it off to eat , when you do not need a certain foliage, cut the branches, and this will not affect the trunk, when you want to form other fruit on the tree, and even can connect to different branches and leaves, so that it grows the same fruit.

4, Summary

At present, the Plug-ins developed based on Eclipse are very many, involving various aspects of the software domain. However, independent software developed on Eclipse RCP is not uncommon, with some of the more famous Eclipse RCP software:

jlabrary: Open source CMS system, using Eclipse RCP to implement the client;

NOA Office Integration Editor: an office software that integrates open office into RCP;

Nomad PIM: A recommended personal information management system that allows you to manage personal information, such as scheduling, spending, and journaling.

Interested readers can download the source code for these software to learn. In addition, eclipse itself has a very detailed RCP development help document (both in English), and taking full advantage 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.