summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-02-09 19:22:03 (EST)
committer Steffen Pingel2012-02-09 19:22:03 (EST)
commit9f99269112887b9003a6938eb5b59c1eb44f969b (patch)
treed4c79d7b3802222c162697e1e53ce71caf811230
parent173c07207e39b2cbbe5af0077b5588be52b09c6c (diff)
downloadorg.eclipse.mylyn.tasks-9f99269112887b9003a6938eb5b59c1eb44f969b.zip
org.eclipse.mylyn.tasks-9f99269112887b9003a6938eb5b59c1eb44f969b.tar.gz
org.eclipse.mylyn.tasks-9f99269112887b9003a6938eb5b59c1eb44f969b.tar.bz2
ASSIGNED - bug 349620: improve UI for private comments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349620 Change-Id: I00b570970980919ae15c6026db859cc1c4ea89fa
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java28
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java27
-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/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
9 files changed, 25 insertions, 76 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
index 7520244..315fc6a 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
@@ -177,8 +177,6 @@ public class BugzillaAttributeMapper extends TaskAttributeMapper {
return BugzillaAttribute.THETEXT.getKey();
} else if (key.equals(TaskAttribute.COMMENT_ISPRIVATE)) {
return BugzillaAttribute.IS_PRIVATE.getKey();
- } else if (key.equals(TaskAttribute.COMMENT_ID)) {
- return BugzillaAttribute.COMMENTID.getKey();
} else if (key.equals(TaskAttribute.DATE_CREATION)) {
return BugzillaAttribute.CREATION_TS.getKey();
} else if (key.equals(TaskAttribute.DESCRIPTION)) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index e96d286..ecd1ac0 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -1548,23 +1548,19 @@ public class BugzillaClient {
+ flagnumber.getValue(), requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$
}
} else if (id.startsWith(TaskAttribute.PREFIX_COMMENT)) {
- TaskAttribute commentID = a.getAttribute(BugzillaAttribute.COMMENTID.getKey());
- if (commentID != null) {
- String valueID = commentID.getValue();
- TaskAttribute definedIsPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE
- + valueID);
- if (definedIsPrivate != null) {
- fields.put(definedIsPrivate.getId(), new NameValuePair(definedIsPrivate.getId(),
- definedIsPrivate.getValue() != null ? definedIsPrivate.getValue() : "")); //$NON-NLS-1$
- }
- TaskAttribute isPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE
- + valueID);
- if (isPrivate != null) {
- fields.put(isPrivate.getId(), new NameValuePair(isPrivate.getId(),
- isPrivate.getValue() != null ? isPrivate.getValue() : "")); //$NON-NLS-1$
- }
- continue;
+ String valueID = a.getValue();
+ TaskAttribute definedIsPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE
+ + valueID);
+ if (definedIsPrivate != null) {
+ fields.put(definedIsPrivate.getId(), new NameValuePair(definedIsPrivate.getId(),
+ definedIsPrivate.getValue() != null ? definedIsPrivate.getValue() : "")); //$NON-NLS-1$
}
+ TaskAttribute isPrivate = a.getAttribute(IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + valueID);
+ if (isPrivate != null) {
+ fields.put(isPrivate.getId(), new NameValuePair(isPrivate.getId(),
+ isPrivate.getValue() != null ? isPrivate.getValue() : "")); //$NON-NLS-1$
+ }
+ continue;
} else if (id.startsWith("task.common.")) { //$NON-NLS-1$
// Don't post any remaining non-bugzilla specific attributes
continue;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
index da763ea..a9b0961 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
@@ -709,13 +709,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
workTime.setValue(comment.timeWorked);
}
- if (comment.id != 0) {
- TaskAttribute commentID = BugzillaTaskDataHandler.createAttribute(attribute, BugzillaAttribute.COMMENTID);
- commentID.setValue(Integer.toString(comment.id));
- }
-
parseAttachment(taskComment);
-
}
/** determines attachment id from comment */
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java
index 48355b9..3671485 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorCommentPart.java
@@ -51,24 +51,21 @@ public class BugzillaTaskEditorCommentPart extends TaskEditorCommentPart {
isprivate = taskComment.getTaskAttribute().createMappedAttribute(TaskAttribute.COMMENT_ISPRIVATE);
}
isprivate.setValue(taskComment.getIsPrivate() ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$
- TaskAttribute commentID = taskComment.getTaskAttribute().getMappedAttribute(TaskAttribute.COMMENT_ID);
- if (commentID != null) {
- String value = commentID.getValue();
- TaskAttribute definedIsPrivate = taskComment.getTaskAttribute().getAttribute(
+ String value = taskComment.getTaskAttribute().getValue();
+ TaskAttribute definedIsPrivate = taskComment.getTaskAttribute().getAttribute(
+ IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE + value);
+ if (definedIsPrivate == null) {
+ definedIsPrivate = taskComment.getTaskAttribute().createAttribute(
IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE + value);
- if (definedIsPrivate == null) {
- definedIsPrivate = taskComment.getTaskAttribute().createAttribute(
- IBugzillaConstants.BUGZILLA_PREFIX_DEFINED_ISPRIVATE + value);
- }
- TaskAttribute isPrivate = taskComment.getTaskAttribute().getAttribute(
+ }
+ TaskAttribute isPrivate = taskComment.getTaskAttribute().getAttribute(
+ IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + value);
+ if (isPrivate == null) {
+ isPrivate = taskComment.getTaskAttribute().createAttribute(
IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + value);
- if (isPrivate == null) {
- isPrivate = taskComment.getTaskAttribute().createAttribute(
- IBugzillaConstants.BUGZILLA_PREFIX_ISPRIVATE + value);
- }
- definedIsPrivate.setValue("1"); //$NON-NLS-1$
- isPrivate.setValue(taskComment.getIsPrivate() ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ definedIsPrivate.setValue("1"); //$NON-NLS-1$
+ isPrivate.setValue(taskComment.getIsPrivate() ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$
getModel().attributeChanged(taskComment.getTaskAttribute());
updateActionState();
}
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 fbfffec..33eb8f0 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,8 +33,6 @@ public class TaskComment implements ITaskComment {
private int number;
- private String commentID;
-
private final ITask task;
private final TaskAttribute taskAttribute;
@@ -124,11 +122,4 @@ 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/tasks/core/ITaskComment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskComment.java
index 27606f4..38bf89a 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,9 +110,4 @@ 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 74c9bdc..a52f294 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,10 +154,4 @@ 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 5ac8f64..2f0bc36 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,11 +131,6 @@ 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 185b098..f50b43c 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,10 +125,6 @@ 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));
@@ -153,12 +149,8 @@ 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) {
- TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_ID).createAttribute(taskAttribute);
- mapper.setValue(child, getCommentId());
+ mapper.setValue(taskAttribute, getCommentId());
}
if (getAuthor() != null) {
TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_AUTHOR).createAttribute(
@@ -201,9 +193,6 @@ public class TaskCommentMapper {
if (getNumber() != null) {
taskComment.setNumber(getNumber());
}
- if (getCommentId() != null) {
- taskComment.setCommentID(getCommentId());
- }
if (getUrl() != null) {
taskComment.setUrl(getUrl());
}