Category Archive for: ‘Java’

Experiments with GEF4 Graphics and JavaFX


Inspired by a phone call with Alexander Nyssen and a Forum post by Tom Schindl I started playing around with a GEF4 AbstractGraphics implementation using a JavaFX 2.2 canvas. GEF4 nicely separates the presentation model from the UI toolkit responsible for the actual rendering, so it was pretty straight forward to develop a JavaFX based implementation. Currently GEF4 provides Java2D (AWT) and SWT renderers. The results using my small JavaFX based renderer look quite nice so far. Here is the “Simple Example” rendered with SWT and JavaFX:


When you click on the above image to see it in original size you will notice the the red lines look not as crisp in JavaFX compared to SWT. That is because in JavaFX all coordinates are expressed as double values and the shapes are positioned computing the exact middle position of the edges by default. In practice that means that a red line with thickness 1 drawn from (10:10) to (20:10) would be rendered as pink line with a line width of 2 pixels. A workaround is to take the line thicknesses into account and draw the line from (10:9.5) to (20:9.5). Then the line will be painted crisp. Actually the HTML5 canvas implementation does exactly the same. In the demo, I just had to add javaFxGraphics.translate(0.5, 0.5); at the beginning of the demo, then the result looks like:


Again, click on the image to see the original sizes. The FillModesDemo looks almost the same when you compare the SWT with the JavaFX version:


Currently I am trying to get the JavaFX clipping working in a canvas, don’t know yet why it is not working out of the box… For me it would be great to see graphical editors in e4 and JavaFX based apps in the future. In the next weeks I will polish my implementation and contribute it to GEF4, if there is any interest.

Stay tuned


You find me on Twitter and Google+.
Interested in Eclipse 4 Application Platform trainings?

Old Computers

Found a great Web site with all kinds of old computers, see Here is a list of all the old computers had owned and still love:

– Sinclair ZX 81:
– Sinclair ZX Spectrum:
– Atari 520 ST:

