
tornadofx.controlsfx.ControlsFXChildInterceptor.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tornadofx-controlsfx Show documentation
Show all versions of tornadofx-controlsfx Show documentation
TornadoFX integration library for ControlsFX
The newest version!
package tornadofx.controlsfx
import javafx.event.EventTarget
import javafx.scene.Node
import javafx.scene.control.ToggleButton
import org.controlsfx.control.InfoOverlay
import org.controlsfx.control.SegmentedButton
import org.controlsfx.control.SnapshotView
import tornadofx.*
class ControlsFXChildInterceptor : ChildInterceptor {
override fun invoke(parent: EventTarget, node: Node, index: Int?): Boolean = when (parent) {
is SnapshotView -> {
parent.node = node
true
}
is InfoOverlay -> {
parent.run {
this.content = node
this.text
}
true
}
is SegmentedButton -> {
parent.buttons.add(node as ToggleButton)
}
else -> false
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy