Eclipse plug-in development, RCP development knowledge

Source: Internet
Author: User

To develop plug-ins or RCP programs based on Eclipse, you need to understand some basic knowledge, such as osgi, SWT, jface, EMF, and GMF.

Osgi Introduction

Osgi is a dynamic model system for Java. The osgi service platform provides services to Java, which makes Java the preferred environment for software integration and software development. Java provides support for product portability on multiple platforms. Osgi technology provides standardized primitives that allow applications to build with refined, reusable, and collaborative components. These components can be assembled into an application and deployed.

SWT Introduction

SWT (Standard Widget Toolkit) Standard Widget Toolkit is an open-source GUI programming framework that is similar to AWT/swing. The famous open-source ide-Eclipse is developed with SWT. Before SWT, Sun has provided a cross-platform GUI development kit AWT (abstract drawing wing Toolkit ). although the AWT framework uses native widgets, it has never broken through the LCD problem. LCD problems lead to loss of some major platform features.

To solve this problem, Sun has created a new framework. Instead of using native widgets, this framework uses emulated widgets ). Although this method solves the LCD problem and provides a rich set of window components, it also brings new problems. For example, the interface appearance of a swing application is no longer similar to that of a native application. Although these swing applications have achieved the maximum performance improvement in JVM, they still have performance problems that their native counterparts do not have. In addition, swing applications consume too much memory, so swing is not suitable for small devices, such as PDAs and mobile phones.

The SWT framework uses JNI to access native widgets. If a widget cannot be found on the host platform, SWT automatically simulates it. To facilitate SWT program development, a more easy-to-use and powerful graphic package "jface" was created based on SWT ". However, jface does not fully cover all the functions of SWT, so SWT and jface will be used in programming, but in general, it is better not to use SWT for components that can use jface.

SWT itself is only a set of underlying GUI APIs compiled by eclipse to develop the Eclipse IDE environment. It may be unintentional or intentional. So far, SWT has surpassed AWT and swing provided by Sun in terms of performance and appearance. Currently, SWT is very stable. The stability here should contain two meanings:

First, it refers to the stability of performance. The key is the design concept of SWT. SWT maximizes the image component API of the operating system. That is to say, as long as the operating system provides the corresponding image components, SWT simply uses the JNI technology to call them, only those components that are not provided in the operating system can SWT perform a simulation on its own. It can be seen that the stability of SWT performance mostly depends on the stability of the graphic components of the corresponding operating system.

Introduction to EMF

Eclipse modeling framework is an eclipse-based model framework. It is an important component of the Model Driven Architecture of eclipse, and is the basis of many projects in eclipse (E. g, GEF), EMF can convert the model into efficient, correct, and easy to customize Java code. The initial goal of the EMF project is to implement the MOF specification (Meta Object Facility) of the OMG (Object Management Group ). During the project, EMF developers reprocess MOF specifications based on a large amount of practical experience, and extract some core element sets (MOF
In 2.0, it is called emof (essential MOF )). It can be said that EMF is the Java efficient implementation of the MOF core subset. In EMF, the implementation of the MOF core subset is called ecore.

GMF Introduction

Graphical Modeling Framework (GMF) provides a graphical editor development environment and runtime framework.

Eclipse plug-in development knowledge

1. When will the plug-in be loaded?

When a plug-in is called for the first time, for example, the extension points provided by the plug-in are called or opened by other plug-ins depending on the plug-in.

2. How to configure the plug-in to automatically load when the platform starts?

Use the "org. Eclipse. UI. startup" extension point. In Versions later than eclipse3.5, you can set automatic loading in the product configuration information.

3. What are extensions and extension point )?

An extension is an extension of an implementation or application.

The extension point is the encapsulation of a series of functions or code. Applications provide extensions. Other applications can be expanded without modifying the application.

4. What is the classpath of the plug-in?

Osgi parent class loader (Java default root class loader), all exported plug-ins introduce packages, plug-in Declaration libraries, and related content.

5. How to access the UI object in a non-UI thread?

Use display. syncexec (runnable) or display. asyncexec (runnable)

6. Whether to display the call org. Eclipse. SWT. Graphics. image. Dispose ()

The SWT graph needs to display the call to dispose () to release system resources. If it is not called, the system may run out of resources.

7. What is display and shell?

Display is a device that serves as a bridge between SWT and the operating system. SWT reads and distributes events through display and operates through the SWT component.

Shell is a UI component, always at the top layer, similar to a desktop window.

8. What is EMF?

Eclipse modeling framework and model management framework.

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.