没有合适的资源?快使用搜索试试~ 我知道了~
首页Eclipse RCP教程
资源详情
资源评论
资源推荐

Lars Vogel
Version 6.4
Copyright © 2007-2011 Lars Vogel
24.09.2011
Revision History
Revision 0.1 - 0.7 14.08.2007 - 03.09.2007 Lars Vogel
Eclipse RCP with Eclipse 3.3
Revision 0.8 - 6.4 03.11.2008 - 24.09.2011 Lars Vogel
Several bug fixes and enhancements
Eclipse RCP
This tutorial describes how to dev elop Eclipse RCP applications. It is based on Eclipse 3.7 (Eclipse Indigo).
Table of Contents
1. Eclipse RCP Overview
2. Eclipse Plugin Architecture
2.1. Eclipse IDE vrs. Eclipse RCP
2.2. Plugins, OSGi, Extension Points
2.3. Main components of an Eclipse RCP application
2.4. Configuration files
3. Installation
3.1. Installation
3.2. Update an Eclipse Java IDE
4. Tutorial: Create your first RCP application
4.1. Create an RCP application
4.2. Start your RCP application
4.3. Convention
5. IApplication and Advisor Classes
6. Run configuration
6.1. Overview
6.2. Check the runtime configuration
7. WorkbenchParts and Perspectives
7.1. WorkbenchParts - Views and Editors
7.2. Perspective
8. Tutorial: Adding Views to your application
8.1. Create a view
8.2. Add the view to your perspective
8.3. Result
8.4. Add view to perspective via code
9. Editor / View interaction
10. SWT
11. JFace Viewers
12. Tutorial: JFace ComboViewer
13. Field Assist and ControlDecorations
14. Tutorial: FieldAssists and ControlDecoration
15. Products and Branding
15.1. Product and application
15.2. Dependencies
15.3. Configuration
15.4. Deployment
16. Tutorial: Product Export
16.1. Create your product configuration
16.2. Launch your product
16.3. Export your product
16.4. Common problems
17. Commands
18. Tutorial: Adding an Perspectives
19. System Tray
20. Adding a status line
Eclipse RCP Tutorial

20.1. Setup Status line
20.2. Shared Status Line
21. Tips and Tricks
21.1. Save users layout
21.2. Finding unused dependencies
21.3. Deploy your own JRE with your RCP application
21.4. Multi-User settings
22. Questions and Discussion
23. Links and Literature
23.1. Source Code
23.2. Eclipse Resources
23.3. vogella Resources
Eclipse RCP allows developers to use the Eclipse platform to create flexible and extensible desktop applications. Eclipse and
Eclipse RCP applications are build upon a plugin architecture. Plugins are the smallest deployable and installable software
components of Eclipse. A plugin is a collection of files and a configuration file (MANIFEST.MF) which describes the plugin and its
dependencies.
This plugin architecture allows Eclipse and Eclipse RCP applications to get extended by third parties.
The following picture show the content of an example RCP application.
This tutorial will introduce you to the exciting world of development of
Eclipse RCP
applications.
2.1. Eclipse IDE vrs. Eclipse RCP
An Eclipse application consists out of plugins.
From the Eclipse RCP perspective the
Eclipse IDE
is only one collection of specific plugins. T he components of the Eclipse IDE are
primary the following.
An Eclipse RCP application use only parts of these components. An Eclipse RCP application typically uses:
1. Eclipse RCP Overview
2. Eclipse Plugin Architecture

For a headless Eclipse based applications (without UI) only the runtime is necessary .
The
OSGi runtime
provides the framework to run the modular application.
SWT
is the standard UI component library used by
Eclipse and
JFace
provides some convenient API on top of SWT. The workbench provides the framework for your application.
The workbench is responsible for displaying all other UI components.
2.2. Plugins, OSGi, Extension Points
As said Eclipse application are build via a collection of plugins. Plugins define their API and their dependencies. The basis for this
architecture is the runtime environment
Equinox
which is the reference implementation of
OSGi
. Eclipse uses the term "Plugin"
and OSGi uses the term "bundle", but both terms mean the same.
OSGi specifies how Eclipse plugins defines:
their API - public classes which can be used by other plugins
their dependencies - package or plugins which are required for the plugin to run correctly
OSGi defines also services. Please see the
OSGi Tutorial
for details.
In addition to the OSGi functionality you can also use and define
extension-points
in Eclipse applications. Extension-points define
interfaces for other plugins to contribute functionality (code and non-code ).
Another or the same plugin can use extensions, e.g. provide functionality to these extension points.
Extensions and extension- points are described in the file "plugin.xml". This file is a XML file which provides a user interface for
editing this file. T he Eclipse IDE prov ides editors for this file (via Plugin Development Env ironment plugins).
Existing extensions (contributions) are collected during the start of an Eclipse RCP application. The information in the extension
points is converted into so-called descriptors and stored in registries.
2.3. Main components of an Eclipse RCP application
The minimal required plugins to create and run an minimal Eclipse RCP application (with UI) are the two plugins
"org.eclipse.core.runtime" and "org.eclipse.ui". Based on these components an Eclipse RCP application must define the following
elements:
Main program - A RCP main application class implements the interface "IApplication". This class can be viewed as the
equivalent to the main method for standard Java application. Eclipse expects that the application class is defined via the
extension point "org.eclipse.core.runtime.application".
A Perspective - defines the layout of your application. Must be declared via the extension point "org.eclipse.ui.perspective".
Workbench Advisor- invisible technical component which controls the appearance of the application (menus, toolbars,
perspectives, etc)
2.4. Configuration files
An Eclipse RCP application has two main configuration files.
MANIFEST.MF - contains the OSGi configuration information.

plugin.xml - Information about the extensions and extension points
3.1. Installation
Browse to
http://www.eclipse.org/downloads
and download the package "Eclipse for RCP and RAP Developers". Extract the
download to your harddisk. Avoid having special characters or spaces in the path to Eclipse.
3.2. Update an Eclipse Java IDE
In case you have downloaded the Eclipse Java IDE (or any other non RCP flavor) distribution you can use the Eclipse Update
Manager to install the plugins required for RCP development. See
Eclipse Update Manager
to learn how to use the Eclipse Update
Manager.
Install "General Purpose Tools" -> "Eclipse Plug-in Development Environment" and "Eclipse RCP Plug-in Developer Resources"
from the Indigo update site. You may have to remove the "Group items by category" flag to see these features.
The following explains how to create a simple RCP application. It assumes that you already have some knowledge in using the
Eclipse IDE for standard Java development. See
Eclipse IDE Tutorial
if you don't have this knowledge.
4.1. Create an RCP application
In Eclipse select File- > New Project. From the list select "Plug-In Project".
3. Installation
4. Tutorial: Create your first RCP application

Give your plugin the name "de.vogella.rcp.intro.first" .
Press "Next" and make the following settings. As we are going to develop an RCP application, select "Yes" at the question "Would
you like to create a rich client application".
剩余31页未读,继续阅读












安全验证
文档复制为VIP权益,开通VIP直接复制

评论0