Eclipse on SWT on JavaFX Video / Java8 Launch Panel on e(fx)clipse
As I’ve been at EclipseCon last week and showed our work on JavaFX tooling and SWT on JavaFX I wanted to share the video I used in the talk.
It was BTW great to see an e(fx)clipse an Eclipse Project (at around Minute 13 if you want review it) getting mentioned in the Java8 launch video by Richard Bair and Mark Reinhold!
It looks like there’s a big interest to make SWT on JavaFX happen to provide a nice looking IDE and people a possibility to transition from SWT to JavaFX UIs step by step instead of rewriting everything is a big splash.
I’ve always stated that our main focus is RCP but even for this step we need to get help by code contributions or funding we simply can not do all this work for free.
Just to make it super clear. What we have today is I’d say something in between a proof-of-concept and an tech-preview version. I’ve learned a lot on how a port needs to be done and we would now need to reflect what is good what is bad.
I’m still not convinced that we can do a full port of the current SWT-API unless they introduce some higher-level concept to replace low-level ones. Most pressing are:
Event Loop exposure:
The biggest problem is caused by the inability for JavaFX to find out an IDLE-state which is e.g. used by the Eclipse-IDE to run low priority stuff
All this rendering stuff introduced by SWT is although once more doable using JavaFX Canvas but not a natural fit for it.
Owner draw in Table/Trees:
First of all: Ownerdraw can be emulated in JavaFX by using a JavaFX-Canvas but it completely ineffecient from a resource point of view when you could use Text-Flow instead.
Did you ever asked why on hell you need to put your Table/Tree into an owerdraw mode just to get a item-text showing up in multiple colors in one cell. JFace perfectly hides this from you but I don’t think it is the right layer to address this problem, e.g. owner draw has problems with accessibility, …
I dream of an SWT-API like this:
TableItem i = .... i.setText("red blue", new StyleRange(0,3,"#f00"), new StyleRange(3,6,"#00f") );
StyledText-API without Direct-Paint:
It would be so nice if all the StyledText semantics would not be exposed in a very direct draw style fashion but having a higher level abstraction one could build all the editor support on.
On the other hand there’s missing stuff as well in JavaFX, like that it is not possible to control the trim-buttons (min, max, close) in a JavaFX Stage as good as on an SWT-Shell. So there JavaFX would have to move forward beside e.g. providing missing controls and APIs (even if they are internal one) to control certain stuff like a Spinner, a Font-Dialog, … .
And last but not least there are areas where both worlds are so different that you can never get them work on an equal API – it is hard to explain many of those but when you hit them you fairly soon understand that this not solvable.