Skip to content
Snippets Groups Projects
Commit d04e95be authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Modify the DerivedAnnotationValueProvider (org.fortiss.tooling.base.ui), such...

Modify the DerivedAnnotationValueProvider (org.fortiss.tooling.base.ui), such that the editability of the annotation editing support mirrors the behavior of the derived annotation.
parent c72d3f03
No related branches found
No related tags found
No related merge requests found
......@@ -124,7 +124,12 @@ public abstract class DerivedAnnotationValueProviderBase<T extends IDerivedAnnot
/** {@inheritDoc} */
@Override
public boolean canEdit(T specification, String instanceKey) {
if(isDerivedKey(instanceKey) && !isEditableByUser) {
if(isDerivedKey(instanceKey) &&
!isEditableByUser ||
(isEditableByUser && (!specification.isUserAnnotatedValuePreferred() && specification
.getDerivedValue() != null))) {
// Deactivate editing if the editing is principally disabled or the derived value would
// override the user annotated one.
return false;
}
return super.canEdit(specification, instanceKey);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment