Blog

e(fx)clipse 0.0.6 released

UPDATE Please download the latest version from efxclipse.org I've justed pushed the 0.0.6 release of my JavaFX 2.0 Tooling and Runtime for Eclipse named e(fx)clipse to my git-repo and you can download the p2 repo to your local hard drive and install it using this link (DO NOT SIMPLY UNPACK THE ZIP TO YOUR ECLIPSE-INSTALL USE THE "Install New Software..."-Wizard!). This release is the first one which does not only hold tooling stuff but also runtime components but I'll go into detail after having introduced the new tooling features. Here's a list of new and noteworthy stuff.

Tooling

css

Since b45 the CSS-Syntax for gradients changed to be valid CSS the CSS-Tooling of e(fx)clipse is now in sync with the one from the runtime. This release holds improved validation for radial-gradients

fxml

As outlined in my last blog I don't think fxml is meant to be authored directly by developers. It is a good foundation for tools to produce JavaFX-Objects graphs instead of generating Java-Code. My approach to it is that I created a small DSL (or better markup language) which provides all the features FXML understands but remove the XML noise - I named the markup language fxgraph. To better view fxml-Files I've added an xml-viewer with markup support.

fxgraph

Is a simple DSL which allows one to define a JavaFX object graph but instead of producing executable code as its output it simply creates the an fxml-File which can be interpreted by the JavaFX runtime.. I know that there are a number of DSLs out there (GroovyFX, ScalaFX, Visage, ...). The difference here is that fxgraph is not a programming language but a markup language which is used at design time but has no runtime concepts. The output of a fxgraph is fxml - so it is not a replacement for fxml but a different way to express the content of a fxml-File. The really cool thing about fxgraph is the excellent integration with Eclipse JDT/PDE because of Xtext+Xbase+JvmTypes which provides you content assistent like you get it in JDT. Class-ContentAssist for Element Definition Property-ContentAssist for Elements

PDE

OSGi is one of the keyconcepts in the up coming runtime components but to make the experience for users as good as possible integration into PDE is an absolute must. One of the most important things in this sense are project templates who allow a developers to:

  1. Create a runnable JavaFX Equinox OSGi-Application
  2. Create an OSGi-Bundle which uses JavaFX

The wizards are even more important for JavaFX based applications because there are some special settings and classpath adjustments needed to make your application compile, exported and run using Eclipse JDT/PDE. Application Wizard used to created an OSGi-Application bundle including a application and production definition in the plugin.xml Bundle Wizard used to create an OSGi-Bundle which uses JavaFX classes Product Wizard used to create a .product-File which is can be used to export an JavaFX application inside Eclipse or by using maven-tycho. There's no big difference to .product definition created by the default "Product Configuration" wizard but as always - the small things make the difference because to make JavaFX useable in OSGi (Equinox) one has to configure the Framework Adaptors appropriately and this is what the "JavaFX Product Configuration" wizard takes care of (See my other blog for some background info).

Runtime

As outlined in the first paragraph this release comes with a set of runtime components who are needed as a foundation for more sophisticated ones like the Eclipse 4 Application Platform. So what does this release come with:

Layout-Panes

I've ported some of the layouts one is used to from SWT:

  • FillLayoutPane: Is the FillLayout as you know it from SWT
  • GridLayoutPane: Is the GridLayout as you know it from SWT
  • RowLayoutPane: Is the RowLayout as you know it from SWT
  • SashLayoutPane: This one is probably not know to most of the people because it is not part of SWT nor Eclipse 3.x but has been developed for use in Eclipse 4.x which is not using Sashes for splitting up the Workbench-Window but a Layout

OSGi-Support

To make JavaFX useable in OSGi I've implemented 2 bundles and 1 fragment who make - together with the PDE-Integration - very easy to develop Equinox-OSGi-Applications. The following 2 bundles are available:

  • at.bestsolution.efxclipse.runtime.javafx Is a bundle which exports all public javafx-packages so that client bundles can define package-imports. The bundle doesn't hold the javafx-classes but when equinox requests javafx-Classes from at.bestsolution.efxclipse.runtime.javafx a framework adaptor steps in and does the class look up in the location the oracle-installer placed the javafx.jar in (Warning: At the moment the location is hard coded to "C:/Program Files (x86)/Oracle/JavaFX Runtime 2.0/lib/jfxrt.jar" but this will change with the next release if I can figure out how to locate those files in a better way)

  • at.bestsolution.efxclipse.runtime.osgi This is a fragment for "org.eclipse.osgi" which contributes specialized classloader which used by "at.bestsolution.efxclipse.runtime.javafx".

  • at.bestsolution.efxclipse.runtime.application This bundle provides a base class named AbstractJFXApplication which implements the IApplication-Interface for OSGi-Applications and can be subclassed like this:

    public class Application extends AbstractJFXApplication {
      @Override
      protected void jfxStart(Stage primaryStage) {
        Group root = new Group();
        Scene scene = new Scene(root, 800, 600, Color.BLACK);
        primaryStage.setScene(scene);
      }
    }
    

A whole lot of new features which means a lot of polishing has to go on as the 0.0.6 version number indicates. The most impressive feature I've implemented in the tooling is the support for fxgraph but the support for JavaFX in Equinox is also an extremely import feature.

published on
Previous
Teneo, OSGi and Javaassist for proxy loading