Tag: 可观察到

我如何重构视图,以允许过滤绑定到tornadofx应用程序内的observableArrayList的项目

我从gradle hello-world例子开始,findhttps://github.com:JetBrains/kotlin-examples.git,并将其修改为使用TornadoFX。 这是一个显示项目列表的应用程序。 您可以添加到列表中, RequestView将自动显示所有项目。 我有它的工作,以便存储的项目绑定到一个observableArrayList但我现在要实现一个使用TextView在底部的filter。 但是,我很难理解这是否意味着我应该创建一个新的列表,这是在RequestView内部进行管理的,并且从中进行过滤,或者如何执行。 package demo import javafx.collections.FXCollections import javafx.geometry.Pos import javafx.scene.control.TextField import javafx.scene.layout.VBox import javafx.scene.text.FontWeight import tornadofx.* class helloWorldApp : App(HelloWorld::class) { } class HelloWorld : View() { override val root = VBox() var requestView: RequestView by singleAssign() var filterField: TextField by singleAssign() init { with(root) { requestView = RequestView() this […]