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

Collapse All | Expand All

(-)src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java (-8 / +25 lines)
Lines 860-870 Link Here
860
				TaskComment lastComment = taskComments.get(taskComments.size() - 1);
860
				TaskComment lastComment = taskComments.get(taskComments.size() - 1);
861
				if (lastComment != null) {
861
				if (lastComment != null) {
862
					descriptionText += "Comment by " + lastComment.getAuthor() + ":\n  ";
862
					descriptionText += "Comment by " + lastComment.getAuthor() + ":\n  ";
863
					String commentText = lastComment.getText().replaceAll("\\s", " ").trim();
863
					descriptionText += cleanValue(lastComment.getText());
864
					if (commentText.length() > 60) {
865
						commentText = commentText.substring(0, 55) + "...";
866
					}
867
					descriptionText += commentText;
868
				}
864
				}
869
			}
865
			}
870
		}
866
		}
Lines 911-918 Link Here
911
		String sep = "";
907
		String sep = "";
912
		int n = 0;
908
		int n = 0;
913
		for (Change change : changes) {
909
		for (Change change : changes) {
914
			String removed = change.removed.toString();
910
			String removed = cleanValues(change.removed);
915
			String added = change.added.toString();
911
			String added = cleanValues(change.added);
916
			details += sep + "  " + change.field + " " + removed;
912
			details += sep + "  " + change.field + " " + removed;
917
			if (removed.length() > 30) {
913
			if (removed.length() > 30) {
918
				details += "\n  ";
914
				details += "\n  ";
Lines 931-937 Link Here
931
//			}
927
//			}
932
928
933
			n++;
929
			n++;
934
			if (n > 5) { // that may not be enough
930
			if (n > 5) {
931
				details += "\nOpen to view more changes";
935
				break;
932
				break;
936
			}
933
			}
937
		}
934
		}
Lines 941-946 Link Here
941
		return details;
938
		return details;
942
	}
939
	}
943
940
941
	private static String cleanValues(List<String> values) {
942
		StringBuilder sb = new StringBuilder();
943
		sb.append("[");
944
		boolean first = true;
945
		for (String value : values) {
946
			if(!first) sb.append(", ");
947
			sb.append(cleanValue(value));
948
		}
949
		sb.append("]");
950
		return sb.toString();
951
	}
952
	
953
	private static String cleanValue(String value) {
954
		String commentText = value.replaceAll("\\s", " ").trim();
955
		if (commentText.length() > 60) {
956
			commentText = commentText.substring(0, 55) + "...";
957
		}
958
		return commentText;
959
	}
960
944
	private static Change getDiff(String field, List<String> oldValues, List<String> newValues) {
961
	private static Change getDiff(String field, List<String> oldValues, List<String> newValues) {
945
		Change change = new Change(field, newValues);
962
		Change change = new Change(field, newValues);
946
		if (oldValues != null) {
963
		if (oldValues != null) {

Return to bug 166406