Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 349771 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorNewCommentPart.java (-4 / +6 lines)
Lines 64-74 Link Here
64
	@Override
64
	@Override
65
	public void initialize(AbstractTaskEditorPage taskEditorPage) {
65
	public void initialize(AbstractTaskEditorPage taskEditorPage) {
66
		super.initialize(taskEditorPage);
66
		super.initialize(taskEditorPage);
67
		TaskAttribute isprivate = getAttribute().getParentAttribute().getAttribute("comment_is_private"); //$NON-NLS-1$
67
		if (getAttribute() != null) {
68
		if (isprivate == null) {
68
			TaskAttribute isprivate = getAttribute().getParentAttribute().getAttribute("comment_is_private"); //$NON-NLS-1$
69
			isprivate = getAttribute().getParentAttribute().createAttribute("comment_is_private"); //$NON-NLS-1$
69
			if (isprivate == null) {
70
				isprivate = getAttribute().getParentAttribute().createAttribute("comment_is_private"); //$NON-NLS-1$
71
			}
72
			isprivate.setValue("0"); //$NON-NLS-1$
70
		}
73
		}
71
		isprivate.setValue("0"); //$NON-NLS-1$
72
	}
74
	}
73
75
74
}
76
}
(-)src/org/eclipse/mylyn/internal/sandbox/ui/editors/ExtensibleBugzillaTaskEditorPage.java (-6 / +10 lines)
Lines 132-149 Link Here
132
	@Override
132
	@Override
133
	protected Set<TaskEditorPartDescriptor> createPartDescriptors() {
133
	protected Set<TaskEditorPartDescriptor> createPartDescriptors() {
134
		Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors();
134
		Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors();
135
		boolean hasPartNewComment = false;
135
		for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) {
136
		for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) {
136
			if (taskEditorPartDescriptor.getId().equals(ID_PART_NEW_COMMENT)) {
137
			if (taskEditorPartDescriptor.getId().equals(ID_PART_NEW_COMMENT)) {
137
				descriptors.remove(taskEditorPartDescriptor);
138
				descriptors.remove(taskEditorPartDescriptor);
139
				hasPartNewComment = true;
138
				break;
140
				break;
139
			}
141
			}
140
		}
142
		}
141
		descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
143
		if (hasPartNewComment) {
142
			@Override
144
			descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
143
			public AbstractTaskEditorPart createPart() {
145
				@Override
144
				return new ExtensibleTaskEditorNewCommentPart();
146
				public AbstractTaskEditorPart createPart() {
145
			}
147
					return new ExtensibleTaskEditorNewCommentPart();
146
		}.setPath(PATH_COMMENTS));
148
				}
149
			}.setPath(PATH_COMMENTS));
150
		}
147
		return descriptors;
151
		return descriptors;
148
	}
152
	}
149
153
(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java (-9 / +12 lines)
Lines 527-535 Link Here
527
527
528
	public void appendTextToNewComment(String text) {
528
	public void appendTextToNewComment(String text) {
529
		AbstractTaskEditorPart newCommentPart = getPart(ID_PART_NEW_COMMENT);
529
		AbstractTaskEditorPart newCommentPart = getPart(ID_PART_NEW_COMMENT);
530
		if (newCommentPart instanceof TaskEditorRichTextPart) {
530
		if (newCommentPart != null) {
531
			((TaskEditorRichTextPart) newCommentPart).appendText(text);
531
			if (newCommentPart instanceof TaskEditorRichTextPart) {
532
			newCommentPart.setFocus();
532
				((TaskEditorRichTextPart) newCommentPart).appendText(text);
533
				newCommentPart.setFocus();
534
			}
533
		}
535
		}
534
	}
536
	}
535
537
Lines 778-790 Link Here
778
					return new TaskEditorCommentPart();
780
					return new TaskEditorCommentPart();
779
				}
781
				}
780
			}.setPath(PATH_COMMENTS));
782
			}.setPath(PATH_COMMENTS));
783
784
			descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
785
				@Override
786
				public AbstractTaskEditorPart createPart() {
787
					return new TaskEditorNewCommentPart();
788
				}
789
			}.setPath(PATH_COMMENTS));
781
		}
790
		}
782
		descriptors.add(new TaskEditorPartDescriptor(ID_PART_NEW_COMMENT) {
783
			@Override
784
			public AbstractTaskEditorPart createPart() {
785
				return new TaskEditorNewCommentPart();
786
			}
787
		}.setPath(PATH_COMMENTS));
788
791
789
		if (needsPrivateSection() || taskData.isNew()) {
792
		if (needsPrivateSection() || taskData.isNew()) {
790
			descriptors.add(new TaskEditorPartDescriptor(ID_PART_PLANNING) {
793
			descriptors.add(new TaskEditorPartDescriptor(ID_PART_PLANNING) {

Return to bug 349771