Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-07-13 16:39:33 -0400
committerrelves2010-07-13 16:39:33 -0400
commita11e82f639f890c690203bfc33e08f9616ac3220 (patch)
tree3a6d58519659a6701b854c9688d06def03ec32d2
parent4a65316f0d6d18a03be6e0af5c865eb26a406261 (diff)
downloadorg.eclipse.mylyn.tasks-a11e82f639f890c690203bfc33e08f9616ac3220.tar.gz
org.eclipse.mylyn.tasks-a11e82f639f890c690203bfc33e08f9616ac3220.tar.xz
org.eclipse.mylyn.tasks-a11e82f639f890c690203bfc33e08f9616ac3220.zip
REOPENED - bug 306065: "Unscheduled" in Scheduled Task Presentation shows date 7010
https://bugs.eclipse.org/bugs/show_bug.cgi?id=306065
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java27
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java18
2 files changed, 22 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
index 60662bd1f..9df34a853 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
@@ -43,14 +43,15 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff;
import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier;
import org.eclipse.mylyn.internal.tasks.ui.util.PlatformUtil;
+import org.eclipse.mylyn.internal.tasks.ui.views.TaskScheduleContentProvider.StateTaskContainer;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.ITaskContainer;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -160,10 +161,12 @@ public class TaskListToolTip extends GradientToolTip {
if (element instanceof ScheduledTaskContainer) {
StringBuilder sb = new StringBuilder();
sb.append(element.getSummary());
- Calendar start = ((ScheduledTaskContainer) element).getDateRange().getStartDate();
- sb.append(" ["); //$NON-NLS-1$
- sb.append(DateFormat.getDateInstance(DateFormat.LONG).format(start.getTime()));
- sb.append("]"); //$NON-NLS-1$
+ if (!(element instanceof StateTaskContainer)) {
+ Calendar start = ((ScheduledTaskContainer) element).getDateRange().getStartDate();
+ sb.append(" ["); //$NON-NLS-1$
+ sb.append(DateFormat.getDateInstance(DateFormat.LONG).format(start.getTime()));
+ sb.append("]"); //$NON-NLS-1$
+ }
return sb.toString();
} else if (element instanceof IRepositoryQuery) {
IRepositoryQuery query = (IRepositoryQuery) element;
@@ -268,10 +271,11 @@ public class TaskListToolTip extends GradientToolTip {
Date dueDate = task.getDueDate();
if (dueDate != null) {
- sb.append(NLS.bind(Messages.TaskListToolTip_Due, new Object[] {
- new SimpleDateFormat("E").format(dueDate), //$NON-NLS-1$
- DateFormat.getDateInstance(DateFormat.LONG).format(dueDate),
- DateFormat.getTimeInstance(DateFormat.SHORT).format(dueDate) }));
+ sb.append(NLS.bind(Messages.TaskListToolTip_Due,
+ new Object[] {
+ new SimpleDateFormat("E").format(dueDate), //$NON-NLS-1$
+ DateFormat.getDateInstance(DateFormat.LONG).format(dueDate),
+ DateFormat.getTimeInstance(DateFormat.SHORT).format(dueDate) }));
sb.append("\n"); //$NON-NLS-1$
}
@@ -546,8 +550,9 @@ public class TaskListToolTip extends GradientToolTip {
if (taskListView != null) {
if (!taskListView.isFocusedMode()
- && TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
- ITasksUiPreferenceConstants.FILTER_COMPLETE_MODE)) {
+ && TasksUiPlugin.getDefault()
+ .getPreferenceStore()
+ .getBoolean(ITasksUiPreferenceConstants.FILTER_COMPLETE_MODE)) {
Object[] children = ((TaskListContentProvider) taskListView.getViewer().getContentProvider()).getChildren(element);
boolean hasIncoming = false;
for (Object child : children) {
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 c484fb40c..b1ad83c10 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
@@ -31,9 +31,9 @@ import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.internal.tasks.core.WeekDateRange;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
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;
/**
@@ -234,7 +234,7 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
}
- private abstract class StateTaskContainer extends ScheduledTaskContainer {
+ public abstract class StateTaskContainer extends ScheduledTaskContainer {
Calendar temp = TaskActivityUtil.getCalendar();
@@ -328,21 +328,15 @@ public class TaskScheduleContentProvider extends TaskListContentProvider impleme
}
}
- public class Completed extends ScheduledTaskContainer {
+ public class Completed extends StateTaskContainer {
public Completed() {
- super(taskActivityManager, new DateRange(COMPLETED_TIME), Messages.TaskScheduleContentProvider_Completed);
+ super(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 children;
+ public boolean select(ITask task) {
+ return (task.isCompleted() && task.getSynchronizationState().equals(SynchronizationState.SYNCHRONIZED));
}
}

Back to the top