Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-06-19 16:13:16 +0000
committerfbecker2011-06-19 16:13:16 +0000
commitcd5ac74522082b60791daf8818e4802888858eaa (patch)
tree96ff45d3159f991fd3cff3f0921c6b2360d394b4 /org.eclipse.mylyn.tasks.core
parent87164a13614071c3244a2b87ebb124a5ebe6422e (diff)
downloadorg.eclipse.mylyn.tasks-cd5ac74522082b60791daf8818e4802888858eaa.tar.gz
org.eclipse.mylyn.tasks-cd5ac74522082b60791daf8818e4802888858eaa.tar.xz
org.eclipse.mylyn.tasks-cd5ac74522082b60791daf8818e4802888858eaa.zip
ASSIGNED - bug 349620: improve UI for showing private comments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349620
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java9
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java6
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java5
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java13
7 files changed, 40 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java
index 33eb8f039..fbfffecf6 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java
@@ -33,6 +33,8 @@ public class TaskComment implements ITaskComment {
private int number;
+ private String commentID;
+
private final ITask task;
private final TaskAttribute taskAttribute;
@@ -122,4 +124,11 @@ public class TaskComment implements ITaskComment {
this.isPrivate = isPrivate;
}
+ public void setCommentID(String commentID) {
+ this.commentID = commentID;
+ }
+
+ public String getCommentID() {
+ return commentID;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java
index b484be0d4..91921cd27 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java
@@ -40,6 +40,8 @@ public class Messages extends NLS {
public static String DefaultTaskSchema_Filename_Label;
+ public static String DefaultTaskSchema_ID;
+
public static String DefaultTaskSchema_ID_Label;
public static String DefaultTaskSchema_Key_Label;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties
index 44dfb70cb..de29d6f96 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties
@@ -20,6 +20,7 @@ DefaultTaskSchema_Deprecated_Label=Deprecated
DefaultTaskSchema_Description_Label=Description
DefaultTaskSchema_Due_Label=Due
DefaultTaskSchema_Filename_Label=Filename
+DefaultTaskSchema_ID=ID
DefaultTaskSchema_ID_Label=ID
DefaultTaskSchema_Key_Label=Key
DefaultTaskSchema_Keywords_Label=Keywords
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java
index 38bf89ae8..27606f4fc 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java
@@ -110,4 +110,9 @@ public interface ITaskComment {
*/
public abstract void setIsPrivate(Boolean isPrivate);
+ /**
+ * @since 3.7
+ */
+ public abstract void setCommentID(String commentID);
+
} \ No newline at end of file
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 a52f294ae..74c9bdc83 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
@@ -154,4 +154,10 @@ public final class DefaultTaskSchema extends AbstractTaskSchema {
public final Field TASK_URL = createField(TaskAttribute.TASK_URL, Messages.DefaultTaskSchema_URL_Label,
TaskAttribute.TYPE_URL, Flag.READ_ONLY);
+ /**
+ * @since 3.7
+ */
+ public final Field COMMENT_ID = createField(TaskAttribute.COMMENT_ID, Messages.DefaultTaskSchema_ID, TaskAttribute.TYPE_INTEGER,
+ Flag.READ_ONLY);
+
}
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 db152281d..efe0e2318 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
@@ -131,6 +131,11 @@ public final class TaskAttribute {
public static final String COMMENT_ISPRIVATE = "task.common.comment.isprivate"; //$NON-NLS-1$
/**
+ * @since 3.7
+ */
+ public static final String COMMENT_ID = "task.common.comment.id"; //$NON-NLS-1$
+
+ /**
* Key for the meta datum that determines if an attribute is disabled. This is used to indicate that an attribute
* should not be modified, e.g. due to work-flow state but it may still be generally writeable.
*
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java
index f50b43c45..185b098e1 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java
@@ -125,6 +125,10 @@ public class TaskCommentMapper {
if (child != null) {
comment.setCreationDate(mapper.getDateValue(child));
}
+ child = taskAttribute.getMappedAttribute(TaskAttribute.COMMENT_ID);
+ if (child != null) {
+ comment.setCommentId(mapper.getValue(child));
+ }
child = taskAttribute.getMappedAttribute(TaskAttribute.COMMENT_NUMBER);
if (child != null) {
comment.setNumber(mapper.getIntegerValue(child));
@@ -149,8 +153,12 @@ public class TaskCommentMapper {
TaskData taskData = taskAttribute.getTaskData();
TaskAttributeMapper mapper = taskData.getAttributeMapper();
taskAttribute.getMetaData().defaults().setType(TaskAttribute.TYPE_COMMENT);
+ if (getNumber() != null) {
+ mapper.setIntegerValue(taskAttribute, getNumber());
+ }
if (getCommentId() != null) {
- mapper.setValue(taskAttribute, getCommentId());
+ TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_ID).createAttribute(taskAttribute);
+ mapper.setValue(child, getCommentId());
}
if (getAuthor() != null) {
TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_AUTHOR).createAttribute(
@@ -193,6 +201,9 @@ public class TaskCommentMapper {
if (getNumber() != null) {
taskComment.setNumber(getNumber());
}
+ if (getCommentId() != null) {
+ taskComment.setCommentID(getCommentId());
+ }
if (getUrl() != null) {
taskComment.setUrl(getUrl());
}

Back to the top