Commit 07fe54cc authored by Simon Barner's avatar Simon Barner
Browse files

EReferencePropertySectionBase: bug fixes and minor improvements

* Refresh entire property section when combo box is used: Need to
  complete update derived sections that add additional UI elements
* Fix management of enabled state
* Add setSelection(): safe programmatic change of combo box value

Issue-Ref: 3470
Issue-Url: https://af3-developer.fortiss.org/issues/3470

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 755c43ce
......@@ -3,7 +3,7 @@ ContextMenuSubMenuContributorBase.java 6275d96fe8690d9d4744bcbaef3c7d14ba8e30ff
DialogMessageHandler.java 8714da09a777c8557de0a5c48ff68c340f9fa91d GREEN
EObjectActionBase.java 4ef9f8be59e64d4838acc9e268d418ba5d94fa1a GREEN
EReferenceListPropertySectionBase.java bbc5f6851842a9cb0af5e9898d9c6e197a36312a YELLOW
EReferencePropertySectionBase.java 3347e99b2fc135dd4b3117407179900ef757092c GREEN
EReferencePropertySectionBase.java 45411fc3bae5b9251fb465ec36fc39f0f4d5dc44 YELLOW
EditorBase.java 9c09fff92945256bb8680992ae7bb2c78f47b150 GREEN
IListPropertySection.java a093a8a625d291b8adecec5082e32748a2d99f9e YELLOW
ModelEditorBindingBase.java 4c5ac569c0b6e7678fc8191096b26dfd09fdcb98 GREEN
......
......@@ -114,6 +114,7 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends
setModelValue(input, (R)newValue);
}
});
refresh();
}
}
});
......@@ -164,6 +165,7 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends
@Override
public void refresh() {
super.refresh();
modelReferenceCombo.getCombo().setEnabled(false);
if(input == null) {
return;
......@@ -175,8 +177,7 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends
modelReferenceCombo.setInput(initialInput);
List<R> values = getValues(input);
if(values == null || values.isEmpty()) {
modelReferenceCombo.getCombo().setEnabled(false);
modelReferenceCombo.setSelection(new StructuredSelection(NONE));
setSelection(null);
return;
}
modelReferenceCombo.getCombo().setEnabled(true);
......@@ -184,6 +185,11 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends
// Set initial selection
EObject value = getModelValue(input);
setSelection(value);
}
/** Sets the selection of the {@link #modelReferenceCombo} . */
private void setSelection(EObject value) {
userSelection = false;
modelReferenceCombo.setSelection(new StructuredSelection(value == null ? NONE : value));
userSelection = true;
......
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