Blog

JavaFX 2.0, Swing & SWT Renderers for the Eclipse 4.x Application Platform

27

I wish you all a Happy New Year!

During the last weeks I had a bit of spare time and started experimenting with new rendering engines for the Eclipse 4.x Application Platform. Based on my experiences with  JavaFX 2.0 renderers in e(fx)clipse (by Tom Schindl from BestSolution.at, great JavaFX support for Eclipse), I started an experiment: Would it be possible to create a generic rendering engine that only has dependencies to the Eclipse 4.x workbench model and then delegate all UI toolkit specific logic to the UI toolkit specific renderers?

When I took a deep look at the projects org.eclipse.e4.ui.workbench.swt, org.eclipse.e4.ui.workbench.renderers.swt and org.eclipse.e4.ui.workbench.addons.swt, I figured out that most of the workbench model related code could be useful for other renderes, too. But there is a very strong coupling to SWT, so it is not possible to reuse any code without copying it. My approach is a simple generic rendering engine, that also provides a generic e4 application. Then, for every supported UI toolkit, just a derived application and new renderers have to be implemented. The basic bahavior is driven only by model changes, the renderes have to react on those changes. The engine also takes care of letting each renderer do the binding from the specific UI toolkit back to the model.

Currently I have implemented simple rendering engines for JavaFX 2.0, Swing, and SWT. I also started the same approach with a generic MinMax model addon. The addon gets the additions needed to adapt to a specific UI toolkit through DI.

I reimplemented my e4 contacts demo and split it into a generic project that contains the workbench model, the domain model and all parts, which are not UI toolkit specific. Then I created a UI toolkit specific implementation for JavaFX 2.0, Swing and SWT. The Details and the Table widgets I had to implement with the UI toolkits natively. Here are a few screen shots of the results, click on them to see the images in original size.

JavaFX 2.0 based contacts demo with 3 different CSS based themes:

     

Swing based contacts demo with Nimbus and Napkin Look & Feel (Napkin is my favorite Look & Feel to show prototypes to the management :)):

  

SWT based contacts demo (my new rendering engine) with 2 different CSS based themes:

  

The current alpha version 0.0.1 you find at GitHub: https://github.com/toedter/e4-rendering

If you want to run the JavaFX 2.0 Contacts Demo, you also need to have the latest version (0.0.11 or better) of e(fx)clipse installed. The easiest way is to download the pre-configured Eclipse 4.x SDK from http://efxclipse.org/install.html#the-lazy-ones and then clone the above git repository.

Right now this is just a proof of concept, only very basic stuff is implemented. But I am planning to enhance the engine and UI toolkit specific renderers until EclipseCon 2012. If there is enough interest in the community, I would love to organize a BOF at EclipseCon to discuss the pros and cons of this approach.

What do you think?

Stay tuned!

Kai

You find me on Twitter and Google+.
If you are interested in in-house Eclipse RCP 3.x or 4.x training,
please contact me…

E4 Fx Contacts Dark

Eclipse 4.x RCP + JavaFX Renderer

8

Recently I have ported my e4 Contacts Demo to Tom Schindl’s e(fx)clipse. Besides a very nice JavaFX tooling integration into the Eclipse IDE, Tom also started a JavaFX 2.0 based rendering engine for Eclipse 4.x  based applications. I enhanced the JavaFX renderer just a little bit to fit better to the needs of the contacts demo. I also integrated dynamic theme switching based on CSS themes. Here is the result (these pictures are not from mocks, but from the running e4 JavaFX contacts demo):

Just click on the pictures to see them in original size. Of course this is just a first start, but to me it looks very promising. If you happen to be at the W-JAX conference during the next days, just grab me and ask for a live demo. I will also show this at my full day workshop “Rich-Client-Entwicklung mit Eclipse RCP 4.1” on Friday.

As soon as we have merged it into the master of Tom’s github repo, I’ll let you know.

Stay tuned!

Kai

You find me on Twitter and Google+.
If you are interested in in-house Eclipse RCP 3.x or 4.x training,
please contact me…

Java FX 2.0 CSS Styling

19

Inspired by Tom Schindl’s e(fx)clipse (see his blog), I have spent some time investigating the CSS styling capabilities of JavaFX 2.0. I have to admit I like it a lot! The styling provides everything out of the box that I had wished for. The only thing that bothers me about the JavaFX rendering right now is that sub-pixel anti-aliased font rendering is not supported yet. This make all fonts appear blurred on LCD screens. But I hope that this will be fixed soon, there are already some bugs filed in the JavaFX Jira.

I could not resist to create a JavaFX based mock-up of my Eclipse 4.x contacts demo, the current result without any additional CSS styling (actually the caspian CSS style is used by default) looks like this:

IMHO, the result is nice (if you ignore the font rendering :)). With a little bit of CSS styling I could create a straw-man dark theme. This is not meant to be a real theme but just a prove of concept. You might see that also radial gradients are supported:

The CSS for this theming is pretty small since it inherits most styling from the default theme. A very nice thing is that by default most of the colors are derived from -fx-base. So it is pretty easy to create themes based on base colors. Here is the complete CSS for the above styling:

.root {
-fx-base: rgb(50, 50, 50);
-fx-background: rgb(50, 50, 50);
-fx-control-inner-background:  rgb(50, 50, 50);
}

.tab {
-fx-background-color: linear-gradient(to top, -fx-base, derive(-fx-base,30%));
}

.menu-bar {
-fx-background-color: linear-gradient(to bottom, -fx-base, derive(-fx-base,30%));
}

.tool-bar:horizontal {
-fx-background-color:
linear-gradient(to bottom, derive(-fx-base,+50%), derive(-fx-base,-40%), derive(-fx-base,-20%));
}

.button {
-fx-background-color: transparent;
}

.button:hover {
-fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
-fx-color: -fx-hover-base;
}

.table-view {
-fx-table-cell-border-color:derive(-fx-base,+10%);
-fx-table-header-border-color:derive(-fx-base,+20%);
}

.split-pane:horizontal > * > .split-pane-divider {
-fx-border-color: transparent -fx-base transparent -fx-base;
-fx-background-color: transparent, derive(-fx-base,20%);
-fx-background-insets: 0, 0 1 0 1;
}

.my-gridpane {
-fx-background-color: radial-gradient(radius 100%, derive(-fx-base,20%), derive(-fx-base,-20%));
}

.separator-label {
-fx-text-fill: orange;
}

The next steps for me would to port the e4 Contacts Demo to Tom’s e(fx)clipse to have a working application.

One last thing: If you are a designer, could you provide me with a real great looking dark CSS theme for JavaFX 2.0?

Have Fun!

Kai

You find me on Twitter and Google+.
If you are interested in in-house Eclipse RCP training,
please contact me…

Eclipse RCP Splash Screens and Java WebStart

3

One thing that has bothered me (and recently one of my customers) a lot was that we could not display Eclipse RCP splash screens when starting the application using Java WebStart. But now I got it working, here is the recipe:

1) In your main jnlp file, add

<application-desc main-class="org.eclipse.equinox.launcher.WebStartMain">
    <argument>-showsplash</argument>
</application-desc>

2) In the resources section, add the following 4 properties.

<property name="osgi.instance.area" value="@user.home/<your_app>"/>
<property name="osgi.install.area" value="@user.home/<your_app>/osgi"/>
<property name="osgi.configuration.area" value="@user.home/<your_app>"/>
<property name="osgi.splashPath" value="platform:/base/plugins/<your_bundle_that_contains_splash.bmp>"/>

3) For all operating systems that might wanna run your webstarted app, add the launcher respective fragments, e.g. for Win and Win64:

<resources os="Windows" arch="x86">
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502.jar"/>
</resources>
<resources os="Windows" arch="x86_64">
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502.jar"/>
</resources>

That should be it. I have already added the Windows fragments for my MP3 Manager Demo, so when you start it under Windows, you should see the RCP splash screen.  I will add the remaining fragments for other operating systems later…

You can WebStart MP3 Manager here:

Have Fun!

Kai

You find me on Twitter and Google+.
If you are interested in in-house Eclipse RCP training,
please contact me…

Jcalendar1

JCalendar 1.4 Released

4

After 2 years I released a new version of my free Java date picker JCalendar. You find the download, demo and documentation of the stable release and the current integration build at the project homepage. Here are the new and noteworthy things:

Buttons for “Today” and “No Date”
JCalendar provides 2 new methods for setting the “Today “button and/or “No Date” button visible. These 2 buttons are localized by default, but you could set your own labels if you don’t like the default translations.

     

