File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
src/main/kotlin/com/github/hanseter/json/editor Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ class JsonPropertiesEditor @JvmOverloads constructor(
164164 }
165165
166166 fun removeObject (objId : String ) {
167+ treeTableView.selectionModel.clearSelection()
167168 (idsToPanes.remove(objId)?.treeItem)?.also {
168169 (treeTableView.root as FilterableTreeItem ).remove(it)
169170 }
@@ -203,6 +204,7 @@ class JsonPropertiesEditor @JvmOverloads constructor(
203204 }
204205
205206 fun clear () {
207+ treeTableView.selectionModel.clearSelection()
206208 idsToPanes.clear()
207209 (treeTableView.root as FilterableTreeItem ).clear()
208210 rebindValidProperty()
@@ -322,7 +324,7 @@ class JsonPropertiesEditor @JvmOverloads constructor(
322324 createValidationMessage(
323325 label,
324326 treeItemData.validationMessage
325- )?.also ( DECORATOR :: applyValidationDecoration)
327+ )?.also { Platform .runLater { DECORATOR . applyValidationDecoration(it) } }
326328 }
327329 }
328330
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class MultiLineStringControl : ControlWithProperty<String?> {
1414 prefHeightProperty().bind(maxHeightProperty())
1515 minHeightProperty().bind(maxHeightProperty())
1616 textProperty().addListener { _, _, text ->
17- if (' \n ' in text ) {
17+ if (text?.contains( ' \n ' ) == true ) {
1818 maxHeight = 70.0
1919 setHorizonzalScrollbarPolicy(ScrollPane .ScrollBarPolicy .AS_NEEDED )
2020 } else {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class FilterableTreeItem<T>(value: T) : TreeItem<T>(value) {
4646 fun setFilter (filter : (T ) -> Boolean ) {
4747 filteredList.setPredicate { child ->
4848 child.setFilter(filter)
49- if (child.children.size > 0 ) {
49+ if (child.children.isNotEmpty() ) {
5050 true
5151 } else {
5252 filter(child.value)
You can’t perform that action at this time.
0 commit comments