diff options
author | mkersten | 2010-06-08 19:18:08 +0000 |
---|---|---|
committer | mkersten | 2010-06-08 19:18:08 +0000 |
commit | 92c3e14e1b36e450cd3b44d4894e8b6872494e81 (patch) | |
tree | a3fb8964dbc34723b0a0028f2aa23c1b1dadf38f | |
parent | 9f1f53d0d2295b4bca5f55b37f423673c1e6fd1a (diff) | |
download | org.eclipse.mylyn.tasks-92c3e14e1b36e450cd3b44d4894e8b6872494e81.tar.gz org.eclipse.mylyn.tasks-92c3e14e1b36e450cd3b44d4894e8b6872494e81.tar.xz org.eclipse.mylyn.tasks-92c3e14e1b36e450cd3b44d4894e8b6872494e81.zip |
RESOLVED - bug 316166: provide a colour setting for tasks that are overdue but not owned by the user
https://bugs.eclipse.org/bugs/show_bug.cgi?id=316166
4 files changed, 29 insertions, 3 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 9ad6bfcc8..cc9fa245b 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 @@ -660,11 +660,22 @@ public class TaskActivityManager implements ITaskActivityManager { return false; } + /** + * Tests if the task is owned by the current user and overdue. + */ public boolean isOverdue(ITask task) { return (!task.isCompleted() && task.getDueDate() != null && new Date().after(task.getDueDate())) && repositoryManager.isOwnedByUser(task); } + /** + * Tests whether the task is owned by another user and overdue. + */ + public boolean isOverdueForOther(ITask task) { + return (!task.isCompleted() && task.getDueDate() != null && new Date().after(task.getDueDate())) + && !repositoryManager.isOwnedByUser(task); + } + public boolean isOwnedByUser(ITask task) { return repositoryManager.isOwnedByUser(task); } diff --git a/org.eclipse.mylyn.tasks.ui/plugin.properties b/org.eclipse.mylyn.tasks.ui/plugin.properties index 92442838e..82af0a0fd 100644 --- a/org.eclipse.mylyn.tasks.ui/plugin.properties +++ b/org.eclipse.mylyn.tasks.ui/plugin.properties @@ -100,7 +100,8 @@ colors.foreground.today.scheduled.label = Tasks - Scheduled for Today colors.foreground.today.scheduled.description = Text color for tasks scheduled for today. colors.foreground.past.scheduled.label = Tasks - Past Scheduled Date colors.foreground.past.scheduled.description = Text color for tasks past their scheduled date. -colors.foreground.past.due.label = Tasks - Past Due Date +colors.foreground.past.due.label = Tasks - Past Due for Me +colors.foreground.overdue.for.other = Tasks - Past Due for Others colors.foreground.past.due.description = Text color tasks past their due date. colors.foreground.thisweek.scheduled.label = Tasks - Scheduled for This Week colors.foreground.thisweek.scheduled.description = Text color for tasks scheduled for this week diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml index 7dc006183..87d8ce7b3 100644 --- a/org.eclipse.mylyn.tasks.ui/plugin.xml +++ b/org.eclipse.mylyn.tasks.ui/plugin.xml @@ -658,6 +658,17 @@ <colorDefinition categoryId="org.eclipse.mylyn.tasks.ui.presentation" + id="org.eclipse.mylyn.tasks.ui.colors.foreground.overdue.for.other" + isEditable="true" + label="%colors.foreground.overdue.for.other.label" + value="128,0,0"> + <description> + %colors.foreground.past.scheduled.description + </description> + </colorDefinition> + + <colorDefinition + categoryId="org.eclipse.mylyn.tasks.ui.presentation" id="org.eclipse.mylyn.tasks.ui.colors.foreground.past.scheduled" isEditable="true" label="%colors.foreground.past.scheduled.label" diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java index 743edcb75..1bf3628ac 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskElementLabelProvider.java @@ -195,6 +195,8 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro } else if (task.getScheduledForDate() != null && TasksUiPlugin.getTaskActivityManager().isPastReminder(task)) { return themeManager.getCurrentTheme().getColorRegistry().get(CommonThemes.COLOR_SCHEDULED_PAST); + } else if (TasksUiPlugin.getTaskActivityManager().isOverdueForOther(task)) { + return themeManager.getCurrentTheme().getColorRegistry().get(CommonThemes.COLOR_SCHEDULED_TODAY); } else if (TasksUiPlugin.getTaskActivityManager().isScheduledForToday(task)) { return themeManager.getCurrentTheme().getColorRegistry().get(CommonThemes.COLOR_SCHEDULED_TODAY); } else if (TasksUiPlugin.getTaskActivityManager().isScheduledForThisWeek(task)) { @@ -250,8 +252,9 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro return CommonFonts.BOLD; } else if (((AbstractTask) element).isCompleted()) { if (CommonFonts.HAS_STRIKETHROUGH - && TasksUiPlugin.getDefault().getPluginPreferences().getBoolean( - ITasksUiPreferenceConstants.USE_STRIKETHROUGH_FOR_COMPLETED)) { + && TasksUiPlugin.getDefault() + .getPluginPreferences() + .getBoolean(ITasksUiPreferenceConstants.USE_STRIKETHROUGH_FOR_COMPLETED)) { return CommonFonts.STRIKETHROUGH; } else { return null; |