Apache Pivot 2.0 Released
I am pleased to announce the release of Apache Pivot 2.0. Apache Pivot is an open-source platform for building installable Internet applications (IIAs) in Java. This major update includes a number of significant enhancements including:
Support for dynamic data binding
Pivot 1.5 and earlier supported data binding via a load/store model that maps well to client/server applications such as REST clients. However, a more dynamic model, where a property of a target element is automatically updated whenever a source value changes, is also useful in many circumstances.
Pivot 2.0 adds support for declaratively creating such dynamic binding relationships as well as the ability to define them in code. For example, the following markup creates a binding association between a page variable named "myText" and the "text" property of a Label instance. Any time the value of "myText" changes, the value of the label's "text" property is also updated:
Classes can now specifiy a default property using the new @DefaultProperty annotation. For example, the org.apache.pivot.wtk.Window class declares a default property of "content", making the
element in markup optional. Taking advantage of default properties can significantly reduce the verbosity (and indent depth) of BXML (formerly called WTKX) markup.
The JSONSerializer, CSVSerializer, and XMLSerializer classes allow an application to read structured content from an input stream. In Pivot 1.5 and earlier, callers had to wait until the Serializer#readObject() method returned in order to access the deserialized data. Pivot 2.0 allows developers to hook into the serialization process and be notified as data is read. For example, JSONSerializer now fires events whenever a string, number, boolean, list, or map value is read, and XMLSerializer fires events as elements and text nodes are read. This allows a caller to update the UI incrementally rather than waiting until the entire stream is processed, making an application seem considerably more responsive.
Support for named styles
While Pivot has always provided support for modifying the appearance and behavior of components via CSS-like styles, it did not include support for "named styles" (also known as "style classes"). Pivot 2.0 adds this capability, including support for both typed and untyped style selectors.
Support for SVG images
Pivot 1.5 and earlier included a set of classes for declaratively constructing drawings using a "shape DOM" or "scene graph", which mirrored the equivalent drawing primitives in the java.awt.geom package. While these classes provided a convenient way to implement retained mode drawing, they were of little practical use, since such drawings had to be constructed by hand - no support was provided for reading standard image formats such as SVG or Adobe Illustrator documents.
In Pivot 2.0, the "shape DOM" classes have been eliminated and replaced with a new SVG-based Drawing class. This allows developers to freely interchange bitmap-based images (such as JPEG, PNG, or GIF) and scalable vector images in a Pivot application. SVG support in Pivot 2.0 is provided by the SVG Salamander project.
New TextArea component
The TextArea component was completely overhauled in Pivot 2.0. It now supports common text editing features including word navigation and undo/redo, and cut/paste behavior has been improved. Word navigation and undo/redo has also been added to TextInput.
"Repeatable" list buttons
A "repeatable" flag has been added to ListButton to support "split button"-type behavior. When enabled, a mouse click on the trigger area of the button will show the drop down, but a click on the content area will not and will instead simply "press" the button.
The TabPane component now supports user-closeable tabs.
Multiple host windows
Though Pivot provides a rich set of window types, they are all internal to the host frame or applet. A common request from developers was for improved support for multiple top-level native frames. Such support has been added to Pivot 2.0: applications launched via DesktopApplicationContext can now easily create multiple host frames, providing a much more seamless desktop experience.
Additional color schemes
Though Pivot has always provided the ability to create custom color schemes, previous versions have included only a single default scheme. Pivot 2.0 includes a collection of color schemes which are optimized for a variety of popular desktop environments.
Eclipse launcher for Pivot applications
Pivot now includes an Eclipse plugin to help simplify the task of creating launch configurations for Pivot applications. When the plugin is installed, any class that implements the Application interface can be automatically launched via a right-click context menu. Additionally, any BXML file that has a root element that is a subclass of Window can also be launched via right-click using the ScriptApplication launcher class included in the platform.