All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.marid.fx.table.ReadOnlyCheckBoxTableCell.kt Maven / Gradle / Ivy

There is a newer version: 0.9.8.10
Show newest version
package org.marid.fx.table

import javafx.scene.control.CheckBox
import javafx.scene.control.TableCell

class ReadOnlyCheckBoxTableCell : TableCell() {

  private val checkBox = object : CheckBox() {
    override fun arm() {}
  }

  init {
    styleClass.add("check-box-table-cell")
    graphic = checkBox
    text = null
  }

  override fun updateItem(item: Boolean?, empty: Boolean) {
    super.updateItem(item, empty)
    if (empty || item == null) {
      checkBox.isVisible = false
    } else {
      graphic = checkBox
      checkBox.isVisible = true
      checkBox.isSelected = item
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy