diff options
author | Frank Becker | 2012-02-18 19:27:17 +0000 |
---|---|---|
committer | Frank Becker | 2012-02-18 19:28:00 +0000 |
commit | e87b60aee18c81693c4b05cd784848a08bae2be7 (patch) | |
tree | 5dd553c45ae53e9adc305065c690204a017e6a8f /org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | |
parent | d1d4e9582e26e9c5564460124a812c2a9b708af5 (diff) | |
download | org.eclipse.mylyn.tasks-e87b60aee18c81693c4b05cd784848a08bae2be7.tar.gz org.eclipse.mylyn.tasks-e87b60aee18c81693c4b05cd784848a08bae2be7.tar.xz org.eclipse.mylyn.tasks-e87b60aee18c81693c4b05cd784848a08bae2be7.zip |
ASSIGNED - bug 349620: improve UI for private comments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349620
Change-Id: I27dddbdee581dd279d6a0c43e932b38f22ff6305
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | 31 |
1 files changed, 23 insertions, 8 deletions
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 a9b09617d..070d4a299 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 @@ -624,14 +624,14 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { int longDescsSize = longDescs.size() - 1; commentNum = 1; if (longDescsSize == 0) { - addDescription(longDescs.get(0).commentText); + addDescription(longDescs.get(0)); } else if (longDescsSize == 1) { if (longDescs.get(0).createdTimeStamp.compareTo(longDescs.get(1).createdTimeStamp) <= 0) { // if created_0 is equal to created_1 we assume that longDescs at index 0 is the description. - addDescription(longDescs.get(0).commentText); + addDescription(longDescs.get(0)); addComment(longDescs.get(1)); } else { - addDescription(longDescs.get(1).commentText); + addDescription(longDescs.get(1)); addComment(longDescs.get(0)); } } else if (longDescsSize > 1) { @@ -640,7 +640,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { String created_n = longDescs.get(longDescsSize).createdTimeStamp; if (created_0.compareTo(created_1) <= 0 && created_0.compareTo(created_n) < 0) { // if created_0 is equal to created_1 we assume that longDescs at index 0 is the description. - addDescription(longDescs.get(0).commentText); + addDescription(longDescs.get(0)); if (created_1.compareTo(created_n) < 0) { for (int i = 1; i <= longDescsSize; i++) { @@ -652,7 +652,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { } } } else { - addDescription(longDescs.get(longDescsSize).commentText); + addDescription(longDescs.get(longDescsSize)); if (created_0.compareTo(created_1) < 0) { for (int i = 0; i < longDescsSize; i++) { addComment(longDescs.get(i)); @@ -666,10 +666,23 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { } } - private void addDescription(String commentText) { + private void addDescription(TaskComment comment) { TaskAttribute attrDescription = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaAttribute.LONG_DESC); - attrDescription.setValue(commentText); + TaskAttribute idAttribute = attrDescription.createAttribute(IBugzillaConstants.BUGZILLA_DESCRIPTION_ID); + TaskAttribute isprivateAttribute = attrDescription.createAttribute(IBugzillaConstants.BUGZILLA_DESCRIPTION_IS_PRIVATE); + attrDescription.setValue(comment.commentText); + idAttribute.setValue(Integer.toString(comment.id)); + if (comment.isPrivate != null) { + isprivateAttribute.setValue(comment.isPrivate); + } + if (!useIsPrivate) { + if ("1".equals(comment.isPrivate)) { //$NON-NLS-1$ + TaskRepository taskRepository = mapper.getTaskRepository(); + taskRepository.setProperty(IBugzillaConstants.BUGZILLA_INSIDER_GROUP, "true"); //$NON-NLS-1$ + useIsPrivate = true; + } + } } private void addComment(TaskComment comment) { @@ -690,8 +703,10 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { TaskRepository taskRepository = mapper.getTaskRepository(); taskRepository.setProperty(IBugzillaConstants.BUGZILLA_INSIDER_GROUP, "true"); //$NON-NLS-1$ useIsPrivate = true; + taskComment.setIsPrivate("1".equals(comment.isPrivate)); //$NON-NLS-1$ + } else { + taskComment.setIsPrivate(null); } - taskComment.setIsPrivate(null); } TaskAttribute attrTimestamp = attribute.createAttribute(BugzillaAttribute.BUG_WHEN.getKey()); attrTimestamp.setValue(comment.createdTimeStamp); |