Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-05-29 23:56:00 -0400
committerfbecker2011-05-29 23:56:00 -0400
commit1ff7e0bd7ef8653133985473b4eef38a7ae3bbee (patch)
tree8959aff692496869c7c64f6e4d7fe8b256913e54 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data
parent81be28de6992a80d43b12832d3f7d0fc6baad7d9 (diff)
downloadorg.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.tar.gz
org.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.tar.xz
org.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.zip
ASSIGNED - bug 345847: [patch][api] create UI for private comments and attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345847
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data')
-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.java28
3 files changed, 39 insertions, 0 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 88fb3f62c..a52f294ae 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
@@ -79,6 +79,12 @@ public final class DefaultTaskSchema extends AbstractTaskSchema {
public final Field COMMENT_HAS_ATTACHMENT = createField(TaskAttribute.COMMENT_HAS_ATTACHMENT,
Messages.DefaultTaskSchema_Attachment_Label, TaskAttribute.TYPE_BOOLEAN, Flag.READ_ONLY);
+ /**
+ * @since 3.6
+ */
+ public final Field COMMENT_ISPRIVATE = createField(TaskAttribute.COMMENT_ISPRIVATE,
+ Messages.DefaultTaskSchema_Private_Label, TaskAttribute.TYPE_BOOLEAN);
+
public final Field COMMENT_NUMBER = createField(TaskAttribute.COMMENT_NUMBER,
Messages.DefaultTaskSchema_Number_Label, 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 cbe2af131..db152281d 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
@@ -126,6 +126,11 @@ public final class TaskAttribute {
public static final String META_READ_ONLY = "task.meta.readOnly"; //$NON-NLS-1$
/**
+ * @since 3.6
+ */
+ public static final String COMMENT_ISPRIVATE = "task.common.comment.isprivate"; //$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 764b70a24..f50b43c45 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
@@ -36,6 +36,8 @@ public class TaskCommentMapper {
private String url;
+ private Boolean isPrivate;
+
public TaskCommentMapper() {
}
@@ -63,6 +65,13 @@ public class TaskCommentMapper {
return url;
}
+ /**
+ * @since 3.6
+ */
+ public Boolean getIsPrivate() {
+ return isPrivate;
+ }
+
public void setAuthor(IRepositoryPerson author) {
this.author = author;
}
@@ -87,6 +96,13 @@ public class TaskCommentMapper {
this.url = url;
}
+ /**
+ * @since 3.6
+ */
+ public void setIsPrivate(Boolean isPrivate) {
+ this.isPrivate = isPrivate;
+ }
+
@SuppressWarnings("deprecation")
public static TaskCommentMapper createFrom(TaskAttribute taskAttribute) {
Assert.isNotNull(taskAttribute);
@@ -121,6 +137,10 @@ public class TaskCommentMapper {
if (child != null) {
comment.setText(mapper.getValue(child));
}
+ child = taskAttribute.getMappedAttribute(TaskAttribute.COMMENT_ISPRIVATE);
+ if (child != null) {
+ comment.setIsPrivate(mapper.getBooleanValue(child));
+ }
return comment;
}
@@ -155,6 +175,11 @@ public class TaskCommentMapper {
mapper.setValue(child, getText());
taskAttribute.putMetaDatum(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, child.getId());
}
+ if (getIsPrivate() != null) {
+ TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_ISPRIVATE).createAttribute(
+ taskAttribute);
+ mapper.setBooleanValue(child, getIsPrivate());
+ }
}
public void applyTo(ITaskComment taskComment) {
@@ -174,5 +199,8 @@ public class TaskCommentMapper {
if (getText() != null) {
taskComment.setText(getText());
}
+ if (getIsPrivate() != null) {
+ taskComment.setIsPrivate(getIsPrivate());
+ }
}
}

Back to the top