Commit 94b0ca2
committed
SwingObjectWidget: set values by string comparison
Previously, we were trying to set the JComboBox value
with a new instance of the object.
We don't always have the possibility to keep a list of the allowed
choices for the current model, nor can we override the `equals()` method
for the `Object`s of this widget instance.
So we have to fall back to comparing all combobox items to the current
value by their `toString()` and `ObjectService.getName()` strings.1 parent 93e963b commit 94b0ca2
File tree
1 file changed
+18
-3
lines changed- src/main/java/org/scijava/ui/swing/widget
1 file changed
+18
-3
lines changedLines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
| |||
120 | 135 | | |
121 | 136 | | |
122 | 137 | | |
123 | | - | |
| 138 | + | |
124 | 139 | | |
125 | 140 | | |
126 | 141 | | |
| |||
0 commit comments