Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-26 16:53:25 -0400
committermkersten2007-06-26 16:53:25 -0400
commit83c2959f5214cbf8165a8c0247564696cc74c4c5 (patch)
treea9c7702c5294022d92732a8e9e3386d264944917
parent3d07229dd5e2bcb56eab3a728b1c73353a3c5e91 (diff)
downloadorg.eclipse.mylyn.tasks-83c2959f5214cbf8165a8c0247564696cc74c4c5.tar.gz
org.eclipse.mylyn.tasks-83c2959f5214cbf8165a8c0247564696cc74c4c5.tar.xz
org.eclipse.mylyn.tasks-83c2959f5214cbf8165a8c0247564696cc74c4c5.zip
NEW - bug 166406: Improve query tooltip layout
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166406
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java33
1 files changed, 25 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
index 55c522c79..74a566886 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java
@@ -860,11 +860,7 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
TaskComment lastComment = taskComments.get(taskComments.size() - 1);
if (lastComment != null) {
descriptionText += "Comment by " + lastComment.getAuthor() + ":\n ";
- String commentText = lastComment.getText().replaceAll("\\s", " ").trim();
- if (commentText.length() > 60) {
- commentText = commentText.substring(0, 55) + "...";
- }
- descriptionText += commentText;
+ descriptionText += cleanValue(lastComment.getText());
}
}
}
@@ -911,8 +907,8 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
String sep = "";
int n = 0;
for (Change change : changes) {
- String removed = change.removed.toString();
- String added = change.added.toString();
+ String removed = cleanValues(change.removed);
+ String added = cleanValues(change.added);
details += sep + " " + change.field + " " + removed;
if (removed.length() > 30) {
details += "\n ";
@@ -931,7 +927,8 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
// }
n++;
- if (n > 5) { // that may not be enough
+ if (n > 5) {
+ details += "\nOpen to view more changes";
break;
}
}
@@ -941,6 +938,26 @@ public class TasksUiPlugin extends AbstractUIPlugin implements IStartup {
return details;
}
+ private static String cleanValues(List<String> values) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("[");
+ boolean first = true;
+ for (String value : values) {
+ if(!first) sb.append(", ");
+ sb.append(cleanValue(value));
+ }
+ sb.append("]");
+ return sb.toString();
+ }
+
+ private static String cleanValue(String value) {
+ String commentText = value.replaceAll("\\s", " ").trim();
+ if (commentText.length() > 60) {
+ commentText = commentText.substring(0, 55) + "...";
+ }
+ return commentText;
+ }
+
private static Change getDiff(String field, List<String> oldValues, List<String> newValues) {
Change change = new Change(field, newValues);
if (oldValues != null) {

Back to the top