Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java11
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java7
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/DefaultTaskSchemaTest.java4
4 files changed, 23 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java
index 4bb6cb167..dc8a9df9b 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java
@@ -125,6 +125,8 @@ public abstract class AbstractTaskSchema {
return TaskAttribute.KIND_PEOPLE;
} else if (flags.contains(Flag.OPERATION)) {
return TaskAttribute.KIND_OPERATION;
+ } else if (flags.contains(Flag.DESCRIPTION)) {
+ return TaskAttribute.KIND_DESCRIPTION;
}
return null;
}
@@ -193,7 +195,14 @@ public abstract class AbstractTaskSchema {
}
public enum Flag {
- ATTRIBUTE, OPERATION, PEOPLE, READ_ONLY
+ ATTRIBUTE, OPERATION, PEOPLE, READ_ONLY,
+ /**
+ * A flag used to indicate that the field is related to a description.
+ *
+ * @since 3.11
+ * @see TaskAttribute#KIND_DESCRIPTION
+ */
+ DESCRIPTION
};
protected class FieldFactory {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java
index c66f0bd1e..0aeb330fc 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java
@@ -110,7 +110,8 @@ public final class DefaultTaskSchema extends AbstractTaskSchema {
Messages.DefaultTaskSchema_Modified_Label, TaskAttribute.TYPE_DATE, "modification_date", Flag.READ_ONLY); //$NON-NLS-1$
public final Field DESCRIPTION = createField(TaskAttribute.DESCRIPTION,
- Messages.DefaultTaskSchema_Description_Label, TaskAttribute.TYPE_LONG_RICH_TEXT, "description"); //$NON-NLS-1$
+ Messages.DefaultTaskSchema_Description_Label, TaskAttribute.TYPE_LONG_RICH_TEXT,
+ "description", Flag.DESCRIPTION); //$NON-NLS-1$
public final Field KEYWORDS = createField(TaskAttribute.KEYWORDS, Messages.DefaultTaskSchema_Keywords_Label,
TaskAttribute.TYPE_MULTI_SELECT, "keywords", Flag.ATTRIBUTE); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
index 0016eb5e5..12f96bbc6 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
@@ -109,6 +109,13 @@ public final class TaskAttribute {
public static final String KIND_OPERATION = "task.common.kind.operation"; //$NON-NLS-1$
+ /**
+ * A {@link TaskAttributeMetaData#getKind() kind} used to indicate that the field is related to a description.
+ *
+ * @since 3.11
+ */
+ public static final String KIND_DESCRIPTION = "task.common.kind.description"; //$NON-NLS-1$
+
public static final String KIND_PEOPLE = "task.common.kind.people"; //$NON-NLS-1$
//public static final String META_SHOW_IN_ATTRIBUTES_SECTION = "task.meta.showInTaskEditorAttributesSection";
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/DefaultTaskSchemaTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/DefaultTaskSchemaTest.java
index f4215afb0..791095220 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/DefaultTaskSchemaTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/DefaultTaskSchemaTest.java
@@ -93,4 +93,8 @@ public class DefaultTaskSchemaTest extends TestCase {
assertNotNull(testData.getRoot().getAttribute(TaskAttribute.ATTACHMENT_ID));
assertNotNull(testData.getRoot().getAttribute(TaskAttribute.SUMMARY));
}
+
+ public void testDescriptionHasKind() {
+ assertEquals(TaskAttribute.KIND_DESCRIPTION, DefaultTaskSchema.getInstance().DESCRIPTION.getKind());
+ }
}

Back to the top