Commit a948038c authored by Axel Howind's avatar Axel Howind

fix exception when retrieving option values

parent 78960684
......@@ -67,9 +67,9 @@ public class OptionsPane extends GridPane implements InputControl<OptionValues>{
control = c;
property = c.textProperty();
} else if (option instanceof ChoiceOption<?>) {
var items = FXCollections.observableList(((ChoiceOption<?>)option).getChoices());
var c = new ComboBox<>(items);
c.getSelectionModel().select(items.indexOf(value));
var choices = FXCollections.observableList(((ChoiceOption<?>)option).getChoices());
var c = new ComboBox<>(choices);
c.getSelectionModel().select(choices.indexOf(value));
control = c;
property = c.valueProperty();
} else {
......@@ -97,9 +97,10 @@ public class OptionsPane extends GridPane implements InputControl<OptionValues>{
@Override
public OptionValues get() {
OptionValues values = new OptionValues();
for (var item: items.entrySet()) {
Option<?> option = item.getKey();
Value<?> value = Option.value(item.getValue());
for (var entry: items.entrySet()) {
Option<?> option = entry.getKey();
Property<?> property = entry.getValue();
Value<?> value = (Value<?>) property.getValue();
values.put(option, value);
}
return values;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment