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 345847 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java (-2 / +4 lines)
Lines 64-69 Link Here
64
	CLASSIFICATION_ID(Messages.BugzillaAttribute_Classification_ID,
64
	CLASSIFICATION_ID(Messages.BugzillaAttribute_Classification_ID,
65
			"classification_id", TaskAttribute.TYPE_SHORT_TEXT, true, false), //$NON-NLS-1$
65
			"classification_id", TaskAttribute.TYPE_SHORT_TEXT, true, false), //$NON-NLS-1$
66
66
67
	COMMENTID(Messages.BugzillaAttribute_Comment_ID, "commentid", TaskAttribute.TYPE_SHORT_TEXT, true, false), //$NON-NLS-1$
68
67
	COMPONENT(Messages.BugzillaAttribute_Component, "component", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
69
	COMPONENT(Messages.BugzillaAttribute_Component, "component", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
68
70
69
	CONFIRM_PRODUCT_CHANGE("confirm_product_change", "confirm_product_change", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$ //$NON-NLS-2$
71
	CONFIRM_PRODUCT_CHANGE("confirm_product_change", "confirm_product_change", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$ //$NON-NLS-2$
Lines 104-109 Link Here
104
106
105
	IS_PATCH(Messages.BugzillaAttribute_Patch, "ispatch", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$
107
	IS_PATCH(Messages.BugzillaAttribute_Patch, "ispatch", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$
106
108
109
	IS_PRIVATE(Messages.BugzillaAttribute_Private, "isprivate", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$
110
107
	KEYWORDS(Messages.BugzillaAttribute_Keywords, "keywords", IBugzillaConstants.EDITOR_TYPE_KEYWORDS, false, false), //$NON-NLS-1$
111
	KEYWORDS(Messages.BugzillaAttribute_Keywords, "keywords", IBugzillaConstants.EDITOR_TYPE_KEYWORDS, false, false), //$NON-NLS-1$
108
112
109
	LONG_DESC(Messages.BugzillaAttribute_Description, "long_desc", TaskAttribute.TYPE_LONG_RICH_TEXT, true, true), //$NON-NLS-1$
113
	LONG_DESC(Messages.BugzillaAttribute_Description, "long_desc", TaskAttribute.TYPE_LONG_RICH_TEXT, true, true), //$NON-NLS-1$
Lines 151-158 Link Here
151
155
152
	UNKNOWN(Messages.BugzillaAttribute_UNKNOWN, "UNKNOWN", TaskAttribute.TYPE_SHORT_TEXT, false, false), //$NON-NLS-1$
156
	UNKNOWN(Messages.BugzillaAttribute_UNKNOWN, "UNKNOWN", TaskAttribute.TYPE_SHORT_TEXT, false, false), //$NON-NLS-1$
153
157
154
	URLBASE(Messages.BugzillaAttribute_URLBASE, "urlbase", TaskAttribute.TYPE_SHORT_TEXT, true, true), //$NON-NLS-1$
155
156
	VERSION(Messages.BugzillaAttribute_Version, "version", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
158
	VERSION(Messages.BugzillaAttribute_Version, "version", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
157
159
158
	INSTALL_VERSION(Messages.BugzillaAttribute_version_of_bugzilla_installed, "install_version", null, true, false), //$NON-NLS-1$
160
	INSTALL_VERSION(Messages.BugzillaAttribute_version_of_bugzilla_installed, "install_version", null, true, false), //$NON-NLS-1$
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java (+2 lines)
Lines 175-180 Link Here
175
			return BugzillaAttribute.CC.getKey();
175
			return BugzillaAttribute.CC.getKey();
176
		} else if (key.equals(TaskAttribute.COMMENT_TEXT)) {
176
		} else if (key.equals(TaskAttribute.COMMENT_TEXT)) {
177
			return BugzillaAttribute.THETEXT.getKey();
177
			return BugzillaAttribute.THETEXT.getKey();
178
		} else if (key.equals(TaskAttribute.COMMENT_ISPRIVATE)) {
179
			return BugzillaAttribute.IS_PRIVATE.getKey();
178
		} else if (key.equals(TaskAttribute.DATE_CREATION)) {
180
		} else if (key.equals(TaskAttribute.DATE_CREATION)) {
179
			return BugzillaAttribute.CREATION_TS.getKey();
181
			return BugzillaAttribute.CREATION_TS.getKey();
180
		} else if (key.equals(TaskAttribute.DESCRIPTION)) {
182
		} else if (key.equals(TaskAttribute.DESCRIPTION)) {
(-)src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java (-2 / +4 lines)
Lines 61-66 Link Here
61
61
62
	public static String BugzillaAttribute_Classification_ID;
62
	public static String BugzillaAttribute_Classification_ID;
63
63
64
	public static String BugzillaAttribute_Comment_ID;
65
64
	public static String BugzillaAttribute_Component;
66
	public static String BugzillaAttribute_Component;
65
67
66
	public static String BugzillaAttribute_Content_Type;
68
	public static String BugzillaAttribute_Content_Type;
Lines 113-118 Link Here
113
115
114
	public static String BugzillaAttribute_Priority;
116
	public static String BugzillaAttribute_Priority;
115
117
118
	public static String BugzillaAttribute_Private;
119
116
	public static String BugzillaAttribute_Product;
120
	public static String BugzillaAttribute_Product;
117
121
118
	public static String BugzillaAttribute_QA_Contact;
122
	public static String BugzillaAttribute_QA_Contact;
Lines 153-160 Link Here
153
157
154
	public static String BugzillaAttribute_UNKNOWN;
158
	public static String BugzillaAttribute_UNKNOWN;
155
159
156
	public static String BugzillaAttribute_URLBASE;
157
158
	public static String BugzillaAttribute_URL;
160
	public static String BugzillaAttribute_URL;
159
161
160
	public static String BugzillaAttribute_Query_Timestamp;
162
	public static String BugzillaAttribute_Query_Timestamp;
(-)src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java (-11 / +23 lines)
Lines 124-132 Link Here
124
		case BUGZILLA:
124
		case BUGZILLA:
125
			// Note: here we can get the bugzilla version if necessary
125
			// Note: here we can get the bugzilla version if necessary
126
//			String version = attributes.getValue("version");
126
//			String version = attributes.getValue("version");
127
//			String urlbase = attributes.getValue("urlbase");
127
//			urlbase = attributes.getValue("urlbase"); //$NON-NLS-1$
128
//			String maintainer = attributes.getValue("maintainer");
128
//			String maintainer = attributes.getValue("maintainer");
129
			exporter = attributes.getValue("exporter");
129
			exporter = attributes.getValue("exporter"); //$NON-NLS-1$
130
			break;
130
			break;
131
		case BUG:
131
		case BUG:
132
			if (attributes != null && (attributes.getValue("error") != null)) { //$NON-NLS-1$
132
			if (attributes != null && (attributes.getValue("error") != null)) { //$NON-NLS-1$
Lines 141-147 Link Here
141
			token = null;
141
			token = null;
142
			break;
142
			break;
143
		case LONG_DESC:
143
		case LONG_DESC:
144
			taskComment = new TaskComment(commentNum++);
144
			String is_private = attributes.getValue("isprivate");
145
			taskComment = new TaskComment(is_private);
145
			break;
146
			break;
146
		case WHO:
147
		case WHO:
147
			if (taskComment != null) {
148
			if (taskComment != null) {
Lines 317-323 Link Here
317
			break;
318
			break;
318
		}
319
		}
319
320
320
		// Comment attributes
321
			// Comment attributes
321
		case WHO:
322
		case WHO:
322
			if (taskComment != null) {
323
			if (taskComment != null) {
323
				taskComment.author = parsedText;
324
				taskComment.author = parsedText;
Lines 522-527 Link Here
522
			BugzillaUtil.createAttributeWithKindDefaultIfUsed(parsedText, tag, repositoryTaskData,
523
			BugzillaUtil.createAttributeWithKindDefaultIfUsed(parsedText, tag, repositoryTaskData,
523
					IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, false);
524
					IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, false);
524
			break;
525
			break;
526
		case COMMENTID:
527
			if (taskComment != null) {
528
				taskComment.id = Integer.parseInt(parsedText);
529
			}
530
			break;
525
		default:
531
		default:
526
			createAttrribute(parsedText, tag);
532
			createAttrribute(parsedText, tag);
527
			break;
533
			break;
Lines 667-672 Link Here
667
				.createPerson(comment.author);
673
				.createPerson(comment.author);
668
		author.setName(comment.authorName);
674
		author.setName(comment.authorName);
669
		taskComment.setAuthor(author);
675
		taskComment.setAuthor(author);
676
		taskComment.setIsPrivate(comment.isPrivate.equals("1")); //$NON-NLS-1$
670
		TaskAttribute attrTimestamp = attribute.createAttribute(BugzillaAttribute.BUG_WHEN.getKey());
677
		TaskAttribute attrTimestamp = attribute.createAttribute(BugzillaAttribute.BUG_WHEN.getKey());
671
		attrTimestamp.setValue(comment.createdTimeStamp);
678
		attrTimestamp.setValue(comment.createdTimeStamp);
672
		taskComment.setCreationDate(repositoryTaskData.getAttributeMapper().getDateValue(attrTimestamp));
679
		taskComment.setCreationDate(repositoryTaskData.getAttributeMapper().getDateValue(attrTimestamp));
Lines 683-688 Link Here
683
			workTime.setValue(comment.timeWorked);
690
			workTime.setValue(comment.timeWorked);
684
		}
691
		}
685
692
693
		if (comment.id != 0) {
694
			TaskAttribute commentID = BugzillaTaskDataHandler.createAttribute(attribute, BugzillaAttribute.COMMENTID);
695
			commentID.setValue(Integer.toString(comment.id));
696
			int i = 9;
697
			i++;
698
		}
699
686
		parseAttachment(taskComment);
700
		parseAttachment(taskComment);
687
701
688
	}
702
	}
Lines 723-728 Link Here
723
		@SuppressWarnings("unused")
737
		@SuppressWarnings("unused")
724
		public int number;
738
		public int number;
725
739
740
		public int id;
741
726
		public String author;
742
		public String author;
727
743
728
		public String authorName;
744
		public String authorName;
Lines 733-746 Link Here
733
749
734
		public String timeWorked;
750
		public String timeWorked;
735
751
736
		@SuppressWarnings("unused")
752
		public String isPrivate;
737
		public boolean hasAttachment;
738
739
		@SuppressWarnings("unused")
740
		public String attachmentId;
741
753
742
		public TaskComment(int num) {
754
		public TaskComment(String isprivate) {
743
			this.number = num;
755
			this.isPrivate = isprivate;
744
		}
756
		}
745
	}
757
	}
746
758
(-)src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties (-1 / +2 lines)
Lines 26-31 Link Here
26
BugzillaAttribute_CC_List=CC List
26
BugzillaAttribute_CC_List=CC List
27
BugzillaAttribute_Classification=Classification:
27
BugzillaAttribute_Classification=Classification:
28
BugzillaAttribute_Classification_ID=Classification ID:
28
BugzillaAttribute_Classification_ID=Classification ID:
29
BugzillaAttribute_Comment_ID=Comment ID:
29
BugzillaAttribute_Component=Component:
30
BugzillaAttribute_Component=Component:
30
BugzillaAttribute_Content_Type=Content Type
31
BugzillaAttribute_Content_Type=Content Type
31
BugzillaAttribute_data=data
32
BugzillaAttribute_data=data
Lines 52-57 Link Here
52
BugzillaAttribute_Patch=Patch
53
BugzillaAttribute_Patch=Patch
53
BugzillaAttribute_Platform=Platform:
54
BugzillaAttribute_Platform=Platform:
54
BugzillaAttribute_Priority=Priority:
55
BugzillaAttribute_Priority=Priority:
56
BugzillaAttribute_Private=Private:
55
BugzillaAttribute_Product=Product:
57
BugzillaAttribute_Product=Product:
56
BugzillaAttribute_QA_Contact=QA Contact:
58
BugzillaAttribute_QA_Contact=QA Contact:
57
BugzillaAttribute_QA_Contact_NAME=QA Contact
59
BugzillaAttribute_QA_Contact_NAME=QA Contact
Lines 72-78 Link Here
72
BugzillaAttribute_thetext=thetext
74
BugzillaAttribute_thetext=thetext
73
BugzillaAttribute_type=type
75
BugzillaAttribute_type=type
74
BugzillaAttribute_UNKNOWN=UNKNOWN
76
BugzillaAttribute_UNKNOWN=UNKNOWN
75
BugzillaAttribute_URLBASE=Url Base:
76
BugzillaAttribute_URL=URL:
77
BugzillaAttribute_URL=URL:
77
BugzillaAttribute_Query_Timestamp=Query Timestamp:
78
BugzillaAttribute_Query_Timestamp=Query Timestamp:
78
BugzillaAttribute_used_by_search_engine_bugs=used by search engine
79
BugzillaAttribute_used_by_search_engine_bugs=used by search engine
(-)src/org/eclipse/mylyn/internal/tasks/core/TaskComment.java (+10 lines)
Lines 43-48 Link Here
43
43
44
	private String url;
44
	private String url;
45
45
46
	private Boolean isPrivate;
47
46
	public TaskComment(TaskRepository taskRepository, ITask task, TaskAttribute taskAttribute) {
48
	public TaskComment(TaskRepository taskRepository, ITask task, TaskAttribute taskAttribute) {
47
		Assert.isNotNull(taskRepository);
49
		Assert.isNotNull(taskRepository);
48
		Assert.isNotNull(task);
50
		Assert.isNotNull(task);
Lines 112-115 Link Here
112
		this.url = url;
114
		this.url = url;
113
	}
115
	}
114
116
117
	public Boolean getIsPrivate() {
118
		return isPrivate;
119
	}
120
121
	public void setIsPrivate(Boolean isPrivate) {
122
		this.isPrivate = isPrivate;
123
	}
124
115
}
125
}
(-)src/org/eclipse/mylyn/internal/tasks/core/data/Messages.java (+2 lines)
Lines 58-63 Link Here
58
58
59
	public static String DefaultTaskSchema_Priority_Label;
59
	public static String DefaultTaskSchema_Priority_Label;
60
60
61
	public static String DefaultTaskSchema_Private_Label;
62
61
	public static String DefaultTaskSchema_Product_Label;
63
	public static String DefaultTaskSchema_Product_Label;
62
64
63
	public static String DefaultTaskSchema_Rank_Label;
65
	public static String DefaultTaskSchema_Rank_Label;
(-)src/org/eclipse/mylyn/internal/tasks/core/data/messages.properties (+1 lines)
Lines 29-34 Link Here
29
DefaultTaskSchema_Owner_Label=Owner
29
DefaultTaskSchema_Owner_Label=Owner
30
DefaultTaskSchema_Patch_Label=Patch
30
DefaultTaskSchema_Patch_Label=Patch
31
DefaultTaskSchema_Priority_Label=Priority
31
DefaultTaskSchema_Priority_Label=Priority
32
DefaultTaskSchema_Private_Label=Private
32
DefaultTaskSchema_Product_Label=Product
33
DefaultTaskSchema_Product_Label=Product
33
DefaultTaskSchema_Rank_Label=Rank
34
DefaultTaskSchema_Rank_Label=Rank
34
DefaultTaskSchema_Replace_existing_attachment=Replace existing attachment of the same name
35
DefaultTaskSchema_Replace_existing_attachment=Replace existing attachment of the same name
(-)src/org/eclipse/mylyn/tasks/core/ITaskComment.java (+10 lines)
Lines 100-103 Link Here
100
	 */
100
	 */
101
	public abstract void setUrl(String url);
101
	public abstract void setUrl(String url);
102
102
103
	/**
104
	 * @since 3.6
105
	 */
106
	public abstract Boolean getIsPrivate();
107
108
	/**
109
	 * @since 3.6
110
	 */
111
	public abstract void setIsPrivate(Boolean isPrivate);
112
103
}
113
}
(-)src/org/eclipse/mylyn/tasks/core/data/DefaultTaskSchema.java (+6 lines)
Lines 79-84 Link Here
79
	public final Field COMMENT_HAS_ATTACHMENT = createField(TaskAttribute.COMMENT_HAS_ATTACHMENT,
79
	public final Field COMMENT_HAS_ATTACHMENT = createField(TaskAttribute.COMMENT_HAS_ATTACHMENT,
80
			Messages.DefaultTaskSchema_Attachment_Label, TaskAttribute.TYPE_BOOLEAN, Flag.READ_ONLY);
80
			Messages.DefaultTaskSchema_Attachment_Label, TaskAttribute.TYPE_BOOLEAN, Flag.READ_ONLY);
81
81
82
	/**
83
	 * @since 3.6
84
	 */
85
	public final Field COMMENT_ISPRIVATE = createField(TaskAttribute.COMMENT_ISPRIVATE,
86
			Messages.DefaultTaskSchema_Private_Label, TaskAttribute.TYPE_BOOLEAN);
87
82
	public final Field COMMENT_NUMBER = createField(TaskAttribute.COMMENT_NUMBER,
88
	public final Field COMMENT_NUMBER = createField(TaskAttribute.COMMENT_NUMBER,
83
			Messages.DefaultTaskSchema_Number_Label, TaskAttribute.TYPE_INTEGER, Flag.READ_ONLY);
89
			Messages.DefaultTaskSchema_Number_Label, TaskAttribute.TYPE_INTEGER, Flag.READ_ONLY);
84
90
(-)src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java (+5 lines)
Lines 126-131 Link Here
126
	public static final String META_READ_ONLY = "task.meta.readOnly"; //$NON-NLS-1$
126
	public static final String META_READ_ONLY = "task.meta.readOnly"; //$NON-NLS-1$
127
127
128
	/**
128
	/**
129
	 * @since 3.6
130
	 */
131
	public static final String COMMENT_ISPRIVATE = "task.common.comment.isprivate"; //$NON-NLS-1$
132
133
	/**
129
	 * Key for the meta datum that determines if an attribute is disabled. This is used to indicate that an attribute
134
	 * Key for the meta datum that determines if an attribute is disabled. This is used to indicate that an attribute
130
	 * should not be modified, e.g. due to work-flow state but it may still be generally writeable.
135
	 * should not be modified, e.g. due to work-flow state but it may still be generally writeable.
131
	 * 
136
	 * 
(-)src/org/eclipse/mylyn/tasks/core/data/TaskCommentMapper.java (+28 lines)
Lines 36-41 Link Here
36
36
37
	private String url;
37
	private String url;
38
38
39
	private Boolean isPrivate;
40
39
	public TaskCommentMapper() {
41
	public TaskCommentMapper() {
40
	}
42
	}
41
43
Lines 63-68 Link Here
63
		return url;
65
		return url;
64
	}
66
	}
65
67
68
	/**
69
	 * @since 3.6
70
	 */
71
	public Boolean getIsPrivate() {
72
		return isPrivate;
73
	}
74
66
	public void setAuthor(IRepositoryPerson author) {
75
	public void setAuthor(IRepositoryPerson author) {
67
		this.author = author;
76
		this.author = author;
68
	}
77
	}
Lines 87-92 Link Here
87
		this.url = url;
96
		this.url = url;
88
	}
97
	}
89
98
99
	/**
100
	 * @since 3.6
101
	 */
102
	public void setIsPrivate(Boolean isPrivate) {
103
		this.isPrivate = isPrivate;
104
	}
105
90
	@SuppressWarnings("deprecation")
106
	@SuppressWarnings("deprecation")
91
	public static TaskCommentMapper createFrom(TaskAttribute taskAttribute) {
107
	public static TaskCommentMapper createFrom(TaskAttribute taskAttribute) {
92
		Assert.isNotNull(taskAttribute);
108
		Assert.isNotNull(taskAttribute);
Lines 121-126 Link Here
121
		if (child != null) {
137
		if (child != null) {
122
			comment.setText(mapper.getValue(child));
138
			comment.setText(mapper.getValue(child));
123
		}
139
		}
140
		child = taskAttribute.getMappedAttribute(TaskAttribute.COMMENT_ISPRIVATE);
141
		if (child != null) {
142
			comment.setIsPrivate(mapper.getBooleanValue(child));
143
		}
124
		return comment;
144
		return comment;
125
	}
145
	}
126
146
Lines 155-160 Link Here
155
			mapper.setValue(child, getText());
175
			mapper.setValue(child, getText());
156
			taskAttribute.putMetaDatum(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, child.getId());
176
			taskAttribute.putMetaDatum(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, child.getId());
157
		}
177
		}
178
		if (getIsPrivate() != null) {
179
			TaskAttribute child = DefaultTaskSchema.getField(TaskAttribute.COMMENT_ISPRIVATE).createAttribute(
180
					taskAttribute);
181
			mapper.setBooleanValue(child, getIsPrivate());
182
		}
158
	}
183
	}
159
184
160
	public void applyTo(ITaskComment taskComment) {
185
	public void applyTo(ITaskComment taskComment) {
Lines 174-178 Link Here
174
		if (getText() != null) {
199
		if (getText() != null) {
175
			taskComment.setText(getText());
200
			taskComment.setText(getText());
176
		}
201
		}
202
		if (getIsPrivate() != null) {
203
			taskComment.setIsPrivate(getIsPrivate());
204
		}
177
	}
205
	}
178
}
206
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java (+2 lines)
Lines 139-144 Link Here
139
139
140
	public static String TaskEditorCommentPart_Expand_Comments;
140
	public static String TaskEditorCommentPart_Expand_Comments;
141
141
142
	public static String TaskEditorCommentPart_Privat_Comment_ToolTip_Text;
143
142
	public static String TaskEditorDescriptionPart_Description;
144
	public static String TaskEditorDescriptionPart_Description;
143
145
144
	public static String TaskEditorDescriptionPart_Detector;
