26
Eclipse Rich Client Platform (RCP) Introduction 1 Lars Vogel 4/22/2009

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

Embed Size (px)

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

Citation preview

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

1

Eclipse Rich Client Platform (RCP)Introduction

Lars Vogel 4/22/2009

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

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

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

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 ?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

14

Key components of Eclipse RCP

Runtime / EquinoxSWT

JFace

Workbench

Other Plug-ins…

Lars Vogel 4/22/2009

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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