The New Generation of the Eclipse Platform. Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

Similar documents
About Tom. CEO BestSolution Systemhaus GmbH. Eclipse Committer. Platform UI EMF. Projectlead: UFaceKit, Nebula. Member of the Architectual Council

Eclipse 4 Eclipse Day Toulouse 24 mai 2012

Single Sourceing for Eclipse 4.x and 3.x

Kai Tödter Siemens Corporate Technology

Migration to E4. Eclipse Con France 2016

Technical Debt in Eclipse Development. Eclipse Con France 2018

Eclipse 4.0. Jochen Krause EclipseSource

Web Applica+on Development. Budapes( Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

Eclipse 4. Brian de Alwis. Abstract

Eclipse 4 Application Platform

e4 Project 0.9 Release Review

The Eclipse Rich Ajax Platform

Eclipse 4 Programming Model and Practices. Jin Mingjian

RAP (The Rich Ajax Platform)

Foundations of User Interface Programming Using the Eclipse Rich Client Platform

I A D P A T A B L E A N D W O R K B E N C H

Eclipse on Cell phones?

Testing Eclipse plug-ins: Tips & Tricks

Developing Rich Clients with Eclipse 4.x RCP

Workbench Selection 2/15

Eclipse 4.x Compatibility Layer: What's hot? What's not?

eclipse rich ajax platform (rap)

How we reached 0 technical debt in our Eclipse project

Rich Client GUI's with RCP & RAP

Advanced User Interface Programming Using the Eclipse Rich Client Platform

Workbench and JFace Foundations. Part One, of a two part tutorial series

Component-Based Development

WindowBuilder Graduation & Release Review

ECLIPSE RICH CLIENT PLATFORM

Model Driven Development with EMF and EclipseLink (experiences in MDD and generating user interfaces)

Patterns and Best Practices for Dynamic OSGi Applications

Goulwen Le Fur Obeo EclipseCon NA 2014

Lessons learned from building Eclipse-based add-ons for commercial modeling tools

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

Programming ArchiTech

eclipse.org. Tom Schindl

Patterns and Best Practices for dynamic OSGi Applications

Eclipse Data Binding - Updating RCP Mail 2.0 Handout

Smart Client development with the Eclipse Rich Client Platform

Common Navigator Framework

Eclipse Platform Rise and Shine Javaland 2016

Introduction to Eclipse Rich Client Platform Support in IBM Rational HATS. For IBM System i (5250)

open source RCP Eclipse based Visualization analysis Python Workflow

Introduction to Eclipse Rich Client Platform Support in IBM Rational HATS For IBM System i (5250)

Getting the Most from Eclipse

First Steps in RCP. Jan Blankenhorn, WeigleWilczek GmbH, Stuttgart, Germany. February 19th, 2009

Target Management New and Noteworthy. Martin Oberhuber, Wind River

JavaFX Codeeditors. Tom Schindl

The Next Generation of Eclipse: e4. Mike Milinkovich Executive Director Eclipse Foundation

Lesson learned from using EMF to build Desktop & Web Applications. Ludwigsburg, Oct

Developing Eclipse Rich-Client Applications Tutorial

Start Up Benoît Langlois / Thales Global Services Eclipse (EMFT) EGF 2011 by Thales; made available under the EPL v1.

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1

Eclipse + Html: A Journey

Creating an Eclipse View

Tools to Develop New Linux Applications

Equinox Project 3.6 Release Review

QOOMdOO. 1 open source I community experience distilled. Beginner's Guide. Develop Rich Internet Applications (RIA) with qooxdoo. Rajesh Kumar Bachu

Beware: Testing RCP Applications in Tycho can cause Serious Harm to your Brain. OSGi p2

ApacheCon NA How to Avoid Common Mistakes in OFBiz Development Presented by Adrian Crum

20. Eclipse and Framework Extension Languages

Implementation of a 2D Graph Viewer

Regular Forum of Lreis. Speechmaker: Gao Ang

News in RSA-RTE 10.2 updated for sprint Mattias Mohlin, May 2018

Introduction to EGF. Benoît Langlois / Thales Global Services.

ADT: Eclipse development tools for ATL

The Eclipse Rich Client Platform

EMF Compare Ganymede Simultaneous Release

Mobile Application Workbench. SAP Mobile Platform 3.0 SP02

DTP Help-Helper for Dynamic Context-Sensitive Help

Semantic Web T LS Update

Eclipse project update by the Eclipse project PMC March 11 th 2008

Introduction to Eclipse

The Definitive Guide to. NetBeans Platform 7. Heiko Bock. Apress*

An Eclipse-based Environment for Programming and Using Service-Oriented Grid

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Java EE 6: Develop Web Applications with JSF

Introduction to Eclipse

Comparing graphical DSL editors

What is Wazaabi 2.0? Declarative UI framework. based on. live EMF model(s)

API Tooling in the Eclipse SDK

EMF Europa Simultaneous Release

Mitglied der Helmholtz-Gemeinschaft. Eclipse Parallel Tools Platform (PTP)

From Design Patterns: Elements of Reusable Object Oriented Software. Read the sections corresponding to patterns covered in the following slides.

Complex Event Processing A brief overview

Distributed Objects. Object-Oriented Application Development

JQueryScapes: customizable Java code perspectives

CA ERwin Data Modeler

An Introduction to Eclipse: Quick Guide. Part 1: Getting Started with Eclipse Part 2: Working with Eclipse Useful Online Guides

Eclipse Building Commercial-Quality Plug-ins Second Edition

UML PROFILING AND DSL

SAP Edge Services, cloud edition Edge Services Predictive Analytics Service Guide Version 1803

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, November 2017

Simulate This! - The Eclipse Platform as an Integrated Computational Environment

EGit/Gerrit Hands-on training #1: Installation and Configuration

Oracle Application Development Framework Overview

XWT Declarative UI for Eclipse

Android Essentials with Java

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, January 2018

CS 349 / SE 382 Design Patterns. Professor Michael Terry January 21, 2009

Transcription:

The New Generation of the Eclipse Platform Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

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

Eclipse Application Platform 4.x Rework of Eclipse RCP platform Goals o Easier programming o Better reuse o Compatibility Using a compatibility layer 3

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

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

Accessing services Based on the What s the context? talk from EclipseCon 2009 6

Service access - 3.x Selection Lifecycle Custom view, editor Extension handling Workbench access Resources

Service access - 3.x Selection Base class#getsite().getselectionprovider() Lifecycle Custom view, editor Extension handling Workbench access Resources

Service access - 3.x Selection Base class# createpartcontrol(), save(), Custom view, editor Lifecycle Extension handling Workbench access Resources

Service access - 3.x Selection Lifecycle Custom Platform.getExtensionRegistry() view, editor Extension handling Workbench access Resources

Service access - 3.x Selection Lifecycle Custom view, editor PlatformUI.getWorkbench() Extension handling Workbench access Resources

Service access - 3.x Selection Lifecycle Custom view, editor ResourcesPlugin.getWorkspace() Resources Extension handling Workbench access

Service access - 3.x Selection Lifecycle Custom view, editor Extension handling Workbench access Resources

Singleton service providers

Singleton service providers Accessing common services o Not always provided by the Platform itself

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 o What is the problem?

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

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

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

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

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

Example: Workbench window change Several thousand events o Main cause: Complex event chains (event storm) 13

Problems o Multiple event handling Event Handling II. 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

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

Service access 3.x Selection Lifecycle Custom view, editor Extension handling Accessing Workbench Resources 16

Service access 4.x Selection Lifecycle Custom view, editor Extension handling Accessing Workbench Resources

Service access 4.x Selection Context Lifecycle Custom view, editor Extension handling Accessing Workbench Resources

Platform service access o Built- in services Resources, selection, etc. o Properties Preferences Hierarchic key- value pairs o OSGi services Context o Common event handling! 18

Service access I. Context is accessed via o Dependency injection (@inject annotation) @Inject public void execute (@Named(IServiceConstants.SELECTION) @Optional IResource file) { } // do something 19

Service access I. Context is accessed via o Dependency injection (@inject annotation) @Inject public void execute (@Named(IServiceConstants.SELECTION) @Optional IResource file) { } // do something Lets inject... 19

Service access I. Context is accessed via o Dependency injection (@inject annotation) @Inject public void execute (@Named(IServiceConstants.SELECTION) @Optional IResource file) { } // do something Lets inject...... the selection variable,... 19

Service access I. Context is accessed via o Dependency injection (@inject annotation) @Inject public void execute (@Named(IServiceConstants.SELECTION) @Optional IResource file) { } // do something Lets inject...... the selection variable,...... that might be empty... 19

Service access I. Context is accessed via o Dependency injection (@inject annotation) @Inject public void execute (@Named(IServiceConstants.SELECTION) @Optional IResource file) { } // do something and has a type of IResource. Lets inject...... the selection variable,...... that might be empty... 19

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

Base class o Queried value changes Event Handling 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

Model- based Workbench

Strict hierarchy o Window o Site o Perspective o Editors and views Workbench stucture In 3.x, defined in code o New instances set up via extensions

Common behaviour o Defined in base classes Inheritance hierarchy o Not required to code all the time o Same behaviour all the time 24

Common behaviour o Defined in base classes Inheritance hierarchy o Not required to code all the time o Same behaviour all the time View 24

Common behaviour o Defined in base classes Inheritance hierarchy o Not required to code all the time o Same behaviour all the time View Editor 24

Inheritance hierarchy Common behaviour o Defined in base classes o Not required to code all the time o Same behaviour all the time View Textual editor Editor 24

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

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

Application Models Extensibility 27

Application Models Extensibility Model fragments o Contributed parts to application model o Models are merged Fragments reusable in different applications 27

Application Models Extensibility Model fragments o Contributed parts to application model o Models are merged Fragments reusable in different applications Model processors o Programmed modifications of application model 27

Technology: EMF model o Metamodel available o Extensions possible Contains o Application window Application model 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

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 o Model is serialized on save State restore Processed using basic EMF tools 29

Workbench metamodel not up to date! Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse- incubator- e4- dev/msg00222.html 30

Workbench metamodel not up to date! Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse- incubator- e4- dev/msg00222.html 30

Workbench metamodel not up to date! Menus and other elements Views and Editors Workbench window Forrás: http://dev.eclipse.org/mhonarc/lists/eclipse- incubator- e4- dev/msg00222.html 31

Application model editor (e4 tools) 32

Annotation based API Implementing classes o Free inheritance hierarchy o Lifecycle events via annotations o JSR 250: Common Annotations for the Java TM Platform 33

View example 3.x public class SampleView extends ViewPart { @Override public void createpartcontrol(composite parent) { // TODO Auto-generated method stub } @Override public void setfocus() { // TODO Auto-generated method stub } @Override public void dispose() { // TODO Auto-generated method stub } } 34

View example 4.x public class SampleView extends ViewPart { @Override@PostConstruct public void createpartcontrol(composite parent) { // TODO Auto-generated method stub } @Override@Focus public void setfocus() { // TODO Auto-generated method stub } @Override@PreDestroy public void dispose() { // TODO Auto-generated method stub } }

View example 4.x public class SampleView extends ViewPart { @Override@PostConstruct public void createpartcontrol(composite parent) { // TODO Auto-generated method stub } @Override@Focus public void setfocus() { // TODO Auto-generated method stub } @Override@PreDestroy public void dispose() { // TODO Auto-generated method stub } No inheritance }

View example 4.x public class SampleView extends ViewPart { @Override@PostConstruct public void createpartcontrol(composite parent) { // TODO Auto-generated method stub } Semantic Szöveg annotations @Override@Focus public void setfocus() { // TODO Auto-generated method stub } @Override@PreDestroy public void dispose() { // TODO Auto-generated method stub } No inheritance }

View example 4.x public class SampleView extends ViewPart { @Override@PostConstruct public void createpartcontrol(composite parent) { // TODO Auto-generated method stub } Semantic Szöveg annotations @Override@Focus public void setfocus() { // TODO Auto-generated method stub } No inheritance } @Override@PreDestroy public void dispose() { // TODO Auto-generated method stub } What are the benefits?

Annotation based API

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

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

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

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

Model processing during runtime Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 38 Eclipse e4 tutorial, EclipseCon 2010

Model processing during runtime Complex renderer Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 38 Eclipse e4 tutorial, EclipseCon 2010

Model processing during runtime Complex renderer Replaceable Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 38 Eclipse e4 tutorial, EclipseCon 2010

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

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

CSS based theming 41

Eclipse 3.x o Partially possible Application theming 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

Eclipse 3.x o Partially possible Application theming 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

Theming Contacts demo Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 43 Eclipse e4 tutorial, EclipseCon 2010

Theming Contacts demo Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 43 Eclipse e4 tutorial, EclipseCon 2010

Theming Contacts demo Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 43 Eclipse e4 tutorial, EclipseCon 2010

Theming Contacts demo Forrás: Tom Schindl, Lars Vogel, Kai Tödter: 43 Eclipse e4 tutorial, EclipseCon 2010

Styles o Based on products o More possible Theming Eclipse IDE Changes possible during runtime Unique attributes attached to widgets: Label label = new Label(parent, SWT.NONE); label.setdata("org.eclipse.e4.ui.cs s.id, "SeparatorLabel");

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/

New problems

New Platform New problems Are there any? 47

New Platform New problems Are there any? Performance problems o In some cases noticeable slowdowns Platform team asks: report it (reproducibly)! 47

New Platform New problems Are there any? Performance problems o In some cases noticeable slowdowns Platform team asks: report it (reproducibly)! Service list is dynamic o Exploration based learning How can I get the current selection? o Debugging Why do I get a null from the injector? 47

Summary

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 o Worth learning it 49

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