146
	public static String TaskEditorDescriptionPart_Detector;
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java (-2 / +33 lines)
Lines 39-49 Link Here
39
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
39
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
40
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
40
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
41
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
41
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
42
import org.eclipse.osgi.util.NLS;
42
import org.eclipse.swt.SWT;
43
import org.eclipse.swt.SWT;
43
import org.eclipse.swt.events.MouseAdapter;
44
import org.eclipse.swt.events.MouseAdapter;
44
import org.eclipse.swt.events.MouseEvent;
45
import org.eclipse.swt.events.MouseEvent;
45
import org.eclipse.swt.events.PaintEvent;
46
import org.eclipse.swt.events.PaintEvent;
46
import org.eclipse.swt.events.PaintListener;
47
import org.eclipse.swt.events.PaintListener;
48
import org.eclipse.swt.graphics.Font;
49
import org.eclipse.swt.graphics.FontData;
47
import org.eclipse.swt.graphics.Point;
50
import org.eclipse.swt.graphics.Point;
48
import org.eclipse.swt.layout.GridData;
51
import org.eclipse.swt.layout.GridData;
49
import org.eclipse.swt.layout.GridLayout;
52
import org.eclipse.swt.layout.GridLayout;
Lines 51-56 Link Here
51
import org.eclipse.swt.widgets.Canvas;
54
import org.eclipse.swt.widgets.Canvas;
52
import org.eclipse.swt.widgets.Composite;
55
import org.eclipse.swt.widgets.Composite;
53
import org.eclipse.swt.widgets.Control;
56
import org.eclipse.swt.widgets.Control;
57
import org.eclipse.swt.widgets.Display;
54
import org.eclipse.swt.widgets.Menu;
58
import org.eclipse.swt.widgets.Menu;
55
import org.eclipse.ui.actions.ActionContext;
59
import org.eclipse.ui.actions.ActionContext;
56
import org.eclipse.ui.forms.IFormColors;
60
import org.eclipse.ui.forms.IFormColors;
Lines 356-362 Link Here
356
			titleComposite.setBackground(null);
360
			titleComposite.setBackground(null);
357
361
358
			ImageHyperlink expandCommentHyperlink = createTitleHyperLink(toolkit, titleComposite, taskComment);
362
			ImageHyperlink expandCommentHyperlink = createTitleHyperLink(toolkit, titleComposite, taskComment);
359
			expandCommentHyperlink.setFont(commentComposite.getFont());
360
			expandCommentHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
363
			expandCommentHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
361
				@Override
364
				@Override
362
				public void linkActivated(HyperlinkEvent e) {
365
				public void linkActivated(HyperlinkEvent e) {
Lines 399-408 Link Here
399
				sb.append(taskComment.getNumber());
402
				sb.append(taskComment.getNumber());
400
				sb.append(": "); //$NON-NLS-1$
403
				sb.append(": "); //$NON-NLS-1$
401
			}
404
			}
405
			String toolTipText = ""; //$NON-NLS-1$;
402
			if (author != null) {
406
			if (author != null) {
403
				if (author.getName() != null) {
407
				if (author.getName() != null) {
404
					sb.append(author.getName());
408
					sb.append(author.getName());
405
					formHyperlink.setToolTipText(author.getPersonId());
409
					toolTipText = author.getPersonId();
406
				} else {
410
				} else {
407
					sb.append(author.getPersonId());
411
					sb.append(author.getPersonId());
408
				}
412
				}
Lines 411-416 Link Here
411
				sb.append(", "); //$NON-NLS-1$
415
				sb.append(", "); //$NON-NLS-1$
412
				sb.append(EditorUtil.formatDateTime(taskComment.getCreationDate()));
416
				sb.append(EditorUtil.formatDateTime(taskComment.getCreationDate()));
413
			}
417
			}
