Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-04-22 00:11:31 +0000
committerGerrit Code Review @ Eclipse.org2013-04-22 02:42:03 +0000
commit14187a12a8a4ba0b18ff3eb8fd726c3fedf1c4a6 (patch)
tree5b599bd4b8077b59b04c3029305daa3a4b025e95 /org.eclipse.mylyn.tasks.core
parent81db1b68923db48643bf25c4cc75b9581938f429 (diff)
downloadorg.eclipse.mylyn.tasks-14187a12a8a4ba0b18ff3eb8fd726c3fedf1c4a6.tar.gz
org.eclipse.mylyn.tasks-14187a12a8a4ba0b18ff3eb8fd726c3fedf1c4a6.tar.xz
org.eclipse.mylyn.tasks-14187a12a8a4ba0b18ff3eb8fd726c3fedf1c4a6.zip
387710: [api] task category property should be API
Change-Id: I460afb96bb37f84dddfd3b8d48fc58f47891f382 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=387710
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java28
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java11
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java46
3 files changed, 72 insertions, 13 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
index 92e101edf..14948b3ca 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
@@ -11,6 +11,8 @@
package org.eclipse.mylyn.internal.tasks.core;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+
/**
* @author Mik Kersten
* @since 2.0
@@ -39,13 +41,25 @@ public interface IRepositoryConstants {
public static final String KIND_UNKNOWN = "<unknown>"; //$NON-NLS-1$
- public static final String CATEGORY_TASKS = "org.eclipse.mylyn.category.tasks"; //$NON-NLS-1$
-
- public static final String CATEGORY_BUGS = "org.eclipse.mylyn.category.bugs"; //$NON-NLS-1$
-
- public static final String CATEGORY_BUILD = "org.eclipse.mylyn.category.build"; //$NON-NLS-1$
-
- public static final String CATEGORY_REVIEW = "org.eclipse.mylyn.category.review"; //$NON-NLS-1$
+ /**
+ * @deprecated Use {@link TaskRepository#CATEGORY_TASKS} instead
+ */
+ public static final String CATEGORY_TASKS = TaskRepository.CATEGORY_TASKS; //$NON-NLS-1$
+
+ /**
+ * @deprecated Use {@link TaskRepository#CATEGORY_BUGS} instead
+ */
+ public static final String CATEGORY_BUGS = TaskRepository.CATEGORY_BUGS; //$NON-NLS-1$
+
+ /**
+ * @deprecated Use {@link TaskRepository#CATEGORY_BUILD} instead
+ */
+ public static final String CATEGORY_BUILD = TaskRepository.CATEGORY_BUILD; //$NON-NLS-1$
+
+ /**
+ * @deprecated Use {@link TaskRepository#CATEGORY_REVIEW} instead
+ */
+ public static final String CATEGORY_REVIEW = TaskRepository.CATEGORY_REVIEW; //$NON-NLS-1$
public static final String CATEGORY_OTHER = "org.eclipse.mylyn.category.other"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
index 7c28b3c16..e8cd3d67e 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryManager.java
@@ -85,13 +85,13 @@ public class TaskRepositoryManager implements IRepositoryManager {
public TaskRepositoryManager() {
this.migrators = Collections.emptyList();
- Category catTasks = new Category(IRepositoryConstants.CATEGORY_TASKS, "Tasks", 0); //$NON-NLS-1$
+ Category catTasks = new Category(TaskRepository.CATEGORY_TASKS, "Tasks", 0); //$NON-NLS-1$
repositoryCategories.put(catTasks.getId(), catTasks);
- Category catBugs = new Category(IRepositoryConstants.CATEGORY_BUGS, "Bugs", 100); //$NON-NLS-1$
+ Category catBugs = new Category(TaskRepository.CATEGORY_BUGS, "Bugs", 100); //$NON-NLS-1$
repositoryCategories.put(catBugs.getId(), catBugs);
- Category catBuild = new Category(IRepositoryConstants.CATEGORY_BUILD, "Builds", 200); //$NON-NLS-1$
+ Category catBuild = new Category(TaskRepository.CATEGORY_BUILD, "Builds", 200); //$NON-NLS-1$
repositoryCategories.put(catBuild.getId(), catBuild);
- Category catReview = new Category(IRepositoryConstants.CATEGORY_REVIEW, "Reviews", 300); //$NON-NLS-1$
+ Category catReview = new Category(TaskRepository.CATEGORY_REVIEW, "Reviews", 300); //$NON-NLS-1$
repositoryCategories.put(catReview.getId(), catReview);
Category catOther = new Category(IRepositoryConstants.CATEGORY_OTHER, "Other", 400); //$NON-NLS-1$
repositoryCategories.put(catOther.getId(), catOther);
@@ -518,8 +518,7 @@ public class TaskRepositoryManager implements IRepositoryManager {
}
public Category getCategory(TaskRepository repository) {
- String categoryId = repository.getProperty(IRepositoryConstants.PROPERTY_CATEGORY);
- return getCategory(categoryId);
+ return getCategory(repository.getCategory());
}
public void initialize(List<AbstractRepositoryMigrator> repositoryMigrators) {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
index 7fa69f3d6..3cc5f42a8 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java
@@ -147,6 +147,38 @@ public final class TaskRepository extends PlatformObject {
public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline"; //$NON-NLS-1$
+ /**
+ * Category for repositories that manage tasks.
+ *
+ * @see #setCategory(String)
+ * @since 3.9
+ */
+ public static final String CATEGORY_TASKS = "org.eclipse.mylyn.category.tasks"; //$NON-NLS-1$
+
+ /**
+ * Category for repositories that manage bugs.
+ *
+ * @see #setCategory(String)
+ * @since 3.9
+ */
+ public static final String CATEGORY_BUGS = "org.eclipse.mylyn.category.bugs"; //$NON-NLS-1$
+
+ /**
+ * Category for repositories that manage builds.
+ *
+ * @see #setCategory(String)
+ * @since 3.9
+ */
+ public static final String CATEGORY_BUILD = "org.eclipse.mylyn.category.build"; //$NON-NLS-1$
+
+ /**
+ * Category for repositories that manage reviews.
+ *
+ * @see #setCategory(String)
+ * @since 3.9
+ */
+ public static final String CATEGORY_REVIEW = "org.eclipse.mylyn.category.review"; //$NON-NLS-1$
+
// HACK: Lock used to work around race condition in
// Platform.add/get/flushAuthorizationInfo()
private static final Object LOCK = new Object();
@@ -938,4 +970,18 @@ public final class TaskRepository extends PlatformObject {
return "true".equals(getProperty(CREATED_FROM_TEMPLATE)); //$NON-NLS-1$
}
+ /**
+ * @since 3.9
+ */
+ public String getCategory() {
+ return getProperty(IRepositoryConstants.PROPERTY_CATEGORY);
+ }
+
+ /**
+ * @since 3.9
+ */
+ public void setCategory(String category) {
+ setProperty(IRepositoryConstants.PROPERTY_CATEGORY, category);
+ }
+
}

Back to the top