I used to write games in assembler for the Sinclairs. One game for the ZX Spectrum still runs as a Java Applet on my web site (

I always have nostalgic feelings when I remember all the fun a had with the above old computers.


Which old computers did you own?

TypeScript: The New JavaScript?


In the last year I did quite a lot of evaluation, prototyping and testing in the HTML5/Web/JavaScript space. For me, as a Java veteran it was (and still is) a quite refreshing experience and a lot of fun. One question I wanted to answer for myself was: Is it possible in a big organization like Siemens to do professional software development using JavaScript + HTML5? My current answer would be: YES, but with a lot of coaching from experienced people who know the best practices regarding language, project structure, module systems, testing, libraries, tools etc. During my activities I took a look at Dart, CoffeeScript and TypeScript.

I have to admit, I like TypeScript a lot. It gives me most of the abstractions that I am used too from my background as Java developer, like classes, modules and interfaces. And I also like the optional strong typing during compile time with corresponding IntelliSense (or “Content Assist” in EclipseSpeak). The idea of TypeScript is to enhance JavaScript by providing these additional abstractions and compile to plain ole JavaScript.

Here a TypeScript example:

class Student {
  fullname : string;
  constructor(public firstname, public middleinitial, public lastname) {
    this.fullname = firstname + " " + middleinitial + " " + lastname;

interface Person {
  firstname: string;
  lastname: string;

function greeter(person : Person) {
  return "Hello, " + person.firstname + " " + person.lastname;

var user = new Student("Kai", "U.", "Toedter");

compiles to the JavaScript

var Student = (function () {
 function Student(firstname, middleinitial, lastname) {
   this.firstname = firstname;
   this.middleinitial = middleinitial;
   this.lastname = lastname;
   this.fullname = firstname + " " + middleinitial + " " + lastname;
 return Student;

function greeter(person) {
  return "Hello, " + person.firstname + " " + person.lastname;

var user = new Student("Kai", "U.", "Toedter");

TypeScript was created by Microsoft (Anders Hejlsberg) and is licensed under Apache 2.0. The main Web resource is Here you find all information and you can play around live with a nice editor (seeing the original TypeScript and the compiled JavaScript). Currently the TypeScript compiler runs either as a node.js module or using Windows Scripting host. As it is from Microsoft, no one will be surprised that Visual Studio actually has the best IDE support for TypeScript. But the current RC release of JetBrain’s WebStorm also has TypeScript support.

There is no Eclipse-Plugin so far. Recently I tried to write one using Rhino but I got stuck and gave up. But probably people from the Eclipse community who have more experience with integrating editors, content assist etc. might want to give TypeScript a try 🙂

What do you think about TypeScript?

Have Fun!


You find me on Twitter and Google+.
Interested in Eclipse 4 Application Platform trainings?

Eclipse 4 Application Platform Tutorial App on Github


For my Eclipse 4 Application Platform trainings/tutorial I use a small but complete application for the tutorial labs. The application includes:

  • Eclipse 4 Application Model
  • Domain Model as OSGi Declarative Service (to be used with DI container)
  • Eclipse 4 Application Model extension:
    • Providing a model fragment in a separate bundle (Details View)
    • Extending the e4 ui application model with a new model element (TutorialPartStack)
  • Headless build with Tycho
  • A bit CSS styling
  • A styled Login dialog using Lifecycle-Hooks
  • much more 🙂

You find all the projects at

The Tycho Build
To run the Tycho build locally, just:

  • Have Maven 3 installed
  • Clone the above Git repo
  • Open a shell in project
  • Run command “mvn clean install”
  • Wait a while (first build takes long) until the build succeeds
  • The results for Win (32/64) and Linux GTK (32/64) and Mac Cocoa (32/64) are in project org.eclipse.e4.tutorial.contacts.product/target/products

Good Tycho introductions can be found at and

The Eclipse 4 Application Model Extension
In the project org.eclipse.e4.tutorial.contacts.model.application you find a small extension to the Eclipse 4 application model, a custom PartStack named TutorialPartStack. This extension is used in the Application.e4xmi file of project org.eclipse.e4.tutorial.contacts. To open the Application.e4xmi in your running Eclipse IDE (in model editors), you have to export the project org.eclipse.e4.tutorial.contacts.model.application into your running IDE.

  • To export, open MANIFEST.MF, in the Overview-Tab of the manifest editor click on “Export Wizard” and then choose “Install into host. Repository:”
  • Restart your Eclipse SDK, now you should be able to open Application.e4xmi
  • If you don’t want to install the model extension into your running Eclipse SDK, you could just start a new Eclipse SDK instance and make sure that the project org.eclipse.e4.tutorial.contacts.model.application is checked in the Run-Configuration.

Any feedback on the tutorial projects would be highly appreciated.

Have Fun!


You find me on Twitter and Google+.
Interested in Eclipse 4 Application Platform trainings?

Eclipse Democamp Munich @ Siemens : Impressions

Yesterday we had the Eclipse Democamp at the Siemens campus in Munich. Since the weather was just too great and there was a European Football Championship quarter-final, “only” 131 of the 200 registered attendees showed up. Regarding the feedback I got so far, they enjoyed the event very much (Anonymous quote “Best Eclipse Demo Camp EVER!” :)). I would like to thank all attendees for coming and of course, all the speakers for their great sessions (list is ordered by speaking time slot): Ralph Müller, Tom Schindl, Sebastian Zarnekow, Frank Gerhardt, Benjamin Muskalla, Maximilian Kögel, Jonas Helming, Markus Tiede, Ralf Sternberg, and Tobias Röhm.

Organizing the event was so much fun that I plan to have another one next year.

CU  tonight at the Democamp in Zurich, Switzerland!


You find me on Twitter and Google+.
Next Eclipse 4 Application Platform trainings

Eclipse 4 Lifecycle Hooks: Login Dialog with CSS Styling


Currently I am adding a section about the e4 application platform life cycle management to my e4 tutorial. One good way for hooking in the application’s life cycle are the life cycle hooks. You just have to add a new property with name “lifeCycleURI” and a value like “bundleclass://<bundle id>/<class>” to your product extension and use some life cycle annotations in the specified class.

You find a good introduction and examples for life cycle hooks from Lars Vogel and Marc Teufel. While the basic mechanism is straight forward, there are a few challenges left. One of them is how to provide a login dialog with css styling. Why is this a challenge? Because all the existing life cycle annotations (like @PostContextCreate) that are invoked before the application is started, are processed before the presentation engine is initialized. But the solution is pretty simple: Initialize a presentation engine with your own data.

First you have to provide the css file and the org.eclipse.e4.ui.css.swt.theme extension in your own login project, e.g.

            label="Login Theme">

Then, in your own Java code, you have to initialize the engine and style the shell you use for the login dialog. For doing that, get the IEclipseContext using dependency injection, and manually set the cssTheme and cssURI keys before invoking the static method PartRenderingEngine.initializeStyling(), e.g.

public class Login {
   public void login(IEclipseContext context) {
      final Shell shell = new Shell(SWT.INHERIT_NONE);

      final LoginDialog dialog = new LoginDialog(shell);

      String cssTheme = "org.eclipse.e4.tutorial.contacts.themes.login";
      context.set(E4Application.THEME_ID, cssTheme);
      String cssURI = "css/login.css";
      context.set(E4Workbench.CSS_URI_ARG, cssURI);

      PartRenderingEngine.initializeStyling(shell.getDisplay(), context);

      if ( != Window.OK) {

With this little trick, you can provide a private styling with your own css file just for the login dialog. Here are 2 screen shots of the login dialog example for my e4 tutorial with different css styling:

CU at Democamp Munich 2012!


You find me on Twitter and Google+.
Next Eclipse 4 Application Platform trainings

Eclipse Demo Camp @ Siemens Sold Out!

It’s more than a month left but all of the available 200 tickets for the Siemens AG / EclipseSource Eclipse Demo Camp on June 21 in Munich are already taken. To get the most possible amount of people a chance to attend,

  • I will send an email to all registered attendees and kindly ask them to re-check, if they really plan to come. If someone cannot attend the demo camp anymore, she/he could let me know and give more people the chance to attend.
  • I will try to get more seats (It mostly depends on the room).

So, if you would like to come and don’t have a ticket yet, there is still a chance that you would be able to register in the near future. Please stay tuned and check often.

And, if you read this, have already registered but cannot attend the demo camp for any reason, please let me know asap.

CU there…


Juno Eclipse Demo Camp 2012 @ Siemens in Munich (Update 1)

Just one week after the first announcement, more than 100 of the available 200 tickets for the Siemens/EclipseSource Eclipse Demo Camp on June 21 in Munich are already taken. So, don’t wait too long to register. The agenda, packed with great sessions and demos, is final now. You find more information and the registration at

CU there…


Juno Eclipse Demo Camp 2012 @ Siemens in Munich


I am happy to announce the Juno Eclipse Demo Camp 2012 @ Siemens in Munich, Germany. Again, excellent speakers with interesting demos/talks will make this demo camp an Eclipse fest! Last year we had 170 attendees, this is the mark to top this year. The latest event details and agenda you always find at the Wiki page and the registration page.

Location: Siemens AG, Forum 1, Otto-Hahn-Ring 6, 81739 Munich, Germany
PDF with directions: Siemens Munich MCH_P campus
Google Maps: Siemens Munich MCH_P campus

Date and Time
Thursday, June 21, 2012 from 5:00 PM – 11:00 PM (GMT+0100)

Agenda (Under construction, may change, please stay tuned…)

  • 05:00pm – 05:30pm Meet and Greet
  • 05:30pm – 05:40pm Welcome/Intro
    Ralph Müller (Eclipse Foundation) + Kai Tödter (Siemens Corporate Technology)
  • 05:40pm – 06:00pm JavaFX/Swing Renderers for the Eclipse 4 Application Platform,
    Kai Tödter (Siemens Corporate Technology)
  • 06:00pm – 06:20pm e(fx)clipse: JavaFX for Eclipse
    Tom Schindl (
  • 06:20pm – 06:50pm Xtext and Xtend: What’s Hot and New
    Sebastian Zarnekow (itemis)
  • 06:50pm – 07:10pm BREAK (with beer, soft drinks, coffee & snacks)
  • 07:10pm – 07:30pm Applause 2 (Working title, might change)
    Peter Friese (Zühlke)
  • 07:30pm – 07:50pm Git + Mylyn (Working title, might change)
    Benjamin Muskalla (Tasktop)
  • 07:50pm – 08:10pm EMFstore – Released
    Maximilian Kögel (EclipseSource)
  • 08:10pm – 08:30pm FastFix – Monitoring Control for Remote Software Maintenance
    Tobias Röhm (TU München)
  • 08:30pm – 08:50pm BREAK (with beer, soft drinks, coffee & snacks)
  • 08:50pm – 09:10pm No Black Magic: Push info to the Browser with redVoodo
    Ekkehard “Ekke” Gentz (Freelancer)
  • 09:10pm – 09:30pm Writing Native Mobile Apps with RAP
    Ralf Sternberg (EclipseSource)
  • 09:30pm – 09:50pm Jubula (Working Title, might change)
    Speaker from Bredex
  • 09:50pm – 10:10pm EMF Client Platform – Revolutions
    Jonas Helming (EclipseSource) — Probably with Kinect Fun!
  • 10.10pm – 12:00pm Networking (with beer, soft drinks and warm buffet)

At you find the current list of attendees and you can register. Registration is free: beer, soft drinks and (warm) buffet is sponsored by Siemens AG and EclipseSource! Let’s make this demo camp great!

See you all in Munich…


You find me on Twitter and Google+.

OSGi Vaadin Demo now on GitHub

After EclipseCon I made some changes in my dynamic OSGI Vaadin demo, and I decided to put it on GitHub. You find it here:

I added a progress indicator with polling (Thx Jani Laakso). Now starting and stopping bundles on the server will automatically be reflected in the client. I will talk about the demo at the JAX conference next week.

CU at JAX 2012!


You find me on Twitter and Google+.
Next Eclipse RCP 3.x/4.x trainings in Munich

Page 2 of 11«12345»10...Last »