418
//			We need the CommentID for change the value of private
419
//			this is only for an test included
420
//			Maybe we need this for bug# 284026
421
//			TaskAttribute commentID = taskComment.getTaskAttribute().getAttribute("commentid");
422
//			if (commentID != null) {
423
//				String value = commentID.getValue();
424
//				sb.append(" (ID " + value + ")");
425
//			}
426
			if (taskComment.getIsPrivate() != null) {
427
				if (taskComment.getIsPrivate()) {
428
					if (privateFont == null) {
429
						Font a = formHyperlink.getFont();
430
						FontData[] fd = a.getFontData();
431
						fd[0].setStyle(SWT.ITALIC | SWT.BOLD);
432
						privateFont = new Font(Display.getCurrent(), fd[0]);
433
					}
434
					formHyperlink.setFont(privateFont);
435
					toolTipText = NLS.bind(Messages.TaskEditorCommentPart_Privat_Comment_ToolTip_Text, toolTipText);
436
				}
437
			}
438
			formHyperlink.setToolTipText(toolTipText);
439
414
			formHyperlink.setText(sb.toString());
440
			formHyperlink.setText(sb.toString());
415
			formHyperlink.setEnabled(true);
441
			formHyperlink.setEnabled(true);
416
			formHyperlink.setUnderlined(false);
