40
Eclipse Rich Client Platform The amazing simplicity of creating RCP application Lars Vogel http://www.vogella.de

Eclipse RCP Overview @ Rheinjug

Embed Size (px)

DESCRIPTION

Eclipse RCP Overview

Citation preview

Page 1: Eclipse RCP Overview @ Rheinjug

Eclipse Rich Client Platform

The amazing simplicity of creating RCP application

Lars Vogelhttp://www.vogella.de

Page 2: Eclipse RCP Overview @ Rheinjug

• What is RCP?

• OSGi

• Modular Architecture

• RCP

• e4 (lets see if we have time….)

… and some life hacking

Agenda

Page 3: Eclipse RCP Overview @ Rheinjug

• Local running application using the native widget toolkit

• Based on the Eclipse runtime and technology

What is an Eclipse RCP application?

Page 4: Eclipse RCP Overview @ Rheinjug

Eclipse (RCP) applications are written in

Java

in little pieces (plugins)

Page 5: Eclipse RCP Overview @ Rheinjug

Extensible Application - Firefox

Plugins The Browser

Page 6: Eclipse RCP Overview @ Rheinjug

OSGiDynamic module system in Java

Page 7: Eclipse RCP Overview @ Rheinjug

Bundle

Smallest deployment and development component in OSGi

Bundle == Plugin

BundlePlugin

Page 8: Eclipse RCP Overview @ Rheinjug

Each Plugin defines its

available API

Page 9: Eclipse RCP Overview @ Rheinjug

Each Plugin defines also its dependencies

Page 10: Eclipse RCP Overview @ Rheinjug

MANIFEST.MF –

Additional metadata for OSGi runtime

Page 11: Eclipse RCP Overview @ Rheinjug

Runtime (OSGi) makes sure the API contacts are

fulfilled

Page 12: Eclipse RCP Overview @ Rheinjug

Demo

Page 13: Eclipse RCP Overview @ Rheinjug

Standard Java App Modular Java App

OSGi – Enforced Modularity

Page 14: Eclipse RCP Overview @ Rheinjug

Anatomy of Eclipse RCP

Page 15: Eclipse RCP Overview @ Rheinjug

In Eclipse everything is a plugin (except the core runtime)

Runtime

Plugin

PluginPlugin

Plugin

Plugin

Page 16: Eclipse RCP Overview @ Rheinjug

Eclipse IDE

Runtime / Equinox (OSGi)SWT

JFace

Workbench

Resources

IDE personality

Help P2 Update Text Compare Debug Search Team/ cvs

Page 17: Eclipse RCP Overview @ Rheinjug

• Component model• Rich user experience • OS independent• Extensible• Community• e4

Why Eclipse RCP?

Page 18: Eclipse RCP Overview @ Rheinjug

Eclipse Plugins

Your plugins

Page 19: Eclipse RCP Overview @ Rheinjug

Eclipse RCP

Runtime / Equinox (OSGi)SWT

JFace

Workbench

Your data model

Your UI LayerHelpP2

Update Other Stuff

Your Server communication

Your Security

Page 20: Eclipse RCP Overview @ Rheinjug

A closer look

Page 21: Eclipse RCP Overview @ Rheinjug

Your first RCP app in < 10 secs

Page 22: Eclipse RCP Overview @ Rheinjug

• Defines OSGi bundle properties

Important configuration file- MANIFEST.MF -

You said that already in the OSGi chapter ….

Page 23: Eclipse RCP Overview @ Rheinjug

• Defines extensions and extension points

Important configuration files- plugin.xml -

Page 24: Eclipse RCP Overview @ Rheinjug

Extensions

Extension Points

Provide functionality to predefined slots (== extension points)

Define places where others (== extensions) can provide functionality

Page 25: Eclipse RCP Overview @ Rheinjug

The building blocks

Page 26: Eclipse RCP Overview @ Rheinjug

• Thin layer upon the native GUI libraries • JNI calls• Not a lot of convenient functionality

SWT - Standard Widget Toolkit

Page 27: Eclipse RCP Overview @ Rheinjug

• JFace– UI toolkit that provides helper classes for developing UI

features– Makes SWT nicer but does not hide its complexity– Tables / TreeViewer / Dialogs / – Databinding

• Workbench – multi-window environment – manages views, editors, perspectives

JFace & Workbench

Page 28: Eclipse RCP Overview @ Rheinjug

Lets create a RCP app

Page 29: Eclipse RCP Overview @ Rheinjug

• 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

29

Excursus: Plug-in Spy

Lars Vogel 4/22/2009

How did he do it?

Plugin Spy = Shortcut Alt+Shift+F1

Page 30: Eclipse RCP Overview @ Rheinjug

e4 ?

Page 31: Eclipse RCP Overview @ Rheinjug

Eclipse e4

Eclipse e4 is the incubator project which will produce the Eclipse 4.0 SDK

Page 32: Eclipse RCP Overview @ Rheinjug

Eclipse e4 Scope

Make development for Eclipse easier

Page 33: Eclipse RCP Overview @ Rheinjug

Eclipse 3.x programming model

• Complex

• Lots of API

• Platform functionality via singletons

• Not easy to test

• Not a consistent way to define the UI

Page 34: Eclipse RCP Overview @ Rheinjug

Eclipse e4 – Building blocks

Declarative Styling

Modeled Workbench

Rendering Engine

Dependecy Injection

Context

Core Services

Page 35: Eclipse RCP Overview @ Rheinjug

Summary

Page 36: Eclipse RCP Overview @ Rheinjug

Eclipse: Where to go from here:

Eclipse Wikihttp://wiki.eclipse.org/

Eclipse RCP Tutorialhttp://www.vogella.de/articles/RichClientPlatform/article.html

Eclipse Plugin Development http://www.vogella.de/articles/EclipsePlugIn/article.html

Eclipse e4 Tutorialhttp://www.vogella.de/articles/EclipseE4/article.html

Page 37: Eclipse RCP Overview @ Rheinjug

Photo credits

• Clothes http://www.sxc.hu/photo/418618• Agenda http://www.sxc.hu/photo/1089869• Dotted guy http://www.sxc.hu/photo/1103660• RCP Definition http://www.sxc.hu/photo/930468• OSGI Defintion

http://www.sxc.hu/photo/975495• Building block http://www.sxc.hu/photo/596908• Where to go http://www.sxc.hu/photo/448543• Hurt fingers http://www.sxc.hu/photo/906072• Police http://www.sxc.hu/photo/860421• API http://www.sxc.hu/photo/603920• Plugin vrs. bundles

http://www.sxc.hu/photo/1010558• Manifst.mf http://www.sxc.hu/photo/764999• Structured vrs. chaos

• http://www.sxc.hu/photo/941292• Why RCP http://www.sxc.hu/photo/660438• Woman with phone

http://www.sxc.hu/photo/485640• Funny guy http://www.sxc.hu/photo/1173019• Dependencies http://www.sxc.hu/photo/182575• Extension http://www.sxc.hu/photo/721092• Dog http://www.sxc.hu/photo/302062• Plugin spy http://www.sxc.hu/photo/130484• Lego http://www.sxc.hu/photo/338038• e4 target http://www.sxc.hu/photo/839037• Summary http://www.sxc.hu/photo/1184807• Question http://www.sxc.hu/photo/418215• Reading material

http://www.sxc.hu/photo/406547• Thank you http://www.sxc.hu/photo/986313

Page 38: Eclipse RCP Overview @ Rheinjug
Page 39: Eclipse RCP Overview @ Rheinjug

Thank you

For further questions:

[email protected]://www.vogella.dehttp://www.twitter.com/vogella

Page 40: Eclipse RCP Overview @ Rheinjug

License & Acknowledgements

• This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License

– See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US