|
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; |
|
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; |
|
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) { |
|
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 |
} |
|
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); |
|
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 |
|
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() { |