Date Evaluators
With the interface IDateEvaluator you can add evaluators that decide if a date is special or invalid. Invalid dates can not be chosen. Both, special and invalid dates can have specific foregrounds and backgrounds. In the picture below, day 4 and 5 are invalid and day 6 and 7 are special. The special days can provide a tooltip that indicate why they are special.

Look & Feel
Now JGoodies Looks 2.4.1 is included. The demo now uses different font for the Plastic Look & Feel so that unicode characters are displayed correctly. Also Nimbus Look & Feel is supported better.

Fixed Bugs
– Bug in focus handling fixed
– Bug when selecting last day of a month and then change the month fixed

Have Fun!

Kai

You find me on Twitter and Google+.
If you are interested in in-house Eclipse RCP training,
please contact me…

Eclipse RCP Demo “MP3 Manager” Version 3.7.0 released

18

I recently updated my MP3 Manager Eclipse RCP demo to version 3.7.0.

These things are new:

* Java WebStart support (launcher see below)
* New target platform Eclipse 3.7.0
* Integrated Tycho 0.12.0 build
* 3.7.0 compliant headless p2-enabled build
* 3.7.0 target definition project

The binaries, sources, svn access etc. you find at the project home page.

You can launch the demo directly with the launch button below using Java WebStart, but a few restrictions apply:

* p2 does not work well together with WebStart and is not included
* Restarting the client using the dynamic language switcher does not work
* No demo song included

Have Fun!

Kai

Democamp Munich

Eclipse Demo Camp @ Siemens Munich => Impressions

2

At June 20th, 2011, the Eclipse Demo Camp took place at the Siemens campus in Munich, Germany. From my point of view, the event was just great. We had 165 attendees (which might be a new record for a German Indigo demo camp), 12 excellent speakers, great sessions, enough food and beer and – lots of fun! I would like to thank all speakers for both giving great demos/sessions and staying in their time slot (which is not easy just having 20 minutes): Ralf Müller, Ekkehard “Ekke” Gentz, Peter Friese, Tom Schindl, Ralf Sternberg, Marcel Bruch, Maximilian Kögel, Jonas Helmig, Alexandra Imrie, Benjamin Muskalla, and Sebastian Zarnekow.

This was not the first event with 150+ attendees I have organized in the last years, but this was by far the biggest event in terms of food and beer consumption. We had nice Bavarian food and it was gone in 30 Minutes! But everyone got enough, and thanks to the great catering service after the second track there was even more… If I get the numbers a will probably post some statistics.

The slides I collected so far you can download here.

The award for the funniest demo went to Jonas Helming and Maximilian Kögel for showing off a Microsoft Kinect connected to an Eclipse IDE, controlling the IDE with funny gestures. I see much potential in here!!!. The picture below shows Jonas, Maximilian and the attendees trying out the gestures.

I had so much fun at this demo camp that I am planning to organize another one next year… Now I am looking forward to attending the demo camp in Hamburg on June 28th.

Kai

Democamp Munich

Eclipse Demo Camp @ Siemens Munich => More free Tickets!

0

There are only 11 days left until the Eclipse Demo Camp Munich on June 20th 2011, hosted by Siemens AG. I closed the Siemens-only registration and now we have 21 more seats available for public registration. You can register again at http://democampmunich.eventbrite.com. Currently we have 180 registrations and I hope to sell out all 200 free tickets 🙂

I would like to thank Daria Motamedi for providing the nice demo camp image as part of her flyer.

Looking forward to seeing you all in Munich…

Kai

Eclipse Demo Camp @ Siemens, Munich (Update 4)

0

I am pretty exited that we  sold out the regular free tickets for the Eclipse Demo Camp @ Siemens (in Munich, Germany)! There are only a few reserved tickets left for Siemens employees. Currently we have 174 registered attendees. Since the regular tickets (ticket type: Registration)  are sold out, please contact me if you have such a ticket and cannot attend the event. Then I could cancel your ticket and give another person the chance to attend!

I also would like to thank Daria Motamedi for providing the nice democamp-munich-flyer 🙂

Looking forward to seeing you all in Munich…

Kai

Follow me on Twitter

My JAX 2011 Presentations

0

The JAX conference is over and I liked it a lot! Many thanks to all the attendees of my sessions and tutorials for the feedback and the great discussions. Here are the slides from my sessions about Eclipse 4.x and OSGi/Vaadin. You can download the PDFs directly from slideshare.

Have Fun!

Kai

Follow me on Twitter

Page 4 of 12« First...«23456»10...Last »