@edvin edvin released this Jul 21, 2016 · 1757 commits to master since this release

Assets 3

This is a pretty massive release with some major features, lots of small improvements and some bug fixes.

The most notable changes are the ViewModel and Validation, the LayoutDebugger
and the new alternative syntax for property delegates. Now you can create getters and setters for a Property<T> simply by adding var foo by fooProperty.

The type safe CSS got a serious overhaul as well.

There are lots of small gems in this release, like the runAsyncWithProgress, the Property.onChange { } listener and the View.replaceWith(otherView, transitionAnimation) function which switches the current scene graph or embedded view with another.

TornadoFX now plays nicer with ScenicView. The reason for the previous problems was that Kotlin produces invalid class names that fail the check in Class.getSimpleName(). We have worked around this by staying away from inlining in some specific cases.

We are working on a demo application to showcase the framework. You can watch a small teaser video here or check out the code. This is a work in progress.

Here is the complete changelog:


  • Validation support
  • Decoration support
  • Node.removeFromParent()
  • Dimension arithmetics (#146)
  • Get a reference to objects in other Components via get(ComponentType::propertyName) and set them via set(ComponentType::propertyName, value
  • Node.replaceChildren replaces current children with new ones created with builder
  • Node.runAsyncWithProgress shows a progress indicator instead of while async task is running
  • runAsync on Injectable class references (CustomerController::class.runAsync { listContacts(customerId) })
  • runAsync on Injectable class function references (CustomerController::listContacts.runAsync(customerId))
  • ObservableValue.onChange listener
  • UIComponent.whenDocked and UIComponent.whenUndocked
  • LayoutDebugger (https://github.com/edvin/tornadofx/wiki/Layout-Debugger)
  • ViewModel (https://github.com/edvin/tornadofx/wiki/ViewModel)
  • TableView cellDecorator
  • ComboBox cellFormat formatter function
  • TreeView lazyPopulate alternative to populate that lazily creates children as needed
  • TreeItem nesting extension functions (#134)
  • TableView selectWhere(), moveToTopWhere() and moveToBottomWhere() (#134)
  • Group builder group
  • Improved tab for tabpane builder tab("Name") { operateOnTab(); content { .. } }
  • Create bindings dependent on an ObservableValue: objectBinding + integerBinding, longBinding etc for all applicable types
  • New, simplified method of creating properties val nameProperty = SimpleStringProperty(); var name by nameProperty (#143)
  • Extract a JsonObject and turn it into a JsonModel by with json.jsonModel("key")
  • kotlin-reflect.jar is now a default dependency. It can be removed if you don't use any of the TableView.column functions. Over time, more features will probably require it.
  • Replace View function UIComponent.replaceWith now accepts KClass<View> and KClass<Fragment> as well as UIComponent instances
  • label() and text() builders now accepts an ObservableValue for unidirectional binding
  • Added non-null JSON getters (getLong(key) returns Long while long(key) returns Long?)
  • Improved compatibility with ScenicView by not creating inline/crossinline cellformatters (https://youtrack.jetbrains.com/issue/KT-13148)


  • ImageView builder now loads image lazily by default
  • CSSUrlHandler force install moved to CSS.CompanionObject to make sure it happens in time
  • addClass/removeClass now accepts vararg
  • alert() function now returns Alert object
  • Fixed bug: Inherited properties cannot be accessed via getProperty - NoSuchFieldException (#141)
  • Uncaught exceptions will now be logged to the console to ensure error message delivery even when UI is not initialized
  • Fixed CheckBoxCell binding (#140)
  • Builder op block made optional on many builders (#126)
  • Fixed bug in chooseFile (returned list with null instead of empty list when nothing was selected