Building Applications with
     Eclipse 4.x (e4)

                  |




Lars Vogel        Tom Schindl
About Tom

✤
    CEO BestSolution Systemhaus GmbH

✤
    Eclipse Committer

    ✤
        e4

    ✤
        Platform UI

    ✤
        EMF

✤
    Projectlead: UFaceKit, Nebula

✤   Member of the Architectual Council
About Lars

Works as independent Eclipse and Android Developer
and Trainer


Maintains http://www.vogella.de Java, Eclipse and
Android related Tutorials with ~40 000 visitors per day

Starting to publish (e)books at Amazon
Presentation


                             w
     •     Eclipse e4 Overvie
     •     Model
                              ion
     •     Dependency Inject
      •    Styling
                               r
      •     Compatibility Laye
                                 e4
       •    JavaFX and Eclipse
       •    Q&A
What is the purpose of the
  Eclipse 4.x project?
Eclipse e4 Scope

Make development for
   Eclipse easier
It is not making development
          with easier.

„Normal“ developer should
see no difference, except...
Eclipse 3.x - areas of improvement

                   • Testing

                   • Consistent way to define
                     the UI

                   • Styling the application

                   • Easy way to use OSGI
                     services
If I only had a
consistent view of
the Eclipse
workbench


                 9
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
Limits of the e4 application model

• Only models the Application (frame)


                Modeled
               Workbench



              Content of the
            individual Parts not
              included in the
                   model
The e4 Programming Model
Dependency Injection in e4

• JSR 330 compatible injection
  implementation
   – @javax.inject.Inject – Field, Constructor and
     Method
   – @javax.inject.Named
• e4 specific annotations, e.g. @Optional
a
               Jav s
                Clas                        Services are injected
                                        via the the e4
                                        framework

public class ListView {


  @Inject
  private IEclipseContext context;
  @Inject
  private Logger logger;


  @Inject
  public ListView(Composite parent) {
      // ...
e4 CSS Styling
How to enable CSS Styling
Property "cssTheme” for extension point
"org.eclipse.core.runtime.products" selects the initial theme

<extension
        id="product"
        point="org.eclipse.core.runtime.products">
     <product
           application="org.eclipse.e4.ui.workbench.swt.E4Application"
           name="E4 Contacs Demo">
        ....
        <property
              name="cssTheme"
              value="org.eclipse.e4.demo.contacts.themes.darkgradient">
        </property>
        ....
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;
}
Eclipse 4.2
planned to be
the basis of
Eclipse Juno SDK
4.2 still has some issues

And there will be Eclipse 3.8
e4: Where to go from here:
Eclipse e4 Wiki
http://wiki.eclipse.org/E4



Eclipse 4.2 Application Tutorial – Lars Vogel
http://www.vogella.de/articles/EclipseE4/article.html



Eclipse 4.0 Application Tutorial – Tom Schindl
http://tomsondev.bestsolution.at/2010/07/28/eclipse-4-0-and-tutorial-on-writing-e4-rcp-application-released/
Plugins zur Produkt / Feature
• Fügen sie die folgenden Plugins Ihrem Feature
  hinzu
  – org.eclipse.e4.ui.workbench.addons.swt
  – org.eclipse.equinox.ds
  – org.eclipse.equinox.event
  – org.eclipse.equinox.util
  – org.eclipse.platform
  – org.eclipse.ui.forms
  – org.eclipse.ui.intro

Eclipse e4 - Google Eclipse Day

  • 1.
    Building Applications with Eclipse 4.x (e4) | Lars Vogel Tom Schindl
  • 2.
    About Tom ✤ CEO BestSolution Systemhaus GmbH ✤ Eclipse Committer ✤ e4 ✤ Platform UI ✤ EMF ✤ Projectlead: UFaceKit, Nebula ✤ Member of the Architectual Council
  • 3.
    About Lars Works asindependent Eclipse and Android Developer and Trainer Maintains http://www.vogella.de Java, Eclipse and Android related Tutorials with ~40 000 visitors per day Starting to publish (e)books at Amazon
  • 4.
    Presentation w • Eclipse e4 Overvie • Model ion • Dependency Inject • Styling r • Compatibility Laye e4 • JavaFX and Eclipse • Q&A
  • 5.
    What is thepurpose of the Eclipse 4.x project?
  • 6.
    Eclipse e4 Scope Makedevelopment for Eclipse easier
  • 7.
    It is notmaking development with easier. „Normal“ developer should see no difference, except...
  • 8.
    Eclipse 3.x -areas of improvement • Testing • Consistent way to define the UI • Styling the application • Easy way to use OSGI services
  • 9.
    If I onlyhad a consistent view of the Eclipse workbench 9
  • 10.
    The e4 WorkbenchModel • 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
  • 11.
    Limits of thee4 application model • Only models the Application (frame) Modeled Workbench Content of the individual Parts not included in the model
  • 12.
  • 13.
    Dependency Injection ine4 • JSR 330 compatible injection implementation – @javax.inject.Inject – Field, Constructor and Method – @javax.inject.Named • e4 specific annotations, e.g. @Optional
  • 14.
    a Jav s Clas Services are injected via the the e4 framework public class ListView { @Inject private IEclipseContext context; @Inject private Logger logger; @Inject public ListView(Composite parent) { // ...
  • 15.
  • 16.
    How to enableCSS Styling Property "cssTheme” for extension point "org.eclipse.core.runtime.products" selects the initial theme <extension id="product" point="org.eclipse.core.runtime.products"> <product application="org.eclipse.e4.ui.workbench.swt.E4Application" name="E4 Contacs Demo"> .... <property name="cssTheme" value="org.eclipse.e4.demo.contacts.themes.darkgradient"> </property> ....
  • 17.
    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; }
  • 18.
    Eclipse 4.2 planned tobe the basis of Eclipse Juno SDK 4.2 still has some issues And there will be Eclipse 3.8
  • 19.
    e4: Where togo from here: Eclipse e4 Wiki http://wiki.eclipse.org/E4 Eclipse 4.2 Application Tutorial – Lars Vogel http://www.vogella.de/articles/EclipseE4/article.html Eclipse 4.0 Application Tutorial – Tom Schindl http://tomsondev.bestsolution.at/2010/07/28/eclipse-4-0-and-tutorial-on-writing-e4-rcp-application-released/
  • 20.
    Plugins zur Produkt/ Feature • Fügen sie die folgenden Plugins Ihrem Feature hinzu – org.eclipse.e4.ui.workbench.addons.swt – org.eclipse.equinox.ds – org.eclipse.equinox.event – org.eclipse.equinox.util – org.eclipse.platform – org.eclipse.ui.forms – org.eclipse.ui.intro