tornadofx / tornadofx / toggleClass

toggleClass

fun <T : Node> T.toggleClass(cssClass: CssRule, predicate: Boolean): <ERROR CLASS>
fun <T : Tab> T.toggleClass(cssClass: CssRule, predicate: Boolean): <ERROR CLASS>

Toggle the given type safe css class based on the given predicate. Pseudo classes are also supported.

fun <T : Node> T.toggleClass(cssClass: CssRule, observablePredicate: ObservableValue<Boolean>): Unit
fun <T : Tab> T.toggleClass(cssClass: CssRule, observablePredicate: ObservableValue<Boolean>): Unit

Toggle the given type safe css class based on the given predicate observable value. Whenever the observable value changes, the class is added or removed. Pseudo classes are also supported.

fun <T : Node> T.toggleClass(className: String, predicate: Boolean): <ERROR CLASS>
fun <T : Tab> T.toggleClass(className: String, predicate: Boolean): <ERROR CLASS>