Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2013-11-19 17:09:12 -0500
committerGerrit Code Review @ Eclipse.org2013-11-20 17:53:52 -0500
commitae9388d5cd249a040c54fba18f41062be33e25e7 (patch)
tree0fe4f0d17f803c2e884f5d58a45fc8c7c04f35a7
parentba01ab47c34962256b71317b103b03c12b1fca5f (diff)
downloadorg.eclipse.mylyn.tasks-ae9388d5cd249a040c54fba18f41062be33e25e7.tar.gz
org.eclipse.mylyn.tasks-ae9388d5cd249a040c54fba18f41062be33e25e7.tar.xz
org.eclipse.mylyn.tasks-ae9388d5cd249a040c54fba18f41062be33e25e7.zip
330695: indicate tasks assigned to me in the task list tooltip
Make tasks assigned to me more prominent in the task list Change-Id: I84946984fb6a6a9fba39a0b3bb98a1be02b3fb9c Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=330695
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java57
1 files changed, 44 insertions, 13 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
index 2a023f2dc..a1415f57f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
@@ -225,19 +225,6 @@ public class TaskListToolTip extends GradientToolTip {
sb.append(" ["); //$NON-NLS-1$
sb.append(getRepositoryLabel(task.getConnectorKind(), task.getRepositoryUrl()));
sb.append("]"); //$NON-NLS-1$
- sb.append("\n"); //$NON-NLS-1$
-
- String owner = ((ITask) element).getOwner();
- if (owner != null) {
- sb.append(NLS.bind(Messages.TaskListToolTip_Assigned_to_X, owner));
- sb.append("\n"); //$NON-NLS-1$
- }
-
- String extendedToolTipInfo = task.getAttribute(ITasksCoreConstants.ATTRIBUTE_TASK_EXTENDED_TOOLTIP);
- if (extendedToolTipInfo != null && extendedToolTipInfo.length() > 0) {
- sb.append(extendedToolTipInfo);
- sb.append("\n"); //$NON-NLS-1$
- }
return sb.toString();
} else {
return null;
@@ -265,6 +252,40 @@ public class TaskListToolTip extends GradientToolTip {
return ""; //$NON-NLS-1$
}
+ private String getOwnerText(IRepositoryElement element) {
+ if (element instanceof ITask) {
+ String owner = ((ITask) element).getOwner();
+ if (owner != null) {
+ return NLS.bind(Messages.TaskListToolTip_Assigned_to_X, owner);
+ }
+ }
+ return null;
+ }
+
+ private Image getOwnerImage(IRepositoryElement element) {
+ if (element instanceof ITask) {
+ ITask task = (ITask) element;
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(task.getConnectorKind());
+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(task.getConnectorKind(),
+ task.getRepositoryUrl());
+ if (connector.isOwnedByUser(repository, task)) {
+ return CommonImages.getImage(CommonImages.PERSON_ME);
+ }
+ }
+ return null;
+ }
+
+ private String getExtendedToolTipText(IRepositoryElement element) {
+ if (element instanceof ITask) {
+ ITask task = (ITask) element;
+ String extendedToolTipInfo = task.getAttribute(ITasksCoreConstants.ATTRIBUTE_TASK_EXTENDED_TOOLTIP);
+ if (extendedToolTipInfo != null && extendedToolTipInfo.length() > 0) {
+ return extendedToolTipInfo;
+ }
+ }
+ return null;
+ }
+
private String getActivityText(IRepositoryElement element) {
if (element instanceof ITask) {
AbstractTask task = (AbstractTask) element;
@@ -499,6 +520,16 @@ public class TaskListToolTip extends GradientToolTip {
addIconAndLabel(composite, null, detailsText);
}
+ String ownerText = getOwnerText(currentTipElement);
+ if (ownerText != null) {
+ addIconAndLabel(composite, getOwnerImage(currentTipElement), ownerText);
+ }
+
+ String extendedText = getExtendedToolTipText(currentTipElement);
+ if (extendedText != null) {
+ addIconAndLabel(composite, null, extendedText);
+ }
+
String synchText = getSynchText(currentTipElement);
if (synchText != null) {
addIconAndLabel(composite, CommonImages.getImage(TasksUiImages.REPOSITORY_SYNCHRONIZE), synchText);

Back to the top