JavaFXPluginPreviewSpecification

Preview Feature specification.

Document Status Initial Draft

This is living document. Some parts of it are still unwritten.
If you are interested in changes in this document you might want to sign to this page RSS feed.

Introduction

The idea of Preview facility is to let developer see the live results of the execution of the code being developed. This feature looks very useful for JavaFX Script which is designed to allow user easily develop GUIs using a simple and powerful declarative syntax. The Preview allows developer to see the changes made by modifying of the source code without having to continually rebuild and execute the JavaFX application.

Preview feature use

Preview feature is disabled by default. The way to enable the feature depends on its level. Please see details below.

Preview feature levels

There are two levels of the Preview feature available:

  • Single JavaFX Script file level
  • JavaFX Script Project level

Single JavaFX Script file level

This preview is similar to one implemented in JavaFX Script plugin for NetBeans IDE 6.0. The single JavaFX Script file level Preview can be enabled using "Preview" button on the JavaFX Script file toolbar for currently active JavaFX Script source code file. As a result of this operation, new window is opened on top of JavaFX Script source file. If the source file can be compiled successfully and it represents a widget, the corresponding UI will be rendered in the Preview window. User is allowed to enable/disable preview feature for each file in the project independently. The figure below illustrates preview of single JavaFX Script file. The "Preview" button is the most left button on the toolbar shown:

Preview

JavaFX Script Project level

The project level preview feature can be activated by right-click JavaFX Script project and select "Preview" item of context menu like shown below:

Preview

User selects the main class in the corresponding window (TBD). If the whole project can be compiled successfully, the corresponding UI will be shown:

Preview


Open issues

The Preview feature can't be run in same VM and application context with NetBeans IDE since it will affect the whole NetBeans IDE functionality. There are two possible ways to separate Preview from NetBeans IDE:

  1. Run it in the different virtual machine
  2. Run it in the different application context.

The first solution is a bit complicated. It requires implementation of reliable and safety data transfer between two virtual machines, transfer of images/dealing with code that works with native windows binding/re-parenting. Most likely the different application context should be used (choice 2) but this is under investigation now.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo