Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-06-28 13:37:27 -0400
committerfbecker2011-06-28 13:37:27 -0400
commiteb7d9097f0e64a56b16de58000763fffb9499ca8 (patch)
treed66b77c22422b6ec4020a929a2ee802afb7b3789
parent96610632f2ccef230091968bf78f3cadcb4281ea (diff)
downloadorg.eclipse.mylyn.tasks-eb7d9097f0e64a56b16de58000763fffb9499ca8.tar.gz
org.eclipse.mylyn.tasks-eb7d9097f0e64a56b16de58000763fffb9499ca8.tar.xz
org.eclipse.mylyn.tasks-eb7d9097f0e64a56b16de58000763fffb9499ca8.zip
ASSIGNED - bug 349771: create UI for support adding private comments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349771
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java21
2 files changed, 18 insertions, 13 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java
index 1579bf54c..ebd6bcca2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java
@@ -64,11 +64,13 @@ public class BugzillaTaskEditorNewCommentPart extends TaskEditorNewCommentPart {
@Override
public void initialize(AbstractTaskEditorPage taskEditorPage) {
super.initialize(taskEditorPage);
- TaskAttribute isprivate = getAttribute().getParentAttribute().getAttribute("comment_is_private"); //$NON-NLS-1$
- if (isprivate == null) {
- isprivate = getAttribute().getParentAttribute().createAttribute("comment_is_private"); //$NON-NLS-1$
+ if (getAttribute() != null) {
+ TaskAttribute isprivate = getAttribute().getParentAttribute().getAttribute("comment_is_private"); //$NON-NLS-1$
+ if (isprivate == null) {
+ isprivate = getAttribute().getParentAttribute().createAttribute("comment_is_private"); //$NON-NLS-1$
+ }
+ isprivate.setValue("0"); //$NON-NLS-1$
}
- isprivate.setValue("0"); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index aacf62b1d..db8ea38ce 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -527,9 +527,11 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
public void appendTextToNewComment(String text) {
AbstractTaskEditorPart newCommentPart = getPart(ID_PART_NEW_COMMENT);
- if (newCommentPart instanceof TaskEditorRichTextPart) {
- ((TaskEditorRichTextPart) newCommentPart).appendText(text);
- newCommentPart.setFocus();
+ if (newCommentPart != null) {
+ if (newCommentPart instanceof TaskEditorRichTextPart) {
+ ((TaskEditorRichTextPart) newCommentPart).appendText(text);
+ newCommentPart.setFocus();
+ }
}
}
@@ -778,13 +780,14 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
return new TaskEditorCommentPart();
}
}.setPath(PATH_COMMENTS));
+
+ descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
+ @Override
+ public AbstractTaskEditorPart createPart() {
+ return new TaskEditorNewCommentPart();
+ }
+ }.setPath(PATH_COMMENTS));
}
- descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
- @Override
- public AbstractTaskEditorPart createPart() {
- return new TaskEditorNewCommentPart();
- }
- }.setPath(PATH_COMMENTS));
if (needsPrivateSection() || taskData.isNew()) {
descriptors.add(new TaskEditorPartDescriptor(ID_PART_PLANNING) {

Back to the top