Eclipse 4.0 <br />….also known as Eclipse e4<br />Lars Vogel<br />http://www.vogella.de<br />http://www.twitter.com/vogell...
Eclipse e4 -Agenda <br />What is e4?<br />Whom does e4 try to help?<br />Building blocks<br />Q&A<br />
Eclipse e4<br />Eclipse e4 is the incubator project which will produce the Eclipse 4.0 SDK <br />
How does Eclipse e4  help me?<br />
Java ME<br />Java EE<br />Java SE<br />Android, Spring, GWT,…. <br />
Eclipse e4 Scope<br />Make developmentfor Eclipseeasier<br />
from Eclipse Developer<br />Eclipse E4<br />to Eclipse Developer<br />
At the beginning Eclipse e4 will not produce valuable functionality for the user of the Eclipse IDE……<br />
Mid- and long term …much better tooling<br />By modernizing the Eclipse programming model the user will benefit from the i...
So, what’s wrong with Eclipse 3.X?<br />
Eclipse 3.x programming model<br />Complex<br />Lots of API<br />Platform functionality via singletons<br />Not easy to te...
Inheritance in Eclipse 3.X<br />Object<br />EventManager<br />WorkbenchPart<br />ViewPart<br />View<br />
The smallest Eclipse RCP app in Eclipse 3.X<br />Already looks like the Eclipse IDE<br />Lots of boilerplate code <br />
If only Eclipse development would be easier and more visual appealing.<br />14<br />
The first amazing change <br />Eclipse e4 uses Java 1.5 language features!<br />AAbout time I would say….<br />
Eclipse e4 – Building blocks<br />Modeled Workbench<br />Rendering Engine<br />Declarative Styling<br />Dependecy Injectio...
The Modeled Workbench<br />
The e4 Workbench Model<br />e4 Workbench Model<br />EMF inside<br />
The e4 Workbench Model<br />Workbench window <br />Menu with menu items <br />Window Trim, e.g. toolbar with toolbar items...
Model is Flexible<br />No distinction between View and Editor<br />Perspectives are optional<br />Stack / Sash are optiona...
Model removes the need for boilerplate code<br />Minimal Eclipse e4 app: zero classes<br />
Model URI’s<br />The Part in the Model<br />The Part’s URI<br />
Lessions learned from Java Web development<br />The POJO* has won!<br />* Plain Old Java Objects<br />
Model Elements in e4<br />POJO‘s<br />
Usage of annotations<br />Annotations are used<br />To indicate which methods are called<br />
Model available at runtime<br />
Limits of the e4 application model<br />Only models the Application (frame)<br />Modeled Workbench<br />Content of the ind...
How is this model translated into UI components?<br />© Lars Vogel and others, Licensed under Creative Commons by-nc-nd-3....
Model and UI Renderers<br />Model<br />I don’t care who draws me<br />The Workbench model is independent of a specific UI ...
Renderers<br />Widget Renderer<br />Renderer Factory<br />Returns for every model element <br />Standard SWT renderer can ...
Renderer: flexible but complex<br />
e4 CSS Styling<br />
In reality all RCP apps look like the an IDE <br />
Eclipse3.X  - IDE feeling<br />Eclipse e4 – CSS Styling<br />Example from Kai Toedter<br />Limitations for:<br /><ul><li> ...
 Table headers </li></ul>e4 supports theme switching during runtime<br />
How to enable CSS Styling<br />Extension point "org.eclipse.e4.ui.css.swt.theme“ defines the style sheet<br /><extension<b...
How to enable CSS Styling<br />Property "cssTheme” for extension point "org.eclipse.core.runtime.products"  selects the in...
Example CSS<br />Label {<br />   font: Verdana 8px;<br />   color: rgb(240, 240, 240);<br />}<br />Table {<br />   backgro...
Java<br />Label label = <br />new Label(parent, SWT.NONE);<br />label.setData("org.eclipse.e4.ui.css.id", <br />"Separator...
New Look & Feel for Eclipse 4.0 – SDK <br />https://bugs.eclipse.org/bugs/show_bug.cgi?id=293481<br />
The e4 Programming Model<br />
Dependency Injection<br />Inversion of control: The necessary functionality is injected into the class<br />Java Class<br />
Dependency Injection in e4<br />JSR 330 compatible injection implementation<br />@javax.inject.Inject – Field, Constructor...
Java Class<br />	Services are injected via the the e4 framework<br />publicclassListView {<br />   @Inject<br />   private...
Lifecycle<br /><ul><li>@PostConstruct: Called after Object created and Fields- and Methods-Injection finished
@PreDestroy: Called before the object is destroyed (e.g. the Part shown in the UI is removed)</li></li></ul><li>What can b...
IEclipseContext<br />Stores information of possible Injection Values<br />OSGi Services part of the Context<br />Define yo...
Example: Writing Handlers<br />Method identified via @Execute annotation<br />Can have any number of arguments<br />Use IS...
Services<br />© Lars Vogel and others, Licensed under Creative Commons by-nc-nd-3.0 (de) <br />
Eclipse Application Services (“Twenty Things”)<br /><ul><li>Long-running operations
Progress reporting
Error handling
Navigation model
Resource management
Status line
Drag and drop
Undo/Redo
Upcoming SlideShare
Loading in...5
×

Eclipse e4 on Java Forum Stuttgart 2010

3,733

Published on

Overview of Eclipse e4.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,733
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
41
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Eclipse e4 on Java Forum Stuttgart 2010

  1. 1. Eclipse 4.0 <br />….also known as Eclipse e4<br />Lars Vogel<br />http://www.vogella.de<br />http://www.twitter.com/vogella<br />
  2. 2. Eclipse e4 -Agenda <br />What is e4?<br />Whom does e4 try to help?<br />Building blocks<br />Q&A<br />
  3. 3. Eclipse e4<br />Eclipse e4 is the incubator project which will produce the Eclipse 4.0 SDK <br />
  4. 4. How does Eclipse e4 help me?<br />
  5. 5. Java ME<br />Java EE<br />Java SE<br />Android, Spring, GWT,…. <br />
  6. 6. Eclipse e4 Scope<br />Make developmentfor Eclipseeasier<br />
  7. 7. from Eclipse Developer<br />Eclipse E4<br />to Eclipse Developer<br />
  8. 8. At the beginning Eclipse e4 will not produce valuable functionality for the user of the Eclipse IDE……<br />
  9. 9. Mid- and long term …much better tooling<br />By modernizing the Eclipse programming model the user will benefit from the increased development speed<br />Only little things……<br />
  10. 10. So, what’s wrong with Eclipse 3.X?<br />
  11. 11. Eclipse 3.x programming model<br />Complex<br />Lots of API<br />Platform functionality via singletons<br />Not easy to test<br />Not a consistent way to define the UI<br />
  12. 12. Inheritance in Eclipse 3.X<br />Object<br />EventManager<br />WorkbenchPart<br />ViewPart<br />View<br />
  13. 13. The smallest Eclipse RCP app in Eclipse 3.X<br />Already looks like the Eclipse IDE<br />Lots of boilerplate code <br />
  14. 14. If only Eclipse development would be easier and more visual appealing.<br />14<br />
  15. 15. The first amazing change <br />Eclipse e4 uses Java 1.5 language features!<br />AAbout time I would say….<br />
  16. 16. Eclipse e4 – Building blocks<br />Modeled Workbench<br />Rendering Engine<br />Declarative Styling<br />Dependecy Injection<br />Context<br />Core Services<br />
  17. 17. The Modeled Workbench<br />
  18. 18. The e4 Workbench Model<br />e4 Workbench Model<br />EMF inside<br />
  19. 19. The e4 Workbench Model<br />Workbench window <br />Menu with menu items <br />Window Trim, e.g. toolbar with toolbar items <br />Parts Sash Container<br />Parts<br />Part Stack (CTabFolder)<br />Parts<br />Handlers<br />Key Bindings<br />Commands<br />
  20. 20. Model is Flexible<br />No distinction between View and Editor<br />Perspectives are optional<br />Stack / Sash are optional<br />Several windows possible<br />Flexible Toolbars <br />
  21. 21. Model removes the need for boilerplate code<br />Minimal Eclipse e4 app: zero classes<br />
  22. 22. Model URI’s<br />The Part in the Model<br />The Part’s URI<br />
  23. 23. Lessions learned from Java Web development<br />The POJO* has won!<br />* Plain Old Java Objects<br />
  24. 24. Model Elements in e4<br />POJO‘s<br />
  25. 25. Usage of annotations<br />Annotations are used<br />To indicate which methods are called<br />
  26. 26. Model available at runtime<br />
  27. 27. Limits of the e4 application model<br />Only models the Application (frame)<br />Modeled Workbench<br />Content of the individual Parts not included in the model<br />
  28. 28. How is this model translated into UI components?<br />© Lars Vogel and others, Licensed under Creative Commons by-nc-nd-3.0 (de) <br />
  29. 29. Model and UI Renderers<br />Model<br />I don’t care who draws me<br />The Workbench model is independent of a specific UI toolkit<br />
  30. 30. Renderers<br />Widget Renderer<br />Renderer Factory<br />Returns for every model element <br />Standard SWT renderer can be exchanged<br />
  31. 31. Renderer: flexible but complex<br />
  32. 32. e4 CSS Styling<br />
  33. 33. In reality all RCP apps look like the an IDE <br />
  34. 34. Eclipse3.X - IDE feeling<br />Eclipse e4 – CSS Styling<br />Example from Kai Toedter<br />Limitations for:<br /><ul><li> Menu bar background
  35. 35. Table headers </li></ul>e4 supports theme switching during runtime<br />
  36. 36. How to enable CSS Styling<br />Extension point "org.eclipse.e4.ui.css.swt.theme“ defines the style sheet<br /><extension<br /> point="org.eclipse.e4.ui.css.swt.theme"><br /> <theme<br />basestylesheeturi="css/styles.css"<br /> id="org.eclipse.e4.minimal.theme.standard"<br /> label=“Standard"><br /> </theme><br /></extension><br />
  37. 37. How to enable CSS Styling<br />Property "cssTheme” for extension point "org.eclipse.core.runtime.products" selects the initial theme<br /> <extension<br /> id="product"<br /> point="org.eclipse.core.runtime.products"><br /> <product<br /> application="org.eclipse.e4.ui.workbench.swt.E4Application"<br /> name="E4 Contacs Demo"><br /> ....<br /> <property<br /> name="cssTheme"<br /> value="org.eclipse.e4.demo.contacts.themes.darkgradient"><br /> </property><br /> .... <br />
  38. 38. Example CSS<br />Label {<br /> font: Verdana 8px;<br /> color: rgb(240, 240, 240);<br />}<br />Table {<br /> background-color: gradient radial #575757 #101010 100%;<br /> color: rgb(240, 240, 240);<br /> font: Verdana 8px;<br />}<br />ToolBar {<br /> background-color: #777777 #373737 #202020 50% 50%;<br /> color: white;<br /> font: Verdana 8px;<br />}<br />
  39. 39. Java<br />Label label = <br />new Label(parent, SWT.NONE);<br />label.setData("org.eclipse.e4.ui.css.id", <br />"SeparatorLabel");<br />CSS<br />#SeparatorLabel {<br /> color: #f08d00;<br />}<br />Assign custom attributes<br />
  40. 40. New Look & Feel for Eclipse 4.0 – SDK <br />https://bugs.eclipse.org/bugs/show_bug.cgi?id=293481<br />
  41. 41. The e4 Programming Model<br />
  42. 42. Dependency Injection<br />Inversion of control: The necessary functionality is injected into the class<br />Java Class<br />
  43. 43. Dependency Injection in e4<br />JSR 330 compatible injection implementation<br />@javax.inject.Inject – Field, Constructor and Method injection<br />@javax.inject.Named – Specify a custom qualifier to context object (default is fully qualified classname of the injected type)<br />e4 specific annotations, e.g. @Optional <br />
  44. 44. Java Class<br /> Services are injected via the the e4 framework<br />publicclassListView {<br /> @Inject<br /> privateIEclipseContextcontext;<br />@Inject<br /> private Loggerlogger;<br /> @Inject<br /> publicListView(Composite parent) {<br />// ...<br />
  45. 45. Lifecycle<br /><ul><li>@PostConstruct: Called after Object created and Fields- and Methods-Injection finished
  46. 46. @PreDestroy: Called before the object is destroyed (e.g. the Part shown in the UI is removed)</li></li></ul><li>What can be injected?<br />
  47. 47. IEclipseContext<br />Stores information of possible Injection Values<br />OSGi Services part of the Context<br />Define your own services and use DI for them<br />
  48. 48. Example: Writing Handlers<br />Method identified via @Execute annotation<br />Can have any number of arguments<br />Use IServiceConstants for general context informations<br />public class AboutHandler {<br />@Execute<br /> public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell){<br />MessageDialog.openInformation(<br /> shell, "About", "e4 Application example.");<br /> }<br />}<br />
  49. 49. Services<br />© Lars Vogel and others, Licensed under Creative Commons by-nc-nd-3.0 (de) <br />
  50. 50. Eclipse Application Services (“Twenty Things”)<br /><ul><li>Long-running operations
  51. 51. Progress reporting
  52. 52. Error handling
  53. 53. Navigation model
  54. 54. Resource management
  55. 55. Status line
  56. 56. Drag and drop
  57. 57. Undo/Redo
  58. 58. Accessing preferences
  59. 59. Preferences
  60. 60. Editor lifecycle
  61. 61. Receiving input
  62. 62. Producing selection
  63. 63. Standard dialogs
  64. 64. Persisting UI state
  65. 65. Logging
  66. 66. Interface to help system
  67. 67. Menu contributions
  68. 68. Authentication
  69. 69. Authorization
  70. 70. Don‘t forget: OSGi services are also available via dependency injection</li></li></ul><li>Contributions<br />
  71. 71. Contributions<br />Extension point “org.eclipse.e4.workbench.model”<br />Fragments – XMI snippets<br />Processor - Code<br />
  72. 72. Context Communication<br />Change the context<br />context.modify("selection", selection.getFirstElement());<br />Get Notified<br />@Inject<br />public voidsetPerson(@Named("selection") @Optional Person person) {<br />master.setValue(person);<br />}<br />
  73. 73. Eclipse e4 – There is more<br />XWT<br />Open Social Gadgets<br />Toolkit Model <br />JDT ???<br />
  74. 74. Photo credits<br />Open Door http://www.sxc.hu/photo/1228296<br />Guy http://www.sxc.hu/photo/423354<br />Corn http://www.sxc.hu/photo/939151<br />About time guy http://www.sxc.hu/photo/1173019<br />Thinking man http://www.sxc.hu/photo/ 324541<br />Cool but hurts http://www.sxc.hu/photo/ 906072<br />WWW http://www.sxc.hu/photo/987822<br />Present http://www.sxc.hu/photo/1140205<br />Happy figure http://www.sxc.hu/photo/125901<br />Chess http://www.sxc.hu/photo/ 958410<br />Pill box http://www.sxc.hu/photo/ 510413<br />Syringe / Injection: http://www.sxc.hu/photo/ 468493<br />Smiley http://www.sxc.hu/photo/ 1211480<br />Lock http://www.sxc.hu/photo/ 352344<br />Life Cycle http://www.sxc.hu/photo/1265027<br />Powerful but complex http://www.sxc.hu/photo/607988<br />Baby photo not yet published<br />Excellent http://www.sxc.hu/photo/866529<br /><ul><li>Thank you picture http://www.sxc.hu/photo/ 986313
  75. 75. Runtime model http://www.sxc.hu/photo/ 765733
  76. 76. Rendererhttp://www.sxc.hu/photo/976984
  77. 77. Binder: http://www.sxc.hu/photo/443042
  78. 78. Praying Girl http://www.sxc.hu/photo/646227
  79. 79. Box: http://www.sxc.hu/photo/502457
  80. 80. Screws http://www.sxc.hu/photo/1148064
  81. 81. House with compartments http://www.sxc.hu/photo/494103
  82. 82. Stacked stones http://www.sxc.hu/photo/998524
  83. 83. Thinking Guy http://www.sxc.hu/photo/130484
  84. 84. Drawing Hand http://www.sxc.hu/photo/264208
  85. 85. Waiter http://www.sxc.hu/photo/157966
  86. 86. Dancing Girt http://www.sxc.hu/photo/1187376
  87. 87. Books http://www.sxc.hu/photo/1184809</li></li></ul><li>e4: Where to go from here:<br />Eclipse e4 Wiki<br />http://wiki.eclipse.org/E4<br />Eclipse e4 Tutorial<br />http://www.vogella.de/articles/EclipseE4/article.html<br />
  88. 88.
  89. 89. Thank you<br />For further questions:<br />Lars.Vogel@gmail.com<br />http://www.vogella.de<br />http://www.twitter.com/vogella<br />
  90. 90. License & Acknowledgements<br />This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License<br />See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×