Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-01-25 16:01:56 +0000
committerGerrit Code Review @ Eclipse.org2014-02-06 14:31:57 +0000
commitaeac2f595cdaa29118c9157783c0bdb86e3a9e99 (patch)
tree6da7e49e94b658a75b8c1af113647612350609aa /org.eclipse.mylyn.tasks.core/src/org/eclipse
parent99eee3339bd5f7b50c9a740366a3da1aa8aedd1e (diff)
downloadorg.eclipse.mylyn.tasks-aeac2f595cdaa29118c9157783c0bdb86e3a9e99.tar.gz
org.eclipse.mylyn.tasks-aeac2f595cdaa29118c9157783c0bdb86e3a9e99.tar.xz
org.eclipse.mylyn.tasks-aeac2f595cdaa29118c9157783c0bdb86e3a9e99.zip
426644: add required Flag to AbstractTaskSchema
Change-Id: Ica230f4f5607a8717e2a0b79c6c644797dcea14d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=426644
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskSchema.java26
1 files changed, 21 insertions, 5 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 dc8a9df9b..944749aa0 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
@@ -24,7 +24,7 @@ import org.eclipse.core.runtime.Assert;
/**
* Base class for task schemas. Clients should subclass to define a specific schema.
- *
+ *
* @author Steffen Pingel
* @author David Green
* @author Miles Parker
@@ -90,6 +90,7 @@ public abstract class AbstractTaskSchema {
metaData.setType(getType());
metaData.setReadOnly(isReadOnly());
metaData.setKind(getKind());
+ metaData.setRequired(isRequired());
// options
Map<String, String> options = getDefaultOptions();
if (options != null) {
@@ -110,7 +111,7 @@ public abstract class AbstractTaskSchema {
/**
* the key to use when indexing this field
- *
+ *
* @return the index key, or null if this should not be indexed
* @since 3.7
*/
@@ -192,17 +193,32 @@ public abstract class AbstractTaskSchema {
return true;
}
+ /**
+ * @since 3.11
+ */
+ public boolean isRequired() {
+ return flags.contains(Flag.REQUIRED);
+ }
+
}
public enum Flag {
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
+ DESCRIPTION,
+ /**
+ * A flag used to indicate that the field is required.
+ *
+ * @since 3.11
+ * @see TaskAttribute#META_REQUIRED
+ */
+ REQUIRED
+
};
protected class FieldFactory {
@@ -279,7 +295,7 @@ public abstract class AbstractTaskSchema {
/**
* Provides an iterator for all fields within the schema. Subsequent modifications to the returned collection are
* not reflected to schema.
- *
+ *
* @since 3.9
* @return all fields within the schema
*/

Back to the top