### Eclipse Workspace Patch 1.0 #P org.eclipse.mylyn.tasks.tests Index: src/org/eclipse/mylyn/tasks/tests/ScheduledPresentationTest.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ScheduledPresentationTest.java,v retrieving revision 1.21 diff -u -r1.21 ScheduledPresentationTest.java --- src/org/eclipse/mylyn/tasks/tests/ScheduledPresentationTest.java 12 Sep 2008 04:20:34 -0000 1.21 +++ src/org/eclipse/mylyn/tasks/tests/ScheduledPresentationTest.java 19 Sep 2008 21:07:27 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -46,15 +46,16 @@ } public void testWeekStartChange() { + TaskListInterestFilter filter = new TaskListInterestFilter(); TasksUiPlugin.getTaskActivityManager().setWeekStartDay(Calendar.MONDAY); DateRange lastDay = TaskActivityUtil.getCurrentWeek().getDayOfWeek(Calendar.SUNDAY); AbstractTask task1 = new LocalTask("task 1", "Task 1"); TasksUiPlugin.getTaskList().addTask(task1); TasksUiPlugin.getTaskActivityManager().setScheduledFor(task1, lastDay); - assertTrue(TaskListInterestFilter.isInterestingForThisWeek(null, task1)); + assertTrue(filter.isInterestingForThisWeek(null, task1)); TasksUiPlugin.getTaskActivityManager().setWeekStartDay(Calendar.SUNDAY); - assertFalse(TaskListInterestFilter.isInterestingForThisWeek(null, task1)); + assertFalse(filter.isInterestingForThisWeek(null, task1)); } #P org.eclipse.mylyn.tasks.ui Index: src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java,v retrieving revision 1.36 diff -u -r1.36 TaskScheduleContentProvider.java --- src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java 12 Sep 2008 04:19:26 -0000 1.36 +++ src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java 19 Sep 2008 21:07:27 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -65,6 +65,7 @@ Set containers = new HashSet(); WeekDateRange week = TaskActivityUtil.getCurrentWeek(); + WeekDateRange nextWeek = TaskActivityUtil.getNextWeek(); timer.cancel(); timer = new Timer(); @@ -75,7 +76,11 @@ } containers.add(new ScheduledTaskContainer(TasksUiPlugin.getTaskActivityManager(), week)); - ScheduledTaskContainer nextWeekContainer = new ScheduledTaskContainer(taskActivityManager, week.next()); + for (DateRange day : nextWeek.getDaysOfWeek()) { + containers.add(new ScheduledTaskContainer(TasksUiPlugin.getTaskActivityManager(), day)); + } + + ScheduledTaskContainer nextWeekContainer = new ScheduledTaskContainer(taskActivityManager, nextWeek); containers.add(nextWeekContainer); ScheduledTaskContainer twoWeeksContainer = new ScheduledTaskContainer(taskActivityManager, week.next() Index: src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java,v retrieving revision 1.8 diff -u -r1.8 TaskListInterestFilter.java --- src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java 12 Sep 2008 04:19:26 -0000 1.8 +++ src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java 19 Sep 2008 21:07:27 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -23,6 +23,7 @@ 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.Unscheduled; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITaskContainer; @@ -120,26 +121,37 @@ return false; } - private static boolean shouldShowInFocusedWorkweekDateContainer(Object parent, ITask task) { + private boolean shouldShowInFocusedWorkweekDateContainer(Object parent, ITask task) { if (parent instanceof ScheduledTaskContainer) { + ScheduledTaskContainer container = (ScheduledTaskContainer) parent; - if (container.isWeekDay() || container.isPresent()) { - return true; + + if (container instanceof Unscheduled) { + return false; } -// if (!TasksUiPlugin.getTaskActivityManager().isWeekDay((ScheduledTaskContainer) parent)) { -// return false; -// } - if (TasksUiPlugin.getTaskActivityManager().isOverdue(task) - || TasksUiPlugin.getTaskActivityManager().isPastReminder((AbstractTask) task)) { + + if (isDateRangeInteresting(container)) { 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; +// } + } return false; } - public static boolean isInterestingForThisWeek(Object parent, AbstractTask task) { + public boolean isInterestingForThisWeek(Object parent, AbstractTask task) { if (parent instanceof ScheduledTaskContainer) { return shouldShowInFocusedWorkweekDateContainer(parent, task); } else { @@ -151,7 +163,7 @@ } } - public static boolean hasChanges(Object parent, ITask task) { + public boolean hasChanges(Object parent, ITask task) { if (parent instanceof ScheduledTaskContainer && !(parent instanceof TaskScheduleContentProvider.Unscheduled)) { if (!shouldShowInFocusedWorkweekDateContainer(parent, task)) { return false; @@ -160,7 +172,7 @@ return hasChangesHelper(parent, task); } - private static boolean hasChangesHelper(Object parent, ITask task) { + private boolean hasChangesHelper(Object parent, ITask task) { if (task.getSynchronizationState().isOutgoing()) { return true; } else if (task.getSynchronizationState().isIncoming()) { Index: src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java,v retrieving revision 1.87 diff -u -r1.87 TaskListDropAdapter.java --- src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java 14 Sep 2008 02:20:53 -0000 1.87 +++ src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java 19 Sep 2008 21:07:27 -0000 @@ -41,6 +41,7 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; import org.eclipse.mylyn.internal.tasks.ui.actions.QueryImportAction; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; +import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.Unscheduled; import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITaskContainer; @@ -209,8 +210,12 @@ } } else if (currentTarget instanceof ScheduledTaskContainer) { ScheduledTaskContainer container = (ScheduledTaskContainer) currentTarget; - TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, - container.getDateRange()); + if (container instanceof Unscheduled) { + TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, null); + } else { + TasksUiPlugin.getTaskActivityManager().setScheduledFor((AbstractTask) task, + container.getDateRange()); + } } else if (currentTarget == null) { TasksUiInternal.getTaskList().addTask(newTask, TasksUiPlugin.getTaskList().getDefaultCategory()); } #P org.eclipse.mylyn.tasks.core Index: src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java,v retrieving revision 1.68 diff -u -r1.68 TaskActivityManager.java --- src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java 12 Sep 2008 04:21:35 -0000 1.68 +++ src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java 19 Sep 2008 21:07:28 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -328,7 +328,7 @@ Set result = scheduledTasks.get(range); if (result != null && !result.isEmpty()) { resultingTasks.addAll(result); - } else { + } else if (!range.isWeek()) { return getScheduledTasks(range.getStartDate(), range.getEndDate()); } } Index: src/org/eclipse/mylyn/internal/tasks/core/DateRange.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DateRange.java,v retrieving revision 1.11 diff -u -r1.11 DateRange.java --- src/org/eclipse/mylyn/internal/tasks/core/DateRange.java 12 Sep 2008 04:21:35 -0000 1.11 +++ src/org/eclipse/mylyn/internal/tasks/core/DateRange.java 19 Sep 2008 21:07:28 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -26,9 +26,9 @@ private static final String DESCRIPTION_PREVIOUS_WEEK = "Previous Week"; - private static final String DESCRIPTION_THIS_WEEK = "This Week"; + private static final String DESCRIPTION_THIS_WEEK = "Someday This Week"; - private static final String DESCRIPTION_NEXT_WEEK = "Next Week"; + private static final String DESCRIPTION_NEXT_WEEK = "Someday Next Week"; private static final String DESCRIPTION_WEEK_AFTER_NEXT = "Two Weeks"; @@ -74,11 +74,15 @@ */ @Override public String toString() { + return toString(true); + } + + public String toString(boolean useDayOfWeekForNextWeek) { boolean isThisWeek = TaskActivityUtil.getCurrentWeek().includes(this); Calendar endNextWeek = TaskActivityUtil.getCalendar(); endNextWeek.add(Calendar.DAY_OF_YEAR, 7); boolean isNextWeek = TaskActivityUtil.getNextWeek().includes(this) && this.before(endNextWeek); - if (isDay() && (isThisWeek || isNextWeek)) { + if (isDay() && (isThisWeek || (useDayOfWeekForNextWeek && isNextWeek))) { String day = ""; switch (getStartDate().get(Calendar.DAY_OF_WEEK)) { case Calendar.MONDAY: Index: src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java,v retrieving revision 1.31 diff -u -r1.31 ScheduledTaskContainer.java --- src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java 12 Sep 2008 04:21:35 -0000 1.31 +++ src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java 19 Sep 2008 21:07:28 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2008 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 @@ -32,11 +32,11 @@ private final DateRange range; public ScheduledTaskContainer(TaskActivityManager activityManager, DateRange range, String summary) { - super(summary == null ? range.toString() : summary); + super(summary == null ? range.toString(false) : summary); this.activityManager = activityManager; this.range = range; if (summary == null) { - this.summary = range.toString(); + this.summary = range.toString(false); } else { this.summary = summary; }