Releases: edvin/tornadofx
TornadoFX 1.5.3
This release brings some great syntax changes that further reduces boiler plate. You can now define a View like this:
class CustomerEditor : View("Edit Customer") {
override val root = borderpane {
}
}
We finally have great OSGi support - a demo screencast will follow shortly.
Below is a complete list of all improvements and bug fixes.
Important note: Version 1.5.3 is not binary compatible with 1.5.2, so make sure you do a full rebuild of your project. We've had reports some "sticky" IDEA cache, so try to restart your IDE if a rebuild doesn't do it.
Added
App.createPrimaryScene
overridable function to specify how the scene for the primary View is created- OSGI manifest metadata
- LayoutDebugger can edit new Node properties:
spacing
- Stylesheets can be dynamically added at runtime and will affect all active scenes
- Convenience methods for creating bindings on any object. e.g.
stringBinding(person, person.firstNameProperty, person.lastNameProperty) { "$firstName, #lastName" }
- View/Fragment takes optional title in constructor
Changed
- UIComponent.showModal now supports reopening even if modalStage was never removed
fieldset
block now operates on anHBox
instead ofPane
so you can writealignment = Pos.BASELINE_RIGHT
to right-align buttons etc- Set modalStage before showAndWait() (#151)
Parent.find
andUIComponent.find
renamed tolookup
for better alignment with JavaFXlookup
and to avoid confusion withfind(View::class)
- Improved
BorderPane
builders, they also now acceptUIComponent
references instead of instances - Builders now operate on
EventTarget
instead ofPane
and as a result, many builders have improved syntax and functionality - Reduced boilerplate for
App
creation (you can now useclass MyApp : App(MyView::class, Styles::class)
- ViewModel
commit
androllback
run on the UI thread because decorators might be invoked - ViewModel
commit
accepts a function that will be run if the commit is successful find
can now also findFragments
, sofindFragment
is deprecatedlookup
takes an optional op that operates on the UIComponent it foundTreeTableView/TableView.populate
accepts any kind ofIterable<T>
instead ofList
TornadoFX 1.5.2
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:
Added
- Validation support
- Decoration support
- Node.removeFromParent()
- Dimension arithmetics (#146)
- Get a reference to objects in other Components via
get(ComponentType::propertyName)
and set them viaset(ComponentType::propertyName, value
Node.replaceChildren
replaces current children with new ones created with builderNode.runAsyncWithProgress
shows a progress indicator instead of while async task is runningrunAsync
on Injectable class references (CustomerController::class.runAsync { listContacts(customerId) }
)runAsync
on Injectable class function references (CustomerController::listContacts.runAsync(customerId)
)ObservableValue.onChange
listenerUIComponent.whenDocked
andUIComponent.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 topopulate
that lazily creates children as needed - TreeItem nesting extension functions (#134)
- TableView
selectWhere()
,moveToTopWhere()
andmoveToBottomWhere()
(#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 acceptsKClass<View>
andKClass<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 whilelong(key)
returns Long?) - Improved compatibility with ScenicView by not creating inline/crossinline cellformatters (https://youtrack.jetbrains.com/issue/KT-13148)
Changed
- 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
TornadoFX 1.5.1
Added
- Shape builders (#129)
- Animation builders (#131)
- Replace View function:
UIComponent.replaceWith
fxid()
specific fx:id name as optional parameter- webview builder
Changed
- Call
onUndock
when UIComponent.modalStage closes - Rewrite of the CSS sub structure, cleaner selector syntax, negative dimensions, no need for
select
keyword for single selectors
Tornado FX 1.5.0
This release introduces support for multi valued css properties in type safe stylesheets. This means that you can finally provide multiple values for backgroundColor
for example. The change introduces an API break for these properties. Where you earlier would have written:
backgroundColor = Color.RED
You would now have to indicate that you're adding the color to a list of possible values:
backgroundColor += Color.RED
To supply multiple values you can either repeat the above statement, or use the multi
function:
backgroundColor = multi(Color.RED, Color.BLUE)
This release also feature life cycle functions to provide hooks for when an UIComponent
is docked inside a parent Node
or Scene
.
Changes
- Multivalue property support in type safe stylesheets (API break)
UIComponent.onDock
andUIComponent.onUndock
Tornado FX 1.4.10
Added
- Default Rest Engine supports gzip/deflate
- Default Rest Engine adds Accept: application/json by default
Changed
- Moved box/c functions outside CssBlock so they can be used in Stylesheet companion object
- Better error reporting and logging for missing or wrong fx:id vs fxid() usage
Tornado FX 1.4.9
Added
- Convert Iterable to JsonArray (
Iterable<JsonModel>.toJSON()
) - Clipboard functions (#110)
- ContextMenu builder
- TreeTableView column builder that takes an observable value creator
- TreeTableView
rowItem
accessor - TreeTableView
onUserSelect
- Preferences can be saved and loaded using the prefences function, see #107
Tornado FX 1.4.8
- Inline type safe styles
- Easier navigation of View to Node and Node to View (#112)
- Fragments can be declaratively created via
fragment
delegate - Type Safe CSS URL Handler will be force-installed if the JVM does not pick it up
Tornado FX 1.4.7
This release introduces the Form layout, which supports both FXML and type safe builders.
Added
- Form Builder (#111)
Build forms like the one above with ease:
Tornado FX 1.4.6
This release brings some minor improvements and support for the IntelliJ IDEA Plugin currently under development. Remember to recompile all sources!
Added
- openModal supports new optional
block
andowner
parameters - Spinner builder (#106)
- POJO Binding Support (#104)
Changed
- App can be started without overriding
primaryView
-> startup parameter--view-class=package.View
- addClass, removeClass, toggleClass returns the Node it was applied to (for chaining support)
Tornado FX 1.4.5
This is a bug fix release on the heels of 1.4.4 to resolve some bugs and inconveniences that was introduced with the new reload functionality. SingleViewApp has been removed because it created more problems than it solved. My apologies!
Changed
- Live Views no longer reloads nested UIComponents twice (#98)
- Added log info message when a View is reloaded
openModal
did not configure tornadofx.scene correctly, causing issues with Live ViewsNode.setId(Styles.someId)
did not set the correct value
Removed
- SingleViewApp increased framework complexity and had too many caveats so it was removed
- UIComponent.pack/unpack was removed because their function was not needed and not intuitive (#98 (comment))