Upgrade to TornadoFX 1.6.2.

This commit is contained in:
Chris Rankin 2017-02-20 09:13:02 +00:00
parent ac56c7d451
commit ddd8d6a513
4 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '1.0.6'
ext.tornadofx_version = '1.6.0'
ext.tornadofx_version = '1.6.2'
ext.jna_version = '4.1.0'
ext.purejavacomm_version = '0.0.17'
ext.guava_version = '14.0.1'

View File

@ -94,6 +94,10 @@ class DemoBenchView : View("Corda Demo Bench") {
addNodeButton.isDisable = false
}
/**
* Ensures that DemoBench always has at least one instance NodeTabView.
* This method must NOT be called if DemoBench is shutting down.
*/
fun forceAtLeastOneTab() {
if (nodeTabPane.tabs.isEmpty()) {
addNodeButton.fire()

View File

@ -169,9 +169,9 @@ class NodeTabView : Fragment() {
init {
INTEGER_FORMAT.isGroupingUsed = false
// Ensure that we close the terminal along with the tab.
// Ensure that we destroy the terminal along with the tab.
nodeTab.setOnCloseRequest {
nodeTerminalView.close()
nodeTerminalView.destroy()
}
root.add(nodeConfigView)

View File

@ -35,7 +35,7 @@ class NodeTerminalView : Fragment() {
private val launchWebButton by fxid<Button>()
private val launchExplorerButton by fxid<Button>()
private var isClosed: Boolean = false
private var isDestroyed: Boolean = false
private val explorer = explorerController.explorer()
private val webServer = webServerController.webServer()
private val viewer = DBViewer()
@ -143,14 +143,14 @@ class NodeTerminalView : Fragment() {
}
})
fun close() {
if (!isClosed) {
fun destroy() {
if (!isDestroyed) {
webServer.close()
explorer.close()
viewer.close()
rpc?.close()
pty?.close()
isClosed = true
isDestroyed = true
}
}