tornadofx.adapters.TornadoFXResizeFeatures.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tornadofx Show documentation
Show all versions of tornadofx Show documentation
Lightweight JavaFX Framework for Kotlin
package tornadofx.adapters
import javafx.collections.ObservableMap
import javafx.scene.control.TableColumn
import javafx.scene.control.TableView
import javafx.scene.control.TreeTableColumn
import javafx.scene.control.TreeTableView
import javafx.util.Callback
typealias Properties = ObservableMap
typealias TableViewResizeCallback = Callback, Boolean>
typealias TreeTableViewResizeCallback = Callback, Boolean>
fun TreeTableView.ResizeFeatures<*>.toTornadoFXResizeFeatures() = TornadoFXTreeTableResizeFeatures(this)
fun TableView.ResizeFeatures<*>.toTornadoFXFeatures() = TornadoFxTableResizeFeatures(this)
interface TornadoFXResizeFeatures {
val table: TornadoFXTable
val delta: Double
val column: TornadoFXColumn?
}
class TornadoFXTreeTableResizeFeatures(val param: TreeTableView.ResizeFeatures) : TornadoFXResizeFeatures, TreeTableView<*>> {
override val column = param.column?.toTornadoFXColumn()
override val table = param.table.toTornadoFXTable()
override val delta: Double get() = param.delta
}
class TornadoFxTableResizeFeatures(val param: TableView.ResizeFeatures) : TornadoFXResizeFeatures, TableView<*>> {
override val table: TornadoFXTable, TableView<*>> = TornadoFXNormalTable(param.table)
override val delta: Double = param.delta
override val column: TornadoFXColumn>? = param.column?.let { TornadoFxNormalTableColumn(it) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy