Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java16
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityManager.java13
2 files changed, 29 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
index b4c77a409..51804d8de 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java
@@ -857,6 +857,22 @@ public class TaskActivityManager implements ITaskActivityManager {
return taskActivationHistory;
}
+ public Date getFirstActivity(ITask task) {
+ SortedMap<Calendar, Long> activityMap = taskElapsedTimeMap.get(task);
+ if (activityMap != null && !activityMap.isEmpty()) {
+ return activityMap.firstKey().getTime();
+ }
+ return null;
+ }
+
+ public Date getLastActivity(ITask task) {
+ SortedMap<Calendar, Long> activityMap = taskElapsedTimeMap.get(task);
+ if (activityMap != null && !activityMap.isEmpty()) {
+ return activityMap.lastKey().getTime();
+ }
+ return null;
+ }
+
public Set<ITask> getAllScheduledTasks() {
return new HashSet<ITask>(allScheduledTasks);
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityManager.java
index 02dd0cacf..d60bef7bf 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityManager.java
@@ -12,6 +12,7 @@
package org.eclipse.mylyn.tasks.core;
import java.util.Calendar;
+import java.util.Date;
import java.util.Set;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
@@ -68,6 +69,18 @@ public interface ITaskActivityManager {
*/
public abstract long getElapsedTime(ITask task, Calendar start, Calendar end);
+ /**
+ * @return the date of the first activity of the given task
+ * @since 3.10
+ */
+ public abstract Date getFirstActivity(ITask task);
+
+ /**
+ * @return the date of the last activity of the given task
+ * @since 3.10
+ */
+ public abstract Date getLastActivity(ITask task);
+
public abstract void addActivityListener(ITaskActivityListener listener);
public abstract void removeActivityListener(ITaskActivityListener listener);

Back to the top