Eclipse e4
Upcoming SlideShare
Loading in...5
×
 

Eclipse e4

on

  • 11,235 views

A presentation I gave at the AustinJUG.

A presentation I gave at the AustinJUG.

Statistics

Views

Total Views
11,235
Slideshare-icon Views on SlideShare
11,199
Embed Views
36

Actions

Likes
2
Downloads
62
Comments
0

2 Embeds 36

http://www.slideshare.net 35
http://www.lmodules.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Eclipse e4 Eclipse e4 Presentation Transcript

  • Eclipse e4 Chris Aniszczyk Principal Software Engineer, Red Hat http://aniszczyk.org http://www.twitter.com/caniszczyk
  • Agenda Why e4? Eclipse 3.X and e4 l e4 workbench mode Styling and Services Compatibility Layer
  • The e4 project e4 is an Eclipse.org project for platform-related incubation, it’s not a product! The Eclipse Platform needs to innovate to remain viable.
  • Why e4? • Innovate or become irrelevant • Use e4 technologies as a basis for Eclipse 4.0 (some will show up in the 3.x stream) • Engage the open source community • Build a better Eclipse – Make it more flexible – Prepare for the web – Fix our mistakes
  • So, what’s wrong with Eclipse 3.X?
  • Problems with Eclipse 3.x • Complex • Lots of API • Platform functionality via singletons • Not easy to test • Not a consistent way to define the UI • UI makes assumptions, e.g. Editors / Views • Easy Skinning • The browser is more powerful now... RIAs...
  • Eclipse Competition...
  • If only Eclipse application development would be easier... 8
  • Eclipse e4 – Building blocks Declarative Styling Rendering Engine Modeled Workbench Dependency Injection IEclipseContext Core Services
  • Eclipse e4 – Add-ons XWT Open Social Gadgets Toolkit Model
  • The Modeled Workbench
  • The e4 Workbench Model Each application has its live model... think of the browser DOM... • Built using EMF • Workbench window – Menu with menu items – Window Trim, e.g. toolbar with toolbar items – Parts Sash Container • Parts – Part Stack (CTabFolder) • Parts – Handlers – Key Bindings – Commands
  • Why the Eclipse Modeling Framework (EMF)? Standard modeling technology in Eclipse IfIf I only had a consistent I only had a consistent view and behavior of the Proven domain model technology view and behavior of the Eclipse workbench optimized runtime (1.5 MB) Eclipse workbench Small and Tooling available Tap in to the EMF and modeling ecosystem
  • The Model is Flexible No distinction between View/ Editor Perspectives are optional Stack / Sash are optional Several windows easily possible Flexible Toolbars
  • Attention: IfIf I only had a consistent I only had a consistent In viewandcontext the e4 view and behavior ofof the behavior of the a view and an Eclipse workbench editor are both so called Parts. Eclipse workbench
  • Defining the model User changes Base Model provided by: Application.e4xmi Contributions possible via extension point org.eclipse.e4.workbench.model Model Components Model can be dynamically changed by User or Code Application.e4xmi User model changes can be stored Application.e4xmi
  • Limits of an e4 application • Only models the Application (frame) Modeled Workbench
  • Limits of an e4 application • Only models the Application (frame) Modeled Workbench Content of the view not part of the e4 model
  • Parts in e4 Plain Old Java Objects (POJO‘s)
  • Before e4... inheritance ruled... OBJECT EVENTMANAGER WORKBENCHPART VIEWPART VIEW
  • How is this model translated into UI components?
  • Model and UI Renderers Model I don’t care who draws me • The Workbench model is independent of a specific UI toolkit
  • Renderers Renderer Factory Eclipse default is the SWT Renderer Can be selected at Startup via parameter
  • Renderers Renderer Factory Widget Renderer Returns for every model element
  • Widget Renderer • Each UI elements gets a renderer • Renderer manage Lifecycle of the UI- Element – Creation – Model to widget binding – Rendering – Disposal
  • e4 and Styling
  • Styling in Eclipse 3.x • UI styling via – The Presentation API – Custom Widgets • Very limited
  • In reality all RCP apps look like the an IDE
  • Eclipse 3.X - IDE Eclipse e4 – CSS Styling feeling Example from Kai Toedter Some elements cannot currently not be styled: • Menu bar background • Table headers e4 supports theme switching during runtime
  • How to enable CSS Styling Property "applicationCSS” in extension point org.eclipse.core.runtime.products <extension id="product" point="org.eclipse.core.runtime.products"> <product application="org.eclipse.e4.ui.workbench.swt.application" name="E4 Contacs Demo"> <property name="applicationCSS" value="platform:/plugin/contacts/css/dark.css"> </property> </product> </extension>
  • Example CSS Label { font: Verdana 8px; color: rgb(240, 240, 240); } Table { background-color: gradient radial #575757 #101010 100%; color: rgb(240, 240, 240); font: Verdana 8px; } ToolBar { background-color: #777777 #373737 #202020 50% 50%; color: white; font: Verdana 8px; }
  • Assign custom attributes • Java Label label = new Label(parent, SWT.NONE); label.setData("org.eclipse.e4.ui.css.id", "SeparatorLabel"); • CSS #SeparatorLabel { color: #f08d00; }
  • New Look & Feel for Eclipse e4 – SDK https://bugs.eclipse.org/bugs/show_bug.cgi?id=293481
  • The e4 Programming Model
  • Dependency Injection • Inversion of control: The necessary functionality is injected into the class s va Clas Ja
  • Dependency Injection in e4 • JSR 330 compatible injection implementation – @javax.inject.Inject – Field, Constructor and Method injection – @javax.inject.Named – Specify a custom qualifier to context object (default is fully qualified classname of the injected type) • e4 specific annotations... @Optional
  • s va Clas Ja Services are injected via the the e4 framework public class ListView { @Inject private IEclipseContext context; @Inject private Logger logger; @Inject public ListView(Composite parent) { // ...
  • IEclipseContext – Stores information of possible Injection Values – Hierarchical data structure – OSGi Services part of the Context – Dynamic context information: Possibility to contribute an IContextFunction through DS to construct Objects on the fly
  • Services
  • Eclipse Application Services (“Twenty Things”)  Editor lifecycle  Long-running  Receiving input operations  Producing selection  Progress reporting  Standard dialogs  Error handling  Persisting UI state  Navigation model  Logging  Resource management  Interface to help  Status line system  Drag and drop  Menu contributions  Undo/Redo  Authentication  Accessing preferences  Authorization  Don‘t forget: OSGi services are also available via dependency injection
  • Compatibility Layer
  • Compatibility Layer • Compatibility layer centers around org.eclipse.ui.workbench – Contains code to host 3.x API on e4 • Note: The 3.x workbench API with some exceptions... – org.eclipse.ui.presentations – org.eclipse.ui.themes – Activities and Capabilities • API clean plug-ins will run fine
  • Eclipse 4.0 SDK
  • Thanks for listening! For further questions: caniszczyk@gmail.com http://aniszczyk.org http://twitter.com/caniszczyk
  • e4: Where to go from here Eclipse e4 Website http://www.eclipse.org/e4 Eclipse e4 Wiki http://wiki.eclipse.org/E4 Eclipse e4 Whitepaper http://www.eclipse.org/e4/resources/e4-whitepaper.php
  • License & Acknowledgements • This work is licensed under: – http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US • Thank you... – Boris Bokowski, IBM – Tom Schindl, BestSolution – Kai Tödter, Siemens AG – Lars Vogel, SAP AG