SWT, Eclipse 4 and custom skinning

September 21st, 2008

Are SWT and Eclipse moving away from native widgets? If you follow the development mailing lists of the relevant Eclipse subprojects, this might be one of the more interesting questions for Java UI developers.

Much has been said over the past few years about the relative merits of Swing and SWT. SWT has always prided itself on using native widgets (wherever possible), sporting better platform fidelity and performance. In the meantime, the competitive pressure from SWT has, in the view of many observers, made Sun invest much-needed attention in Swing. It zigzagged a little in its priorities regarding native look-and-feels; much work has been done in Mustang for Windows and GTK LAFs, but the few glaring remaining bugs have been ignored ever since. However, Swing, AWT and Java2D teams at Sun have been at work bringing significant performance improvements (and not only for hardware-accelerated pipelines), using native font rasterizer on Windows, support for translucent and shaped windows and more.

The flexibility and extensibility of Swing painting pipeline allows creating applications that bear little semblance to the dated Ocean look, and it looks like SWT might be moving in this direction as well. Lotus Software has been purchased by IBM back in 1996 for 3.5 billion dollars, and IBM has put a lot of resources to continue the development of different Lotus components (such as Domino and Notes). Unbeknownst to many (which is a good sign for any software in general), Lotus is an SWT application. It certainly doesn’t look one – click the screenshot for the full size view:

Not much information is available on custom Lotus SWT components (or i haven’t looked hard enough), but this presentation (zipped PowerPoint) provides some insights – the UI guidelines are implemented with CSS:

A majority of our CSS support was intended to give the custom Lotus SWT widgets as much flexibility as possible. Styling standard SWT widgets is supported but very limited (fonts, colors, background image).

Another interesting development comes in the form of Eclipse Riena which is currently in the incubation stage. While you might want to skip the buzzword soup in the project description (enterprise service oriented blah blah), Riena aims to bring a fresh look to Eclipse RCP applications. The presentations at Eclipse Summit (PDF) and Eclipse Forum Europe (PDF) show these designs (click for full size view):

And while the UI of the sample applications shipped with milestone 4 of Riena 1.0 is quite far from the design mockups above, the trends are quite clear – Eclipse / SWT based applications are trying to break away from the native look-and-feel. So what are the plans for core SWT layer?

The answer to this question might be found in the mailing lists of e4 project. e4 is the codename for the next major release of Eclipse (hence the number 4). There are a lot of interesting ideas bouncing around the lists, including using EMF for driving the UI definitions (aiming, perhaps, at the same level of design/development separation as available in WPF, Apollo and JavaFX) and targetting different runtime environments such as Web browsers. It appears that one of the fundamental shifts is going to be the support for CSS skinning for the UI components.

Kevin McGuire is a platform UI contributor working for IBM on Eclipse UI, and his views on Eclipse-based RCP applications are quite refreshing:

As I survey the Eclipse based applications, RCP or not, they all look, well, like Eclipse based applications. Eclipse provides much power through reuse of existing components and extension of frameworks. But my goal as an application developer is to build software that is as appropriate for my audience as possible. That audience could be anybody. However, many choices we made early on in Eclipse were with an IDE user in mind and just don’t work well for other user types.

Why should my choice of technology so blatantly drive the UI experience? I’d like all that reuse and power, thank you, but the end result shouldn’t betray the technology used to build it, provided I am willing to invest in specializing it.[…] I’d like to see as rich a set of graphical front ends for Eclipse. Certainly CSS helps by providing good separation of behaviour and UI, but the components must be designed to make use of this separation.

[…] Eclipse based applications should be capable of the same degree of visual and interaction sophistication as web based applications. This is essential for reaching a wider audience.

This point of view is also shared by Christian Campo from the Riena project:

  • RCP UI looks like the IDE
  • is not that easy on endusers
  • while there is an option to allow “freestyle” there is certain of look that seems well established i.e. Outlook and others (including Riena)
  • there is already some common sense how user interfaces for endusers are designed like MS Office, Lotus etc.
  • wouldn’t it be cool that we have more support for that in Eclipse rather than each application has to build that from scratch.
  • endusers no longer expect their tools to have a native platform look

Are we going to see a UI customization layer in SWT that is similar to Swing’s look-and-feels?