Introduction 1 Lars Vogel 4/22/2009. Who am I? Eclipse as a platform What is Eclipse RCP? Extension Points / Extensions Equinox SWT & JFace.

Post on 17-Jan-2018

226 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 Lars Vogel ◦ Working for SAP AG as a product manager responsible for SAP Transportation Management ◦ Open source enthusiastic ◦ Active in the Java and Eclipse ecosystem 3

Transcript

1

Eclipse Rich Client Platform (RCP)Introduction

Lars Vogel 4/22/2009

2

Who am I? Eclipse as a platform What is Eclipse RCP? Extension Points / Extensions Equinox SWT & JFace View coupeling Summary

Agenda – Introduction to Eclipse RCP

Lars Vogel 4/22/2009

3

Lars Vogel◦ Working for SAP AG as a product manager responsible for

SAP Transportation Management◦ Open source enthusiastic◦ Active in the Java and Eclipse ecosystem

Who am I ?

4

Eclipse RCP distribution, via www.eclipse.org/downlods

Or installation of feature „Eclipse RCP“ via the Eclipse update manager

Software Requirements

Lars Vogel 4/22/2009

5

Platform◦ Small runtime◦ Complex applications can be extensible without the need to

adjust existing code

Eclipse IDE - Building a platform

Runtime

Platform

Application

Extensible Application

Lars Vogel 4/22/2009

6

Nov. 2001 – Code released as open Source Juni 2004 – Eclipse 3.0 based on OSGi and enables

Eclipse RCP

Current Eclipse 3.4.2 (aka Ganymede)

Eclipse – Short History

Lars Vogel 4/22/2009

7

Local running application using the native widget toolkit

Based on the Eclipse runtime and technology Eclipse RCP applications can be standalone or may

require server communication

What is an Eclipse RCP application?

Lars Vogel 4/22/2009

8

Component model Rich user experience Platform (OS) independent Extensible

Re-use of existing Eclipse functionality Helps avoiding writing boilerplate code, e.g. automatic

update Excellent community

Why Eclipse RCP?

Lars Vogel 4/22/2009

9

Eclipse RCP application

Application

ApplicationWorkbenchAdvisor

ApplicationWorkbenchWindowAdvisor

ApplicationActionBarAdvisor

Calls PlattfromUI.createAndRunWorkbench

Defines the initial perspective

Settings for the window, e.g. toolbar visible, etc

Defines initial Actions (outdated)

Lars Vogel 4/22/2009

10

MANIFEST.MF – Defines OSGi bundle plugin.xml – Defines Eclipse extensions and extension

points build.properties – property file for export

PDE (Plug-in Development Environement) provides editors for these files.

Important configuration files

Lars Vogel 4/22/2009

11

Extension Points allow to add functionality to pre-defined points

Each plug-in can define it‘s own extension points allowing other to contribute

Each plug-in can define extensions, providing functionality to pre-defined extension points

RCP developer use primary the existing platfrom extension points to define their application

Extensions and Extension Points

Lars Vogel 4/22/2009

12

plugin.xml contains description of all extensions and extension points

Contributions are only loaded when they are needed -> lazy loading to save memory and keep startup time small

Extensions and Extension Points

*Graphic Source: Internet

Lars Vogel 4/22/2009

13

A command in Eclipse is a declarative description of a component and is independent from the implementation details.

A command can be categorized Key binding can be assigned to the command.

Example: Commands

Lars Vogel 4/22/2009

14

Key components of Eclipse RCP

Runtime / EquinoxSWT

JFace

Workbench

Other Plug-ins…

Lars Vogel 4/22/2009

15

Reference implementation of OSGi Dynamic module system Wildly used, e.g. in application servers Allows to

◦ Define dependencies between Plug-ins◦ Hide plug-in internal implementation details

Eclipse plug-in is always an OSGi bundle and vice versa

Equinox – Modular Architecture

Equinox

Lars Vogel 4/22/2009

16

View available for plug-in dependency analysis Graphical tool can be found on

http://www.eclipse.org/pde/incubator/dependency-visualization/

Excursus: Visual Plug-in Dependencies

Lars Vogel 4/22/2009

17

Plug-in(s) for the domain model Plug-in(s) for the core functionality Plug-in(s) for the UI functionality

Modularity allows you to grow as you go

“Typical” RCP Architecture

Lars Vogel 4/22/2009

18

SWT Standard Widget Toolkit◦ Thin layer upon the native GUI libraries ◦ JNI calls◦ Not a lot of conviniant functionality

SWT

*Screenshot from the Internet

19

JFace◦ UI toolkit that provides helper classes for developing UI features◦ Tables / TreeViewer / Dialogs / ◦ Can be based on models◦ Databinding

Workbench ◦ multi-window environment ◦ manages views, editors, perspectives 

JFace & Workbench

Lars Vogel 4/22/2009

20

Viewer: Table / Treeviewer: Responsible for the UI LabelProvider: How is the domain model represented ModelProvider: Delivery the domain model ViewerSorter: Sorts values in the viewer ViewerFilter: Filters values

Example: JFace Viewer

Viewer –

UI, shows data

ContentProvider –

„Dao“ for viewer LabelProvider –

Which data is represented how

Lars Vogel 4/22/2009

21

View / Viewer can be selection provider, e.g. getSite().setSelectionProvider(viewer);

Another view can register without knowing which view are responible for the changes◦ Needs to implement ISelectionListener◦ Must itself register as SelectionListener, via

getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this)

Allows Loose Coupeling

ViewPart Coupeling

Lars Vogel 4/22/2009

22

Contains the branding, e.g. splashscreen, icons, „About“ dialog

Configuration for different operating systems Used for exporting the final application

Eclipse Product

Lars Vogel 4/22/2009

23

Find in Eclipse which parts you are looking at Make coding analysis and re-use extremly easy Shortcut Alt+Shift+F1

Add org.eclipse.pde.runtime and org.eclipse.ui.forms as dependency to have Plug-in Spy in your own RCP application

Excursus: Plug-in Spy

Lars Vogel 4/22/2009

24

Eclipse RCP is a powerful framework to develop native looking, modular, extensible applications.

„Billions“;-) of new API‘s to learn….

Very powerful but complex framework

Summary

Lars Vogel 4/22/2009

25

The whole world of Eclipse projects is available for RCP◦ Modelling (EMF)◦ Reporting (BIRT)◦ Graphical Editors (GEF, GMF, Zest)◦ Automatic Updates (p2 Update)◦ Presentation Framework◦ PDE Build / PDE JUnit◦ Internationalization

Eclipse RCP in the Web -> Eclipse RAP Eclipse RCP on the mobile device -> eRCP

Eclipse E4 ◦ Styling of UI components via CSS◦ XWT -> allows declarative UI definition

Where is much more to Eclipse RCP…

Lars Vogel 4/22/2009

26

Introduction to Eclipse RCP◦ http://www.vogella.de/articles/RichClientPlatform/article.html

Eclipse RCP podcast◦ http://www.eclipsezone.com/files/podcasts/9-RCP-

Jeff.McAffer.mp3?source=podcasts

Book: Eclipse Rich Client Platform◦ By Jeff McAffer and Jean-Michel Lemieux◦ Addison-Wesley Professional ◦ Attention: Second Edition planned for June 2009

Recommended Reading

Lars Vogel 4/22/2009

top related