Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-24 21:42:07 +0000
committermkersten2007-06-24 21:42:07 +0000
commit9dbcb6723ee3a61ad67a58f832d3f897b09dd1f9 (patch)
tree9658681dd173bb110da40559c767cdef564749b9
parent3db476cfab36b6910675e5355d7ba4df6eed95b8 (diff)
downloadorg.eclipse.mylyn.tasks-9dbcb6723ee3a61ad67a58f832d3f897b09dd1f9.tar.gz
org.eclipse.mylyn.tasks-9dbcb6723ee3a61ad67a58f832d3f897b09dd1f9.tar.xz
org.eclipse.mylyn.tasks-9dbcb6723ee3a61ad67a58f832d3f897b09dd1f9.zip
RESOLVED - bug 193870: all category nodes in the Task List view are missing tooltip
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193870
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java53
1 files changed, 29 insertions, 24 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
index 7564d6fbb..0ad675294 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.monitor.core.DateUtil;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
import org.eclipse.mylyn.tasks.core.AbstractTask;
+import org.eclipse.mylyn.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -66,9 +67,6 @@ public class TaskListToolTipHandler {
private Widget tipWidget;
- public TaskListToolTipHandler() {
- }
-
private AbstractTaskContainer getTaskListElement(Object hoverObject) {
if (hoverObject instanceof Widget) {
Object data = ((Widget) hoverObject).getData();
@@ -117,17 +115,9 @@ public class TaskListToolTipHandler {
sb.append(DateUtil.getFormattedDurationShort(container.getTotalElapsed()));
sb.append("\n");
return sb.toString();
- } else if (element instanceof AbstractRepositoryQuery) {
- AbstractRepositoryQuery query = (AbstractRepositoryQuery) element;
- StringBuilder sb = new StringBuilder();
- String syncStamp = query.getLastSynchronizedTimeStamp();
- if (syncStamp != null) {
- sb.append("Synchronized: " + syncStamp);
- }
- return sb.toString();
} else if (element instanceof AbstractTask) {
AbstractTask task = (AbstractTask) element;
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder();
sb.append(TasksUiPlugin.getConnectorUi(task.getConnectorKind()).getTaskKindLabel(task));
String key = task.getTaskKey();
if (key != null) {
@@ -141,8 +131,9 @@ public class TaskListToolTipHandler {
sb.append("]");
sb.append("\n");
return sb.toString();
+ } else {
+ return null;
}
- return null;
}
private String getRepositoryLabel(String repositoryKind, String repositoryUrl) {
@@ -213,7 +204,7 @@ public class TaskListToolTipHandler {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) element;
status = query.getSynchronizationStatus();
}
-
+
if (status != null) {
StringBuilder sb = new StringBuilder();
sb.append(status.getMessage());
@@ -221,8 +212,8 @@ public class TaskListToolTipHandler {
sb.append(" Please synchronize manually for full error message.");
}
return sb.toString();
- }
-
+ }
+
return null;
}
@@ -324,13 +315,13 @@ public class TaskListToolTipHandler {
Tree w = (Tree) widget;
widget = w.getItem(widgetPosition);
}
-
+
if (widget == null) {
hideTooltip();
tipWidget = null;
return;
}
-
+
if (widget == tipWidget) {
// already displaying tooltip
return;
@@ -394,16 +385,12 @@ public class TaskListToolTipHandler {
hideTooltip();
AbstractTaskContainer element = getTaskListElement(tipWidget);
- String detailsText = getDetailsText(element);
- if (detailsText == null) {
- return;
- }
Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell();
if (parent == null) {
return;
}
-
+
tipShell = new Shell(parent.getDisplay(), SWT.TOOL | SWT.NO_FOCUS | SWT.MODELESS | SWT.ON_TOP);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
@@ -414,13 +401,21 @@ public class TaskListToolTipHandler {
addIconAndLabel(tipShell, getImage(element), getTitleText(element));
- addIconAndLabel(tipShell, null, detailsText);
+ String detailsText = getDetailsText(element);
+ if (detailsText != null) {
+ addIconAndLabel(tipShell, null, detailsText);
+ }
String statusText = getStatusText(element);
if (statusText != null) {
addIconAndLabel(tipShell, TasksUiImages.getImage(TasksUiImages.WARNING), statusText);
}
+ String synchText = getSynchText(element);
+ if (synchText != null) {
+ addIconAndLabel(tipShell, TasksUiImages.getImage(TasksUiImages.REPOSITORY_SYNCHRONIZE), synchText);
+ }
+
String activityText = getActivityText(element);
if (activityText != null) {
addIconAndLabel(tipShell, TasksUiImages.getImage(TasksUiImages.CALENDAR), activityText);
@@ -455,6 +450,16 @@ public class TaskListToolTipHandler {
tipShell.setVisible(true);
}
+ private String getSynchText(AbstractTaskContainer element) {
+ if (element instanceof AbstractRepositoryQuery) {
+ String syncStamp = ((AbstractRepositoryQuery) element).getLastSynchronizedTimeStamp();
+ if (syncStamp != null) {
+ return "Synchronized: " + syncStamp;
+ }
+ }
+ return null;
+ }
+
private void addLabel(Shell parent, String text) {
Label textLabel = new Label(parent, SWT.NONE);
textLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));

Back to the top