Skip to content

Commit 008a431

Browse files
author
Hanseter
committed
Workaround for another controlsfx bug
1 parent 879f1ac commit 008a431

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
</instructions>
9696
</configuration>
9797
</plugin>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-source-plugin</artifactId>
101+
<executions>
102+
<execution>
103+
<id>attach-sources</id>
104+
<goals>
105+
<goal>jar-no-fork</goal>
106+
</goals>
107+
</execution>
108+
</executions>
109+
</plugin>
98110
</plugins>
99111
</build>
100112

src/main/kotlin/com/github/hanseter/json/editor/controls/EnumSetControl.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class EnumSetControl(
2424
//checkbox model is buggy when there are two selected elements and the first one was deselected.
2525
//even though this looks like a nop, it forces the checkbox model to "reload"
2626
//should be this bug in controlsfx: https://github.com/controlsfx/controlsfx/issues/1550
27-
c.list.forEach { }
27+
c.list.forEach { }
2828
controlChanged(c.list)
2929
}
3030

@@ -138,8 +138,13 @@ class EnumSetControl(
138138
val value = (new ?: model.defaultValue)?.toSet()
139139
if (value == null || model.rawValue == null) return
140140

141-
control.checkModel.checkIndices(*value.map { control.items.indexOf(it) }
142-
.filter { it > -1 }.toIntArray())
141+
control.checkModel.checkIndices(
142+
*value
143+
.map { control.items.indexOf(it) }
144+
.filter { it > -1 }
145+
.sorted()
146+
.toIntArray()
147+
)
143148
}
144149
}
145150

0 commit comments

Comments
 (0)