Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-05-26 17:15:44 -0400
committerrelves2010-05-26 17:15:44 -0400
commitad10b0ae946d6ec3a4ab539b5ff133be553b6bde (patch)
tree4b5a5a0ac3622f534af78cc07c9cf7785b168692 /org.eclipse.mylyn.tasks.ui
parentc600ebece9a5a456b70fa64d8157221c72b0bd6a (diff)
downloadorg.eclipse.mylyn.tasks-ad10b0ae946d6ec3a4ab539b5ff133be553b6bde.tar.gz
org.eclipse.mylyn.tasks-ad10b0ae946d6ec3a4ab539b5ff133be553b6bde.tar.xz
org.eclipse.mylyn.tasks-ad10b0ae946d6ec3a4ab539b5ff133be553b6bde.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.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/Messages.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java41
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java117
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/messages.properties3
4 files changed, 136 insertions, 31 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/Messages.java
index 78a1388e5..4c073b691 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/Messages.java
@@ -101,8 +101,14 @@ public class Messages extends NLS {
public static String TaskListView_Task_List;
+ public static String TaskScheduleContentProvider_Completed;
+
public static String TaskScheduleContentProvider_Future;
+ public static String TaskScheduleContentProvider_Incoming;
+
+ public static String TaskScheduleContentProvider_Outgoing;
+
public static String TaskScheduleContentProvider_Two_Weeks;
public static String TaskScheduleContentProvider_Unscheduled;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
index be3dbc59a..7889515cd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java
@@ -23,6 +23,9 @@ import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Completed;
+import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Incoming;
+import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Outgoing;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Unscheduled;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
@@ -78,6 +81,10 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
if (scheduleContainer instanceof TaskScheduleContentProvider.Unscheduled) {
return true;
}
+ if (scheduleContainer instanceof TaskScheduleContentProvider.Incoming
+ || scheduleContainer instanceof TaskScheduleContentProvider.Outgoing) {
+ return (scheduleContainer.getChildren().size() > 0);
+ }
if (TaskActivityUtil.getCurrentWeek().isCurrentWeekDay(scheduleContainer.getDateRange())) {
if (scheduleContainer.isPresent() || scheduleContainer.isFuture()) {
return true;
@@ -122,30 +129,24 @@ public class TaskListInterestFilter extends AbstractTaskListFilter {
}
private boolean shouldShowInFocusedWorkweekDateContainer(Object parent, ITask task) {
- if (parent instanceof ScheduledTaskContainer) {
-
- ScheduledTaskContainer container = (ScheduledTaskContainer) parent;
+ if (parent instanceof Unscheduled) {
+ return false;
+ }
- if (container instanceof Unscheduled) {
- return false;
- }
+ if (parent instanceof Incoming) {
+ return true;
+ }
- if (isDateRangeInteresting(container)) {
- return true;
- }
+ if (parent instanceof Outgoing) {
+ return true;
+ }
-// if (container.isWeekDay() || container.isPresent()) {
-// return true;
-// }
-//
-//// if (!TasksUiPlugin.getTaskActivityManager().isWeekDay((ScheduledTaskContainer) parent)) {
-//// return false;
-//// }
-// if (TasksUiPlugin.getTaskActivityManager().isOverdue(task)
-// || TasksUiPlugin.getTaskActivityManager().isPastReminder((AbstractTask) task)) {
-// return true;
-// }
+ if (parent instanceof Completed) {
+ return true;
+ }
+ if (parent instanceof ScheduledTaskContainer) {
+ return (isDateRangeInteresting((ScheduledTaskContainer) parent));
}
return false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
index a85f387ce..e9eb34a96 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.DateRange;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
@@ -32,6 +33,7 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskActivityListener;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.ui.PlatformUI;
/**
@@ -47,8 +49,20 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
private final Calendar END_OF_TIME;
+ private final Calendar INCOMING_TIME;
+
+ private final Calendar OUTGOING_TIME;
+
+ private final Calendar COMPLETED_TIME;
+
private Job rolloverJob;
+ private final Incoming incoming;
+
+ private final Outgoing outgoing;
+
+ private final Completed completed;
+
public TaskScheduleContentProvider(TaskListView taskListView) {
super(taskListView);
this.taskActivityManager = TasksUiPlugin.getTaskActivityManager();
@@ -57,15 +71,26 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
END_OF_TIME.add(Calendar.YEAR, 5000);
END_OF_TIME.getTime();
unscheduled = new Unscheduled(taskActivityManager, new DateRange(END_OF_TIME));
+
+ INCOMING_TIME = TaskActivityUtil.getCalendar();
+ INCOMING_TIME.setTimeInMillis(END_OF_TIME.getTimeInMillis() - 1);
+ incoming = new Incoming();
+
+ OUTGOING_TIME = TaskActivityUtil.getCalendar();
+ OUTGOING_TIME.setTimeInMillis(END_OF_TIME.getTimeInMillis() - 2);
+ outgoing = new Outgoing();
+
+ COMPLETED_TIME = TaskActivityUtil.getCalendar();
+ COMPLETED_TIME.setTimeInMillis(END_OF_TIME.getTimeInMillis() + 2);
+ completed = new Completed();
+
}
@Override
public Object[] getElements(Object parent) {
if (parent != null && parent.equals(this.taskListView.getViewSite())) {
-
Set<AbstractTaskContainer> containers = new HashSet<AbstractTaskContainer>();
-
WeekDateRange week = TaskActivityUtil.getCurrentWeek();
WeekDateRange nextWeek = TaskActivityUtil.getNextWeek();
@@ -85,6 +110,8 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
for (DateRange day : week.getRemainingDays()) {
containers.add(new ScheduledTaskContainer(TasksUiPlugin.getTaskActivityManager(), day));
}
+
+ // This Week
containers.add(new ScheduledTaskContainer(TasksUiPlugin.getTaskActivityManager(), week));
for (DateRange day : nextWeek.getDaysOfWeek()) {
@@ -98,7 +125,6 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
.next(), Messages.TaskScheduleContentProvider_Two_Weeks);
containers.add(twoWeeksContainer);
- containers.add(unscheduled);
Calendar startDate = TaskActivityUtil.getCalendar();
startDate.setTimeInMillis(twoWeeksContainer.getEnd().getTimeInMillis());
TaskActivityUtil.snapNextDay(startDate);
@@ -110,6 +136,18 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
Messages.TaskScheduleContentProvider_Future);
containers.add(futureContainer);
+ // Outgoing
+ containers.add(outgoing);
+
+ // Incoming
+ containers.add(incoming);
+
+ // Unscheduled
+ containers.add(unscheduled);
+
+ // Completed
+ containers.add(completed);
+
return applyFilter(containers).toArray();
} else {
@@ -184,22 +222,79 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
public class Unscheduled extends ScheduledTaskContainer {
- private final TaskActivityManager activityManager;
-
public Unscheduled(TaskActivityManager activityManager, DateRange range) {
super(activityManager, range, Messages.TaskScheduleContentProvider_Unscheduled);
- this.activityManager = activityManager;
}
@Override
public Collection<ITask> getChildren() {
- Set<ITask> all = new HashSet<ITask>();
- for (ITask task : activityManager.getUnscheduled()) {
- if (!task.isCompleted() || (task.isCompleted() && !task.getSynchronizationState().isSynchronized())) {
- all.add(task);
+ Set<ITask> children = new HashSet<ITask>();
+ for (AbstractTask task : TasksUiPlugin.getTaskList().getAllTasks()) {
+ if (task.getDueDate() == null && task.getScheduledForDate() == null && !task.isCompleted()
+ && task.getSynchronizationState().isSynchronized()) {
+ children.add(task);
+ }
+ }
+ return children;
+ }
+ }
+
+ public class Incoming extends ScheduledTaskContainer {
+
+ public Incoming() {
+ super(taskActivityManager, new DateRange(INCOMING_TIME), Messages.TaskScheduleContentProvider_Incoming);
+ }
+
+ @Override
+ public Collection<ITask> getChildren() {
+ Set<ITask> children = new HashSet<ITask>();
+ for (ITask task : TasksUiPlugin.getTaskList().getAllTasks()) {
+ if (task.getSynchronizationState().equals(SynchronizationState.INCOMING)
+ || task.getSynchronizationState().equals(SynchronizationState.INCOMING_NEW)) {
+ children.add(task);
+ }
+ }
+ return children;
+ }
+
+ }
+
+ public class Outgoing extends ScheduledTaskContainer {
+
+ public Outgoing() {
+ super(taskActivityManager, new DateRange(OUTGOING_TIME), Messages.TaskScheduleContentProvider_Outgoing);
+ }
+
+ @Override
+ public Collection<ITask> getChildren() {
+ Set<ITask> children = new HashSet<ITask>();
+ for (ITask task : TasksUiPlugin.getTaskList().getAllTasks()) {
+ if (task.getSynchronizationState().equals(SynchronizationState.OUTGOING)
+ || task.getSynchronizationState().equals(SynchronizationState.OUTGOING_NEW)
+ || task.getSynchronizationState().equals(SynchronizationState.CONFLICT)) {
+ children.add(task);
+ }
+ }
+ return children;
+ }
+
+ }
+
+ public class Completed extends ScheduledTaskContainer {
+
+ public Completed() {
+ super(taskActivityManager, new DateRange(COMPLETED_TIME), Messages.TaskScheduleContentProvider_Completed);
+ }
+
+ @Override
+ public Collection<ITask> getChildren() {
+ Set<ITask> children = new HashSet<ITask>();
+ for (ITask task : TasksUiPlugin.getTaskList().getAllTasks()) {
+ if (task.isCompleted() && task.getSynchronizationState().equals(SynchronizationState.SYNCHRONIZED)) {
+ children.add(task);
}
}
- return all;
+ return children;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/messages.properties
index 2bd1f50b5..0982382c7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/messages.properties
@@ -53,7 +53,10 @@ TaskListView_Repository=Repository
TaskListView_Summary=Summary
TaskListView_Task_List=Task List
+TaskScheduleContentProvider_Completed=Completed
TaskScheduleContentProvider_Future=Future
+TaskScheduleContentProvider_Incoming=Incoming
+TaskScheduleContentProvider_Outgoing=Outgoing
TaskScheduleContentProvider_Two_Weeks=Two Weeks
TaskScheduleContentProvider_Unscheduled=Unscheduled

Back to the top