442
			formHyperlink.setUnderlined(false);
Lines 542-547 Link Here
542
568
543
	private CommentActionGroup actionGroup;
569
	private CommentActionGroup actionGroup;
544
570
571
	private Font privateFont;
572
545
	public TaskEditorCommentPart() {
573
	public TaskEditorCommentPart() {
546
		this.commentGroupStrategy = new CommentGroupStrategy() {
574
		this.commentGroupStrategy = new CommentGroupStrategy() {
547
			@Override
575
			@Override
Lines 664-669 Link Here
664
		if (actionGroup != null) {
692
		if (actionGroup != null) {
665
			actionGroup.dispose();
693
			actionGroup.dispose();
666
		}
694
		}
695
		if (privateFont != null) {
696
			privateFont.dispose();
697
		}
667
	}
698
	}
668
699
669
	private void expandAllComments() {
700
	private void expandAllComments() {
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties (+1 lines)
Lines 75-80 Link Here
75
TaskEditorCommentPart_Collapse_Comments=Collapse Comments
75
TaskEditorCommentPart_Collapse_Comments=Collapse Comments
76
TaskEditorCommentPart_Comments=Comments
76
TaskEditorCommentPart_Comments=Comments
77
TaskEditorCommentPart_Expand_Comments=Expand Comments
77
TaskEditorCommentPart_Expand_Comments=Expand Comments
78
TaskEditorCommentPart_Privat_Comment_ToolTip_Text=Private Comment from {0}
78
79
79
TaskEditorDescriptionPart_Description=Description
80
TaskEditorDescriptionPart_Description=Description
80
TaskEditorDescriptionPart_Detector=Detector:
81
TaskEditorDescriptionPart_Detector=Detector:

Return to bug 345847