Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-05-26 01:22:15 -0400
committerspingel2010-05-26 01:22:15 -0400
commite884f0e1d240f1ae8bcb3a0a3df8b86fa154e381 (patch)
treee402038be2163d3ea5b741545bb7dc91cceb87b2 /org.eclipse.mylyn.tasks.core
parent8ba0fe2ef1305ec12cebea5891f05be193792681 (diff)
downloadorg.eclipse.mylyn.tasks-e884f0e1d240f1ae8bcb3a0a3df8b86fa154e381.tar.gz
org.eclipse.mylyn.tasks-e884f0e1d240f1ae8bcb3a0a3df8b86fa154e381.tar.xz
org.eclipse.mylyn.tasks-e884f0e1d240f1ae8bcb3a0a3df8b86fa154e381.zip
NEW - bug 314166: fix the scheduled presentation bins and sort order
https://bugs.eclipse.org/bugs/show_bug.cgi?id=314166
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java18
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskFilter.java23
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java75
3 files changed, 77 insertions, 39 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
index fe836edf9..781a8bfef 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/AbstractTaskContainer.java
@@ -64,8 +64,9 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IR
}
/**
- * Removes any cyclic dependencies in children. TODO: review to make sure that this is too expensive, or move to
- * creation.
+ * Removes any cyclic dependencies in children.
+ *
+ * TODO: review to make sure that this is too expensive, or move to creation.
*
* @since 3.0
*/
@@ -74,7 +75,9 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IR
}
/**
- * Maxes out at a depth of 10. TODO: review policy
+ * Maxes out at a depth of 10.
+ *
+ * TODO: review policy
*/
public boolean contains(String handle) {
Assert.isNotNull(handle);
@@ -177,13 +180,4 @@ public abstract class AbstractTaskContainer extends PlatformObject implements IR
return true;
}
- /**
- * removes all children from the container
- *
- * @since 3.4
- */
- public void clear() {
- children.clear();
- }
-
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskFilter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskFilter.java
deleted file mode 100644
index e7b8fa449..000000000
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskFilter.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.tasks.core;
-
-import org.eclipse.mylyn.tasks.core.ITask;
-
-/**
- * @author Robert Elves
- */
-public interface ITaskFilter {
-
- public boolean select(ITask task);
-
-}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
index 32bc442e0..c92cf0a33 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
@@ -12,6 +12,7 @@
package org.eclipse.mylyn.internal.tasks.core;
import java.util.Calendar;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -22,7 +23,7 @@ import org.eclipse.mylyn.tasks.core.ITask;
* @author Rob Elves
* @author Mik Kersten
*/
-public class ScheduledTaskContainer extends AbstractTaskContainer implements ITaskFilter {
+public class ScheduledTaskContainer extends AbstractTaskContainer {
private final TaskActivityManager activityManager;
@@ -53,7 +54,74 @@ public class ScheduledTaskContainer extends AbstractTaskContainer implements ITa
return range.getStartDate().before(Calendar.getInstance()) && range.getEndDate().after(Calendar.getInstance());
}
- public boolean select(ITask selectTask) {
+// public boolean isWeekDay() {
+// return TaskActivityUtil.getCurrentWeek().isCurrentWeekDay(range);
+// }
+
+// public boolean isToday() {
+// if (range instanceof DayDateRange) {
+// return ((DayDateRange) range).isToday();
+// }
+// return false;
+// }
+
+// public Collection<ITask> getChildren() {
+// Set<ITask> children = new HashSet<ITask>();
+// Calendar beginning = TaskActivityUtil.getCalendar();
+// beginning.setTimeInMillis(0);
+// if (isFloating() && !isFuture()) {
+// for (ITask task : activityManager.getScheduledTasks(rangebeginning, getEndDate())) {
+// if (task.internalIsFloatingScheduledDate()) {
+// children.add(task);
+// }
+// }
+// } else if (isPresent()) {
+// // add all due/overdue
+// Calendar end = TaskActivityUtil.getCalendar();
+// end.set(5000, 12, 1);
+// for (ITask task : activityManager.getDueTasks(beginning, getEndDate())) {
+// if (activityManager.isOwnedByUser(task)) {
+// children.add(task);
+// }
+// }
+//
+// // add all scheduled/overscheduled
+// for (ITask task : activityManager.getScheduledTasks(beginning, getEndDate())) {
+// if (!task.internalIsFloatingScheduledDate() && !task.isCompleted()) {
+// children.add(task);
+// }
+// }
+//
+// // if not scheduled or due in future, and is active, place in today bin
+// ITask activeTask = activityManager.getActiveTask();
+// if (activeTask != null && !children.contains(activeTask)) {
+// Set<ITask> futureScheduled = activityManager.getScheduledTasks(getStartDate(), end);
+// for (ITask task : activityManager.getDueTasks(getStartDate(), end)) {
+// if (activityManager.isOwnedByUser(task)) {
+// futureScheduled.add(task);
+// }
+// }
+// if (!futureScheduled.contains(activeTask)) {
+// children.add(activeTask);
+// }
+// }
+// } else if (isFuture()) {
+// children.addAll(activityManager.getScheduledTasks(getStartDate(), getEndDate()));
+// for (ITask task : activityManager.getDueTasks(getStartDate(), getEndDate())) {
+// if (activityManager.isOwnedByUser(task)) {
+// children.add(task);
+// }
+// }
+// } else {
+// children.addAll(activityManager.getActiveTasks(range.getStartDate(), range.getEndDate()));
+// }
+// return children;
+// }
+
+ @Override
+ public Collection<ITask> getChildren() {
+
+ // TODO: Cache this information until the next modification to pertinent data
Set<ITask> children = new HashSet<ITask>();
@@ -99,8 +167,7 @@ public class ScheduledTaskContainer extends AbstractTaskContainer implements ITa
}
}
- return children.contains(selectTask);
-
+ return children;
}
@Override

Back to the top