diff options
author | Frank Becker | 2016-07-10 15:41:50 +0000 |
---|---|---|
committer | Frank Becker | 2016-07-10 15:41:50 +0000 |
commit | 4a0f348b7e484452c227585206a2cda6dd94d64d (patch) | |
tree | 4c85c2af19ee556b8c2f052435219ced81986339 /org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui | |
parent | bde2c5d4613108c0b964b9f170e42777cf19cdf3 (diff) | |
download | org.eclipse.mylyn.tasks-4a0f348b7e484452c227585206a2cda6dd94d64d.tar.gz org.eclipse.mylyn.tasks-4a0f348b7e484452c227585206a2cda6dd94d64d.tar.xz org.eclipse.mylyn.tasks-4a0f348b7e484452c227585206a2cda6dd94d64d.zip |
492500: read-only required attributes should not have error decorator
Change-Id: Ib378fddaa2b96cac892fdae55514448daaa53979
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=492500
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java index 41ec2a872..a7f2c9f20 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java @@ -45,7 +45,7 @@ public abstract class AbstractAttributeEditor { /** * The key used to associate the editor control with the corresponding task attribute. This enables lookup of the * model element from the widget hierarchy. - * + * * @since 3.5 * @see Control#getData(String) * @see #getControl() @@ -315,7 +315,10 @@ public abstract class AbstractAttributeEditor { protected boolean needsValue() { boolean isRequired = getTaskAttribute().getMetaData().isRequired(); boolean hasValue = !StringUtils.isEmpty(getAttributeMapper().getValue(getTaskAttribute())); - return isRequired && !hasValue; + boolean isReadOnly = getTaskAttribute().getMetaData().isReadOnly(); + // for an empty required read only attribute we do not show the error decorator + // because the user can not change the value (see bug#492500 ). + return isRequired && !hasValue && !isReadOnly; } /** @@ -355,7 +358,7 @@ public abstract class AbstractAttributeEditor { * <code>UnsupportedOperationException</code>. * <p> * Subclasses should overwrite this method. - * + * * @since 3.1 * @throws UnsupportedOperationException * if this method is not supported by the editor @@ -367,7 +370,7 @@ public abstract class AbstractAttributeEditor { /** * Subclasses that implement refresh should override this method to return true, so that they will be automatically * refreshed when the model changes. - * + * * @return whether the editor should be automatically refreshed when the model changes * @since 3.6 */ |