You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
package nova.monadic_sfx.util.controls
|
|
|
|
import com.jfoenix.{controls => jfoenixc}
|
|
import monix.execution.Scheduler
|
|
import monix.reactive.Observable
|
|
import scalafx.Includes._
|
|
import scalafx.collections.ObservableBuffer
|
|
import scalafx.scene.control.ListView
|
|
|
|
object JFXListView {
|
|
implicit def sfxListView2jfx[T](l: JFXListView[T]): jfoenixc.JFXListView[T] =
|
|
if (l != null) l.delegate else null
|
|
}
|
|
|
|
// extends Control(delegate)
|
|
// with SFXDelegate[jfoenixc.JFXListView[T]]
|
|
|
|
class JFXListView[T](
|
|
override val delegate: jfoenixc.JFXListView[T] = new jfoenixc.JFXListView[T]
|
|
) extends ListView[T] {
|
|
|
|
// def items_=(
|
|
// v: Observable[ObservableBuffer[T]]
|
|
// )(implicit s: Scheduler): Unit = {
|
|
// v.foreach { items() = _ }
|
|
// }
|
|
|
|
def items_=(v: Observable[Seq[T]])(implicit s: Scheduler): Unit = {
|
|
v.map(ObservableBuffer.from).foreach(items() = _)
|
|
}
|
|
|
|
def depth = delegate.depthProperty()
|
|
def depth_=(depth: Int) = delegate.setDepth(depth)
|
|
|
|
def expanded = delegate.expandedProperty()
|
|
def expanded_=(v: Boolean) = expanded() = v
|
|
|
|
}
|