Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2git2008-02-04 21:35:24 +0000
committercvs2git2008-02-04 21:35:24 +0000
commitd7d1ec61d21fe850d14aa59f7d85f881a5f9a295 (patch)
tree9984ce690dd42f6f08240248206ede6289661fa4
parentcdd28163805c48680019e4bae0e1189b814b7529 (diff)
downloadorg.eclipse.mylyn.tasks-R_2_3_M1_prerefactoring.tar.gz
org.eclipse.mylyn.tasks-R_2_3_M1_prerefactoring.tar.xz
org.eclipse.mylyn.tasks-R_2_3_M1_prerefactoring.zip
This commit was manufactured by cvs2svn to create tagR_2_3_M1_prerefactoring
'R_2_3_M1_prerefactoring'. Sprout from master 2008-01-29 20:55:48 UTC relves 'NEW - bug 206566: improve the usability of scheduling and workweek focus and get rid of "red Mondays"' Cherrypick from master 2008-02-04 21:35:23 UTC relves 'NEW - bug 217733: update sorting of Task List to match the new scheduling facility': org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskActivityManager.java33
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java8
5 files changed, 46 insertions, 12 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java
index e81f8c1e6..d486c0c3c 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java
@@ -15,4 +15,6 @@ public interface ITasksCoreConstants {
public static final int MAX_SUBTASK_DEPTH = 10;
+ public static final String ID_PLUGIN = "org.eclipse.mylyn.tasks.core";
+
}
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 f03711b6b..4f82ffc54 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
@@ -22,6 +22,8 @@ import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.context.core.ContextCorePlugin;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.context.core.IInteractionContextListener;
@@ -209,7 +211,7 @@ public class TaskActivityManager {
return;
}
} catch (Throwable t) {
- StatusHandler.fail(t, "Error parsing interaction event", false);
+ StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Error parsing interaction event", t));
}
}
@@ -253,7 +255,7 @@ public class TaskActivityManager {
try {
listener.elapsedTimeUpdated(activatedTask, totalElapsed);
} catch (Throwable t) {
- StatusHandler.fail(t, "task activity listener failed: " + listener, false);
+ StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Task activity listener failed: \"" + listener + "\"", t));
}
}
}
@@ -522,18 +524,28 @@ public class TaskActivityManager {
}
- public boolean isOverScheduled(Date scheduledDate, boolean floating) {
- if (scheduledDate == null) {
+ public boolean isPastReminder(AbstractTask task) {
+ if (task == null || task.isCompleted() || task.getScheduledForDate() == null) {
+ return false;
+ } else {
+ return isPastReminder(task.getScheduledForDate(), task.isCompleted());
+ }
+ }
+
+ public boolean isPastReminder(Date date, boolean isComplete) {
+ if (date == null || isComplete) {
return false;
} else {
Date now = new Date();
- if (!floating && scheduledDate.compareTo(now) < 0) {
+ if (/*!internalIsFloatingScheduledDate() && */date.compareTo(now) < 0) {
return true;
} else {
return false;
}
}
}
+
+
public boolean isOverdue(AbstractTask task) {
return (!task.isCompleted() && task.getDueDate() != null && new Date().after(task.getDueDate()))
@@ -577,7 +589,7 @@ public class TaskActivityManager {
public boolean isScheduledAfterThisWeek(AbstractTask task) {
if (task.getScheduledForDate() != null) {
- return isScheduledForThisWeek(task.getScheduledForDate());
+ return isScheduledAfterThisWeek(task.getScheduledForDate());
}
return false;
@@ -864,5 +876,14 @@ public class TaskActivityManager {
public void removeTimingListener(ITaskTimingListener listener) {
timingListeners.remove(listener);
}
+
+ public boolean isFloatingThisWeek(AbstractTask singleTaskSelection) {
+ if(singleTaskSelection != null && singleTaskSelection.getScheduledForDate() != null) {
+ if(singleTaskSelection.internalIsFloatingScheduledDate() && isScheduledForThisWeek(singleTaskSelection.getScheduledForDate())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
index 3b31beb78..3b673604a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java
@@ -438,14 +438,14 @@ public abstract class AbstractTask extends AbstractTaskContainer {
}
/**
- * @API 3.0: deprecated use TaskActivityManager.isOverScheduled()
+ * @API-3.0: Deprecate. Use TaskActivityManager.isPastReminder(Abstract task)
*/
public boolean isPastReminder() {
if (isCompleted() || scheduledForDate == null) {
return false;
} else {
Date now = new Date();
- if (!internalIsFloatingScheduledDate() && scheduledForDate.compareTo(now) < 0) {
+ if (/*!internalIsFloatingScheduledDate() && */scheduledForDate.compareTo(now) < 0) {
return true;
} else {
return false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
index bf4c8ebb1..dcb0e15b8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java
@@ -92,9 +92,10 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
subMenuManager.add(action);
if (singleTaskSelection != null
- && (TasksUiPlugin.getTaskActivityManager().isScheduledForToday(getScheduledForDate(singleTaskSelection), isFloating(singleTaskSelection)) || (TasksUiPlugin.getTaskActivityManager().isOverScheduled(getScheduledForDate(singleTaskSelection), isFloating(singleTaskSelection))))) {
+ && (TasksUiPlugin.getTaskActivityManager().isScheduledForToday(getScheduledForDate(singleTaskSelection), isFloating(singleTaskSelection)) || (isPastReminder(singleTaskSelection) && !isFloating(singleTaskSelection)))) {
action.setChecked(true);
}
+
// subMenuManager.add(new Separator());
@@ -155,7 +156,7 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
subMenuManager.add(action);
if (singleTaskSelection != null && isFloating(singleTaskSelection)
- && TasksUiPlugin.getTaskActivityManager().isScheduledForThisWeek(getScheduledForDate(singleTaskSelection))) {
+ && (TasksUiPlugin.getTaskActivityManager().isScheduledForThisWeek(getScheduledForDate(singleTaskSelection)) || isPastReminder(singleTaskSelection))) {
action.setChecked(true);
}
@@ -358,4 +359,10 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor {
protected boolean isFloating(AbstractTask task) {
return task.internalIsFloatingScheduledDate();
}
+
+
+ private boolean isPastReminder(AbstractTask task) {
+ Date date = getScheduledForDate(task);
+ return TasksUiPlugin.getTaskActivityManager().isPastReminder(date, task.isCompleted());
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
index aea635a47..3b610d568 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
@@ -250,8 +250,12 @@ public class TaskPlanningEditor extends TaskFormPage {
task.setNotes(note);
task.setEstimatedTimeHours(estimated.getSelection());
if (scheduleDatePicker != null && scheduleDatePicker.getScheduledDate() != null) {
- TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, scheduleDatePicker.getScheduledDate(), scheduleDatePicker.isFloatingDate());
- task.setReminded(false);
+ if (task.getScheduledForDate() != null
+ && (!scheduleDatePicker.getScheduledDate().equals(task.getScheduledForDate()) || task.internalIsFloatingScheduledDate() != scheduleDatePicker.isFloatingDate())) {
+ TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, scheduleDatePicker.getScheduledDate(),
+ scheduleDatePicker.isFloatingDate());
+ task.setReminded(false);
+ }
} else {
TasksUiPlugin.getTaskActivityManager().setScheduledFor(task, null);
task.setReminded(false);

Back to the top