use of org.csstudio.display.builder.editor.undo.SetWidgetEnumPropertyAction in project org.csstudio.display.builder by kasemir.
the class EnumWidgetPropertyBinding method submit.
/**
* Submit combo value to model
*/
private void submit() {
final String entered = jfx_node.getValue();
// Combo switched to editable, but user never entered anything?
if (entered == null)
return;
updating = true;
final int ordinal = jfx_node.getItems().indexOf(entered);
final Object value = (ordinal >= 0) ? ordinal : entered;
undo.execute(new SetWidgetEnumPropertyAction(widget_property, value));
if (!other.isEmpty()) {
final String path = widget_property.getPath();
for (Widget w : other) {
final EnumWidgetProperty<?> other_prop = (EnumWidgetProperty<?>) w.getProperty(path);
undo.execute(new SetWidgetEnumPropertyAction(other_prop, value));
}
}
updating = false;
}
Aggregations