The document discusses Eclipse 4.0 and its new application platform. It introduces key building blocks of Eclipse 4.0 like the modeled workbench, rendering engine, declarative styling, and dependency injection. The modeled workbench uses EMF to define the application UI in an XML file rather than code. Renderers then translate the model into actual UI components. Dependency injection simplifies programming by auto-wiring classes with their dependencies. Overall, Eclipse 4.0 aims to make RCP development easier and more visually appealing compared to prior Eclipse platforms.
1. Eclipse 4.0 Application Platform The unexpected simplicity of Eclipse RCP and Eclipse plugin development 26. August for JUG Saxony Lars Vogel http://www.vogella.de Twitter: @vogella
2. Eclipse 4.0 Application Platform -Agenda What is Eclipse 4.0? Whom does try to help? Building blocks of Eclipse 4.0 Q&A
3. What is an Eclipse RCP application? Local running application using the native widget toolkit Based on the Eclipse runtime and technology
10. Eclipse 3.x programming model Complex Lots of API Platform functionality via singletons / static methods Not easy to test Not a consistent way to define the UI
18. The e4 Workbench Model 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
19. Model is Flexible No distinction between View and Editor Perspectives are optional Stack / Sash are optional Several windows possible Flexible Toolbars
20. Model removes the need for boilerplate code Minimal Eclipse e4 app: zero classes
42. 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, e.g. @Optional
43. Java Class Services are injected via the the e4 framework publicclassListView { @Inject privateIEclipseContextcontext; @Inject private Loggerlogger; @Inject publicListView(Composite parent) { // ...
44. Java Class Model elements participate automatically in DI AddOn as non visual model elements Inject your own object is as simple as ContextInjectionFactory.make(YourObject.class, context);
45.
46.
47. IEclipseContext Stores information of possible Injection Values OSGi Services part of the Context Define your own services and use DI for them
48. Example: Writing Handlers Method identified via @Execute annotation Can have any number of arguments Use IServiceConstants for general context informations public class AboutHandler { @Execute public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell){ MessageDialog.openInformation( shell, "About", "e4 Application example."); } }
71. Context Communication Change the context context.modify("selection", selection.getFirstElement()); Get Notified @Inject public voidsetPerson(@Named("selection") @Optional Person person) { master.setValue(person); }
72. Eclipse e4 – There is more XWT Open Social Gadgets Toolkit Model JDT ???
74. Eclipse: Where to go from here: Eclipse 4.0 SDK Tutorial http://www.vogella.de/articles/EclipseE4/article.html Tom Schindl’s Eclipse 4.0 SDK Tutorial http://tomsondev.bestsolution.at/2010/07/28/eclipse-4-0-and-tutorial-on-writing-e4-rcp-application-released/ Eclipse Wiki http://wiki.eclipse.org/ Eclipse RCP Tutorial http://www.vogella.de/articles/RichClientPlatform/article.html
75.
76. Thank you For further questions: Lars.Vogel@gmail.com http://www.vogella.de http://www.twitter.com/vogella