diff options
author | fbecker | 2011-06-19 16:13:16 +0000 |
---|---|---|
committer | fbecker | 2011-06-19 16:13:16 +0000 |
commit | cd5ac74522082b60791daf8818e4802888858eaa (patch) | |
tree | 96ff45d3159f991fd3cff3f0921c6b2360d394b4 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data | |
parent | 87164a13614071c3244a2b87ebb124a5ebe6422e (diff) | |
download | org.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/src/org/eclipse/mylyn/tasks/core/data')
3 files changed, 23 insertions, 1 deletions
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()); } |