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

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java (-1 / +1 lines)
Lines 290-296 Link Here
290
						TasksUiPlugin.getTaskDataManager());
290
						TasksUiPlugin.getTaskDataManager());
291
				TaskDataDiff diff = notifier.getDiff(task);
291
				TaskDataDiff diff = notifier.getDiff(task);
292
				if (diff != null) {
292
				if (diff != null) {
293
					text = diff.toString(MAX_TEXT_WIDTH);
293
					text = diff.toString(MAX_TEXT_WIDTH, false);
294
				}
294
				}
295
				if (text != null && text.length() > 0) {
295
				if (text != null && text.length() > 0) {
296
					return text;
296
					return text;
(-)src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskDataDiff.java (-3 / +11 lines)
Lines 12-17 Link Here
12
package org.eclipse.mylyn.internal.tasks.ui.notifications;
12
package org.eclipse.mylyn.internal.tasks.ui.notifications;
13
13
14
import java.util.Collection;
14
import java.util.Collection;
15
import java.util.Iterator;
15
import java.util.LinkedHashSet;
16
import java.util.LinkedHashSet;
16
import java.util.Set;
17
import java.util.Set;
17
18
Lines 121-137 Link Here
121
122
122
	@Override
123
	@Override
123
	public String toString() {
124
	public String toString() {
124
		return toString(60);
125
		return toString(60, true);
125
	}
126
	}
126
127
127
	// TODO implement trim based on text width
128
	// TODO implement trim based on text width
128
	public String toString(int maxWidth) {
129
	public String toString(int maxWidth, boolean includeNewest) {
129
		StringBuilder sb = new StringBuilder();
130
		StringBuilder sb = new StringBuilder();
130
		String sep = ""; //$NON-NLS-1$
131
		String sep = ""; //$NON-NLS-1$
131
		// append first comment
132
		// append first comment
132
		int newCommentCount = newComments.size();
133
		int newCommentCount = newComments.size();
133
		if (newCommentCount > 0) {
134
		if (newCommentCount > 0) {
134
			ITaskComment comment = newComments.iterator().next();
135
			Iterator<ITaskComment> iter = newComments.iterator();
136
			ITaskComment comment = iter.next();
137
			if (includeNewest) {
138
				while (iter.hasNext()) {
139
					comment = iter.next();
140
				}
141
			}
142
135
			sb.append(TaskDiffUtil.trim(TaskDiffUtil.commentToString(comment), 60));
143
			sb.append(TaskDiffUtil.trim(TaskDiffUtil.commentToString(comment), 60));
136
			if (newCommentCount > 1) {
144
			if (newCommentCount > 1) {
137
				sb.append(" (" + (newCommentCount - 1) + Messages.TaskDataDiff_more_); //$NON-NLS-1$
145
				sb.append(" (" + (newCommentCount - 1) + Messages.TaskDataDiff_more_); //$NON-NLS-1$
(-)src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotifier.java (-1 / +1 lines)
Lines 60-66 Link Here
60
			TaskDataDiff diff = getDiff(task);
60
			TaskDataDiff diff = getDiff(task);
61
			if (diff != null) {
61
			if (diff != null) {
62
				TaskListNotification notification = new TaskListNotification(task, token);
62
				TaskListNotification notification = new TaskListNotification(task, token);
63
				notification.setDescription(diff.toString());
63
				notification.setDescription(diff.toString(60, true));
64
				return notification;
64
				return notification;
65
			}
65
			}
66
		}
66
		}
(-)src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java (-18 lines)
Lines 11-19 Link Here
11
11
12
package org.eclipse.mylyn.internal.tasks.ui.notifications;
12
package org.eclipse.mylyn.internal.tasks.ui.notifications;
13
13
14
import java.util.Date;
15
16
import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotification;
17
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
14
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
18
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
15
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
19
import org.eclipse.swt.graphics.Image;
16
import org.eclipse.swt.graphics.Image;
Lines 32-50 Link Here
32
	public Image getNotificationKindImage() {
29
	public Image getNotificationKindImage() {
33
		return CommonImages.getImage(CommonImages.OVERLAY_DATE_DUE);
30
		return CommonImages.getImage(CommonImages.OVERLAY_DATE_DUE);
34
	}
31
	}
35
36
	@Override
37
	public int compareTo(AbstractNotification anotherNotification) throws ClassCastException {
38
		if (!(anotherNotification != null)) {
39
			throw new ClassCastException("A ITaskListNotification object expected."); //$NON-NLS-1$
40
		}
41
		Date anotherDate = (anotherNotification).getDate();
42
		if (date != null && anotherDate != null) {
43
			return date.compareTo(anotherDate);
44
		} else if (date == null) {
45
			return -1;
46
		} else {
47
			return 1;
48
		}
49
	}
50
}
32
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationQueryIncoming.java (-47 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.notifications;
13
14
import java.util.Date;
15
16
import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotification;
17
import org.eclipse.mylyn.tasks.core.ITask;
18
19
/**
20
 * @author Rob Elves
21
 */
22
public class TaskListNotificationQueryIncoming extends TaskListNotification {
23
24
	public TaskListNotificationQueryIncoming(ITask task) {
25
		super(task);
26
	}
27
28
	@Override
29
	public String getDescription() {
30
		return task.getSummary();
31
	}
32
33
	@Override
34
	public int compareTo(AbstractNotification anotherNotification) throws ClassCastException {
35
		if (!(anotherNotification != null)) {
36
			throw new ClassCastException("A ITaskListNotification object expected."); //$NON-NLS-1$
37
		}
38
		Date anotherDate = (anotherNotification).getDate();
39
		if (date != null && anotherDate != null) {
40
			return date.compareTo(anotherDate);
41
		} else if (date == null) {
42
			return -1;
43
		} else {
44
			return 1;
45
		}
46
	}
47
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java (-3 / +3 lines)
Lines 111-121 Link Here
111
		}
111
		}
112
		Date anotherDate = (anotherNotification).getDate();
112
		Date anotherDate = (anotherNotification).getDate();
113
		if (date != null && anotherDate != null) {
113
		if (date != null && anotherDate != null) {
114
			return date.compareTo(anotherDate);
114
			return date.compareTo(anotherDate) * -1;
115
		} else if (date == null) {
115
		} else if (date == null) {
116
			return -1;
117
		} else {
118
			return 1;
116
			return 1;
117
		} else {
118
			return -1;
119
		}
119
		}
120
	}
120
	}
121
121
(-).refactorings/2009/5/21/refactorings.history (+4 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<session version="1.0">
3
<refactoring accessors="true" comment="Delete 1 element(s) from project &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0A;- Original element: &apos;org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationQueryIncoming.java&apos;" description="Delete element" element1="/src&lt;org.eclipse.mylyn.internal.tasks.ui.notifications{TaskListNotificationQueryIncoming.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1243100594137" subPackages="false" version="1.0"/>
4
</session>
(-).refactorings/2009/5/21/refactorings.index (+1 lines)
Added Link Here
1
1243100594137	Delete element
(-)src/org/eclipse/mylyn/internal/sandbox/dev/actions/TestTaskListNotificationAction.java (-5 / +14 lines)
Lines 12-26 Link Here
12
package org.eclipse.mylyn.internal.sandbox.dev.actions;
12
package org.eclipse.mylyn.internal.sandbox.dev.actions;
13
13
14
import java.util.Collection;
14
import java.util.Collection;
15
import java.util.HashSet;
16
import java.util.Iterator;
15
import java.util.Iterator;
17
import java.util.Set;
18
16
19
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.action.IAction;
20
import org.eclipse.jface.viewers.ISelection;
18
import org.eclipse.jface.viewers.ISelection;
21
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
19
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
22
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
20
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
21
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification;
23
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationReminder;
22
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationReminder;
23
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier;
24
import org.eclipse.ui.IWorkbenchWindow;
24
import org.eclipse.ui.IWorkbenchWindow;
25
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
25
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
26
26
Lines 42-56 Link Here
42
	public void run(IAction action) {
42
	public void run(IAction action) {
43
		Collection<AbstractTask> allTasks = TasksUiPlugin.getTaskList().getAllTasks();
43
		Collection<AbstractTask> allTasks = TasksUiPlugin.getTaskList().getAllTasks();
44
		Iterator<AbstractTask> iterator = allTasks.iterator();
44
		Iterator<AbstractTask> iterator = allTasks.iterator();
45
		Set<TaskListNotificationReminder> dummyNotifications = new HashSet<TaskListNotificationReminder>();
45
		while (iterator.hasNext()) {
46
		for (int i = 0; i < 6; i++) {
46
			AbstractTask task = iterator.next();
47
			if (task.getHandleIdentifier().equals("http://macmainz.dyndns.org/Internet/Bugzilla32-10")
48
					|| task.getHandleIdentifier().equals("http://macmainz.dyndns.org/Internet/Bugzilla32-8")) {
49
				TaskListNotifier notifier = new TaskListNotifier(TasksUiPlugin.getRepositoryModel(),
50
						TasksUiPlugin.getTaskDataManager());
51
				TaskListNotification notification = notifier.getNotification(task, null);
52
				TasksUiPlugin.getTaskListNotificationManager().getNotifications().add(notification);
53
			}
54
		}
55
		iterator = allTasks.iterator();
56
		for (int i = 0; i < 2; i++) {
47
			TaskListNotificationReminder notification = new TaskListNotificationReminder(iterator.next());
57
			TaskListNotificationReminder notification = new TaskListNotificationReminder(iterator.next());
48
			notification.setDescription("Mylyn is the Task-Focused UI for Eclipse that reduces information overload "
58
			notification.setDescription("Mylyn is the Task-Focused UI for Eclipse that reduces information overload "
49
					+ "\n..........and makes multi-tasking easy. It does this by making tasks a first class part of");
59
					+ "\n..........and makes multi-tasking easy. It does this by making tasks a first class part of");
50
//					+ "Eclipse, and integrating rich and offline editing for repositories such as Bugzilla, "
60
//					+ "Eclipse, and integrating rich and offline editing for repositories such as Bugzilla, "
51
//					+ "Trac, and JIRA. Once your tasks are integrated, Mylyn monitors your work activity to "
61
//					+ "Trac, and JIRA. Once your tasks are integrated, Mylyn monitors your work activity to "
52
//					+ "inidentify information relevant to the task-at-hand, and uses this task context to focus ");
62
//					+ "inidentify information relevant to the task-at-hand, and uses this task context to focus ");
53
			dummyNotifications.add(notification);
54
			TasksUiPlugin.getTaskListNotificationManager().getNotifications().add(notification);
63
			TasksUiPlugin.getTaskListNotificationManager().getNotifications().add(notification);
55
		}
64
		}
56
		TasksUiPlugin.getTaskListNotificationManager().showPopup();
65
		TasksUiPlugin.getTaskListNotificationManager().showPopup();

Return to bug 243655