![Page 1: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/1.jpg)
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék
The New Generation of the Eclipse Platform
![Page 2: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/2.jpg)
Eclipse RCP▪ For developing client applications
o Based on the Eclipse workbench model o But without IDE functionality • Or possibly including a limited function set
▪ Since Eclipse 3.0 (2004) o Eclipse IDE is a specific Eclipse application
![Page 3: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/3.jpg)
Eclipse Application Platform 4.x▪ Rework of Eclipse RCP platform ▪ Goals
o Easier programming o Better reuse o Compatibility • Using a compatibility layer
3
![Page 4: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/4.jpg)
Eclipse Application Platform 4.x▪ Most important new functions
o Context handling • Platform service access • Dependency Injection
o EMF-‐based workbench model • Editor and view are not separate entities
o CSS based theming • RCP application should look different to IDE
![Page 5: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/5.jpg)
Glossary▪ e4
o Incubation project at eclipse.org o Collection of new generation techniques o Eclipse 4.x Application Platform started here
▪ Eclipse 4.x o New release of the platform o New services o Can be used a stable base software
![Page 6: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/6.jpg)
Accessing services
Based on the “What’s the context?” talk from EclipseCon 2009
6
![Page 7: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/7.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
![Page 8: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/8.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
Base class#getSite() .getSelectionProvider()
![Page 9: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/9.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
Base class#createPartControl(),
save(), …
![Page 10: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/10.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
Platform .getExtensionRegistry()
![Page 11: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/11.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
PlatformUI .getWorkbench()
![Page 12: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/12.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
ResourcesPlugin .getWorkspace()
![Page 13: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/13.jpg)
Service access -‐ 3.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Workbench access
…
![Page 14: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/14.jpg)
Singleton service providers
![Page 15: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/15.jpg)
Singleton service providers▪ Accessing common services
o Not always provided by the Platform itself
![Page 16: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/16.jpg)
Singleton service providers▪ Accessing common services
o Not always provided by the Platform itself
▪ Nice and comfortable solution o Simple client code o Information hiding: returning service interface
▪ …At first glance oWhat is the problem?
![Page 17: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/17.jpg)
Singleton service providers▪ Alternative providers?
o Service stub for testing o Remote services
▪ Reuse services at different locations o Using editor (or view) inside a dialog • E.g. textual editor in a Preference page
![Page 18: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/18.jpg)
Singleton service providers▪ Alternative providers?
o Service stub for testing o Remote services
▪ Reuse services at different locations o Using editor (or view) inside a dialog • E.g. textual editor in a Preference page
Environment hard-‐coded in a single plug-‐in
![Page 19: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/19.jpg)
Hardcoded environment -‐ example▪ Eclipse IDE
o Exactly one IWorkspace o Client: ResourcesPlugin.getWorkspace()
▪ Bespin IDE o Experimental project from 2009 (Mozilla) o IDE in the web o Goal: different IWorkspace instances for each user o Client • Removing singleton references is a lot of work
10
![Page 20: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/20.jpg)
Defining custom services▪ Singleton provider
o Such as Eclipse 3.x platform
▪ OSGi service o Easier to integrate • Manager classes for service access • OSGi code written by hand
o Declarative services • Direct integration problematic • Instantiation by DS or Eclipse?
11
![Page 21: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/21.jpg)
Event Handling – I.▪ Event
o If a data is interesting, usually its changes as well!
▪ Many event types o Service appearance/disappearance o Service specific listener • Resource changes • Selection Service
o User interface • Data binding • Editor/view lifecycle events
12
![Page 22: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/22.jpg)
Example: Workbench window change▪ Several thousand events
oMain cause: Complex event chains (event storm)
13
![Page 23: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/23.jpg)
Event Handling – II.▪ Problems
oMultiple event handling o Complex, implicit effects between listeners • Unnecessary event handling in inconsistent states • Event storm
o For simple cases • Many, repeated code • Easy to miss something
![Page 24: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/24.jpg)
Base problem▪ Problem
o Extension knows service provider
▪ Solution: indirection o Service provider is a parameter of a class o On extension instantiation • Collect services • Set up parameters
o Platform can do all of this • If it knows the list of available services
![Page 25: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/25.jpg)
Service access – 3.x
16
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Accessing Workbench
…
![Page 26: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/26.jpg)
Service access – 4.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Accessing Workbench
…
![Page 27: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/27.jpg)
Service access – 4.x
Custom view, editor
Selection
Lifecycle
Extension handling
Resources
Accessing Workbench
…
Context
![Page 28: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/28.jpg)
Context▪ Platform service access
o Built-‐in services • Resources, selection, etc.
o Properties • Preferences • Hierarchic key-‐value pairs
o OSGi services o Common event handling!
18
![Page 29: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/29.jpg)
Service access – I.▪ Context is accessed via
o Dependency injection (@inject annotation)
@Injectpublic void execute(@Named(IServiceConstants.SELECTION) @Optional IResource file) { // do something }
19
![Page 30: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/30.jpg)
Service access – I.▪ Context is accessed via
o Dependency injection (@inject annotation)
@Injectpublic void execute(@Named(IServiceConstants.SELECTION) @Optional IResource file) { // do something }
19
Lets inject...
![Page 31: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/31.jpg)
Service access – I.▪ Context is accessed via
o Dependency injection (@inject annotation)
@Injectpublic void execute(@Named(IServiceConstants.SELECTION) @Optional IResource file) { // do something }
19
Lets inject...
... the selection variable, ...
![Page 32: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/32.jpg)
Service access – I.▪ Context is accessed via
o Dependency injection (@inject annotation)
@Injectpublic void execute(@Named(IServiceConstants.SELECTION) @Optional IResource file) { // do something }
19
Lets inject...
... the selection variable, ...
... that might be empty ...
![Page 33: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/33.jpg)
Service access – I.▪ Context is accessed via
o Dependency injection (@inject annotation)
@Injectpublic void execute(@Named(IServiceConstants.SELECTION) @Optional IResource file) { // do something }
19
Lets inject...
... the selection variable, ...
... that might be empty ...
and has a type of IResource.
![Page 34: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/34.jpg)
Service access – II.▪ What happens in the background?
o Find variables from context o If matches parameters, it is transferred o If not, and • Optional => null value, callee handles this; • Not optional => inject error
o Used annotations based on JSR-‐330 specification • JSR 330: Dependency Injection for Java • http://jcp.org/en/jsr/detail?id=330
![Page 35: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/35.jpg)
Event Handling▪ Base class
o Queried value changes o Solved by dependency injection • In case of changes framework recalls method • Much fewer event handler required
▪ Internal optimalization o Notification only in consistent context states
![Page 36: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/36.jpg)
Model-‐based Workbench
![Page 37: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/37.jpg)
Workbench stucture▪ Strict hierarchy
oWindow o Site o Perspective o Editors and views
▪ In 3.x, defined in code o New instances set up via extensions
![Page 38: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/38.jpg)
Inheritance hierarchy▪ Common behaviour
o Defined in base classes o Not required to code all the time o Same behaviour all the time
24
![Page 39: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/39.jpg)
Inheritance hierarchy▪ Common behaviour
o Defined in base classes o Not required to code all the time o Same behaviour all the time
24
View
![Page 40: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/40.jpg)
Inheritance hierarchy▪ Common behaviour
o Defined in base classes o Not required to code all the time o Same behaviour all the time
24
View
Editor
![Page 41: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/41.jpg)
Inheritance hierarchy▪ Common behaviour
o Defined in base classes o Not required to code all the time o Same behaviour all the time
24
View
Editor
Textual editor
![Page 42: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/42.jpg)
New approach▪ Application model
o Describing the workbench structure • Does not contain the entire GUI (on the widget level) • Widget set independent
o Available during runtime • AND modifiable
![Page 43: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/43.jpg)
Custom model▪ Application model
o Basically one for an RCP application o Structure of the entire application
▪ Model fragment o Extensions to running application model o A single fragment replaces a large set of extensions • More understandable than scattered extensions
▪ Registration of models and fragments o Using a single extension point
![Page 44: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/44.jpg)
Application Models Extensibility
27
![Page 45: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/45.jpg)
Application Models Extensibility▪ Model fragments
o Contributed parts to application model oModels are merged • Fragments reusable in different applications
27
![Page 46: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/46.jpg)
Application Models Extensibility▪ Model fragments
o Contributed parts to application model oModels are merged • Fragments reusable in different applications
▪ Model processors o Programmed modifications of application model
27
![Page 47: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/47.jpg)
Application model▪ Technology: EMF model
oMetamodel available o Extensions possible
▪ Contains o Application window o Views and editors (commonly referred to as Part) • +layout
o Commands, menu
▪ Detailed documentation o http://wiki.eclipse.org/E4/UI/Modeled_UI
28
![Page 48: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/48.jpg)
Application model▪ Live model
o Synchronized with the GUI • User interactions are reflected here • Changes update the user interface
– E.g. programmatic opening of a View
oModel is serialized on save • State restore • Processed using basic EMF tools
29
![Page 49: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/49.jpg)
Workbench metamodel – not up to date!
30Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse-‐incubator-‐e4-‐dev/msg00222.html
![Page 50: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/50.jpg)
Workbench metamodel – not up to date!
30Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse-‐incubator-‐e4-‐dev/msg00222.html
![Page 51: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/51.jpg)
Workbench metamodel – not up to date!
31Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse-‐incubator-‐e4-‐dev/msg00222.html
Workbench window
Views and Editors
Menus and other elements
![Page 52: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/52.jpg)
Application model editor (e4 tools)
32
![Page 53: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/53.jpg)
Annotation based API▪ Implementing classes
o Free inheritance hierarchy o Lifecycle events via annotations o JSR 250: Common Annotations for the JavaTM Platform
33
![Page 54: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/54.jpg)
View example – 3.xpublic class SampleView extends ViewPart {
@Overridepublic void createPartControl(Composite parent) {
// TODO Auto-generated method stub}
@Overridepublic void setFocus() {
// TODO Auto-generated method stub}
@Overridepublic void dispose() {
// TODO Auto-generated method stub}
}
34
![Page 55: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/55.jpg)
View example – 4.xpublic class SampleView extends ViewPart {
@Override@PostConstructpublic void createPartControl(Composite parent) {
// TODO Auto-generated method stub}
@Override@Focuspublic void setFocus() {
// TODO Auto-generated method stub}
@Override@PreDestroypublic void dispose() {
// TODO Auto-generated method stub}
}
![Page 56: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/56.jpg)
View example – 4.xpublic class SampleView extends ViewPart {
@Override@PostConstructpublic void createPartControl(Composite parent) {
// TODO Auto-generated method stub}
@Override@Focuspublic void setFocus() {
// TODO Auto-generated method stub}
@Override@PreDestroypublic void dispose() {
// TODO Auto-generated method stub}
}
No inheritance
![Page 57: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/57.jpg)
View example – 4.xpublic class SampleView extends ViewPart {
@Override@PostConstructpublic void createPartControl(Composite parent) {
// TODO Auto-generated method stub}
@Override@Focuspublic void setFocus() {
// TODO Auto-generated method stub}
@Override@PreDestroypublic void dispose() {
// TODO Auto-generated method stub}
}
No inheritance
SzövegSzövegSemantic annotations
![Page 58: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/58.jpg)
View example – 4.xpublic class SampleView extends ViewPart {
@Override@PostConstructpublic void createPartControl(Composite parent) {
// TODO Auto-generated method stub}
@Override@Focuspublic void setFocus() {
// TODO Auto-generated method stub}
@Override@PreDestroypublic void dispose() {
// TODO Auto-generated method stub}
}
No inheritance
SzövegSzövegSemantic annotations
What are the benefits?
![Page 59: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/59.jpg)
Annotation based API
![Page 60: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/60.jpg)
Annotation based API▪ What have we gained?
o Free inheritance hierarchy • Any use is possible
o Container idependent code • Class is free to reuse
– Even outside Eclipse – Injection needs to be done
![Page 61: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/61.jpg)
Annotation based API▪ What have we gained?
o Free inheritance hierarchy • Any use is possible
o Container idependent code • Class is free to reuse
– Even outside Eclipse – Injection needs to be done
▪ What have we lost? o Compatibility with previous platform • If plug-‐ins not working, nobody will update
![Page 62: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/62.jpg)
Compatibility with 3.x API▪ Re-‐implement the base classes required by 3.x
o Use the new API
▪ Not a perfect clone o Smaller issues o API compatibility achieved
▪ Using 3.x and 4.x GUI parallel o Not supported officially (in 2012) o BUT: based on a EclipseCon ‘12 talk possible
![Page 63: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/63.jpg)
Compatibility with 3.x API▪ Re-‐implement the base classes required by 3.x
o Use the new API
▪ Not a perfect clone o Smaller issues o API compatibility achieved
▪ Using 3.x and 4.x GUI parallel o Not supported officially (in 2012) o BUT: based on a EclipseCon ‘12 talk possible
![Page 64: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/64.jpg)
Model processing during runtime
38Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
![Page 65: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/65.jpg)
Model processing during runtime
38Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
Complex renderer
![Page 66: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/66.jpg)
Model processing during runtime
38Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
Complex renderer
Replaceable
![Page 67: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/67.jpg)
Rendering Engines▪ SWT Presentation Engine
o Bundled with Eclipse o Relies on SWT o Compatible with old API
▪ JavaFX Renderer o Provided by e(fx)clipse project o Relies of JavaFX (requires Java 8) o Incompatible with old GUI plug-‐ins!
▪ RAP Renderer o RCP on the web (http://eclipsesource.com/blogs/2014/04/10/getting-‐started-‐with-‐eclipse4-‐applications-‐on-‐rap/)
o Details: next week
39
![Page 68: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/68.jpg)
Compatibility Layer▪ Application model implementation
o Processed extensions from 3.x API o Creates corresponding models
▪ Basically full API compatibility o Platform works as expected
40
![Page 69: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/69.jpg)
CSS based theming
41
![Page 70: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/70.jpg)
Application theming▪ Eclipse 3.x
o Partially possible • Colors, formatting stored and queried • Basically key-‐value pairs
– Not flexible enough
o How serious is this problem? • IDE
– Good question
• RCP application – “Must not look like the IDE!”
42
![Page 71: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/71.jpg)
Application theming▪ Eclipse 3.x
o Partially possible • Colors, formatting stored and queried • Basically key-‐value pairs
– Not flexible enough
o How serious is this problem? • IDE
– Good question
• RCP application – “Must not look like the IDE!”
42
![Page 72: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/72.jpg)
Theming – Contacts demo
43Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
![Page 73: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/73.jpg)
Theming – Contacts demo
43Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
![Page 74: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/74.jpg)
Theming – Contacts demo
43Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
![Page 75: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/75.jpg)
Theming – Contacts demo
43Forrás: Tom Schindl, Lars Vogel, Kai Tödter: Eclipse e4 tutorial, EclipseCon 2010
![Page 76: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/76.jpg)
Theming – Eclipse IDE▪ Styles
o Based on products oMore possible • Changes possible during runtime
▪ Unique attributes attached to widgets: Label label = new Label(parent, SWT.NONE);
label.setData("org.eclipse.e4.ui.css.id”, "SeparatorLabel");
![Page 77: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/77.jpg)
Theming in platform 4.x▪ Reasonably wide possibilities ▪ Report from EclipseCon ’12:
o CSS on E4 o http://holistictendencies.wordpress.com/2012/03/31/css-‐on-‐e4-‐eclipsecon/
▪
![Page 78: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/78.jpg)
New problems
![Page 79: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/79.jpg)
New Platform – New problems▪ Are there any?
47
![Page 80: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/80.jpg)
New Platform – New problems▪ Are there any?
▪ Performance problemso In some cases noticeable slowdowns• Platform team asks: report it (reproducibly)! ☺
47
![Page 81: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/81.jpg)
New Platform – New problems▪ Are there any?
▪ Performance problemso In some cases noticeable slowdowns• Platform team asks: report it (reproducibly)! ☺
▪ Service list is dynamico Exploration based learning• “How can I get the current selection?”
o Debugging• “Why do I get a null from the injector?”
47
![Page 82: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/82.jpg)
Summary
![Page 83: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/83.jpg)
Eclipse Application Platform 4.x▪ Platform advances
o Dependency injection o OSGi services as first-‐class citizens o New services • Theming • Better event handling
o Sadly: new bugs • Sometimes performance issues
▪ But this is the future oWorth learning it
49
![Page 84: The$New$Generation$of the$Eclipse$Platform...Eclipse$RCP For$developing$clientapplications$ oBased$on$the$Eclipse$workbench$model$ oButwithoutIDE$functionality $ • Or$possibly$including$alimited$function$set](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaf45df923d0076f820dd1d/html5/thumbnails/84.jpg)
Sources, additional materials▪ e4 wiki
o http://wiki.eclipse.org/E4 ▪ Eclipse 4 wiki
o http://wiki.eclipse.org/Eclipse4 ▪ John Arthorne, Paul Webster, Boris Bokowski, Oleg Besedin: What’s the context? o http://www.eclipse.org/e4/resources/contexts.pdf
▪ Wim Jongman: Why Eclipse 4? (the Egg Laying WoolMilkPig) o http://industrial-‐tsi-‐wim.blogspot.hu/2012/10/why-‐eclipse-‐e4-‐egg-‐laying-‐woolmilkpig.html
50