Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2016-05-18 19:30:32 -0400
committerJaxsun McCarthy Huggan2016-06-06 16:47:16 -0400
commit3cd4d20e2e5b283573126634fcabd45719e611f2 (patch)
tree5904b86eed45e66dc4aa441901ef8f7026378ba8 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal
parent923d661b26e60c4b72261df798a9632e2c5e0e78 (diff)
downloadorg.eclipse.mylyn.tasks-3cd4d20e2e5b283573126634fcabd45719e611f2.tar.gz
org.eclipse.mylyn.tasks-3cd4d20e2e5b283573126634fcabd45719e611f2.tar.xz
org.eclipse.mylyn.tasks-3cd4d20e2e5b283573126634fcabd45719e611f2.zip
319889: Improve labelling of containers in scheduled presentation
* Incoming/Outgoing/Unscheduled/Completed no longer display a date 5000 years in the future when hovering. * Future container no longer displays two of the same date in different formats when hovering Change-Id: I3a80b17dbeb09035317494c965a4c974f23cb406 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=319889 Signed-off-by: Jaxsun McCarthy Huggan <jaxsun.mccarthy@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java88
1 files changed, 12 insertions, 76 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
index c26657990..1cbbd10ed 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java
@@ -36,6 +36,14 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
private String shortSummary;
+ public ScheduledTaskContainer(TaskActivityManager activityManager, DateRange range, String summary,
+ String shortSummary) {
+ this(activityManager, range, summary);
+ if (shortSummary != null) {
+ this.shortSummary = shortSummary;
+ }
+ }
+
public ScheduledTaskContainer(TaskActivityManager activityManager, DateRange range, String summary) {
super(summary == null ? range.toString(false) : summary);
this.activityManager = activityManager;
@@ -44,9 +52,6 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
if (range instanceof DayDateRange && TaskActivityUtil.getNextWeek().includes(range)) {
DayDateRange dayRange = (DayDateRange) range;
String day = NLS.bind(Messages.ScheduledTaskContainer_Next_Day, dayRange.getDayOfWeek());
-// String shortDate = DateFormat.getDateInstance(DateFormat.SHORT).format(
-// dayRange.getStartDate().getTime());
-// this.summary = NLS.bind(Messages.ScheduledTaskContainer_Dash_Pattern, day, shortDate);
this.summary = day;
this.shortSummary = day;
} else {
@@ -70,70 +75,6 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
return range.getStartDate().before(Calendar.getInstance()) && range.getEndDate().after(Calendar.getInstance());
}
-// public boolean isWeekDay() {
-// return TaskActivityUtil.getCurrentWeek().isCurrentWeekDay(range);
-// }
-
-// public boolean isToday() {
-// if (range instanceof DayDateRange) {
-// return ((DayDateRange) range).isToday();
-// }
-// return false;
-// }
-
-// public Collection<ITask> getChildren() {
-// Set<ITask> children = new HashSet<ITask>();
-// Calendar beginning = TaskActivityUtil.getCalendar();
-// beginning.setTimeInMillis(0);
-// if (isFloating() && !isFuture()) {
-// for (ITask task : activityManager.getScheduledTasks(rangebeginning, getEndDate())) {
-// if (task.internalIsFloatingScheduledDate()) {
-// children.add(task);
-// }
-// }
-// } else if (isPresent()) {
-// // add all due/overdue
-// Calendar end = TaskActivityUtil.getCalendar();
-// end.set(5000, 12, 1);
-// for (ITask task : activityManager.getDueTasks(beginning, getEndDate())) {
-// if (activityManager.isOwnedByUser(task)) {
-// children.add(task);
-// }
-// }
-//
-// // add all scheduled/overscheduled
-// for (ITask task : activityManager.getScheduledTasks(beginning, getEndDate())) {
-// if (!task.internalIsFloatingScheduledDate() && !task.isCompleted()) {
-// children.add(task);
-// }
-// }
-//
-// // if not scheduled or due in future, and is active, place in today bin
-// ITask activeTask = activityManager.getActiveTask();
-// if (activeTask != null && !children.contains(activeTask)) {
-// Set<ITask> futureScheduled = activityManager.getScheduledTasks(getStartDate(), end);
-// for (ITask task : activityManager.getDueTasks(getStartDate(), end)) {
-// if (activityManager.isOwnedByUser(task)) {
-// futureScheduled.add(task);
-// }
-// }
-// if (!futureScheduled.contains(activeTask)) {
-// children.add(activeTask);
-// }
-// }
-// } else if (isFuture()) {
-// children.addAll(activityManager.getScheduledTasks(getStartDate(), getEndDate()));
-// for (ITask task : activityManager.getDueTasks(getStartDate(), getEndDate())) {
-// if (activityManager.isOwnedByUser(task)) {
-// children.add(task);
-// }
-// }
-// } else {
-// children.addAll(activityManager.getActiveTasks(range.getStartDate(), range.getEndDate()));
-// }
-// return children;
-// }
-
@Override
public Collection<ITask> getChildren() {
// TODO: Cache this information until the next modification to pertinent data
@@ -158,15 +99,15 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
// All tasks scheduled for this date range
Set<ITask> tasks = activityManager.getScheduledTasks(start, end);
if (range instanceof WeekDateRange) {
- // remove tasks not scheduled for the week container itself, except for 2 weeks, in which case only remove
+ // remove tasks not scheduled for the week container itself, except for 2 weeks, in which case only remove
// if they will show under future
for (Iterator<ITask> iterator = tasks.iterator(); iterator.hasNext();) {
ITask task = iterator.next();
if (task instanceof AbstractTask) {
DateRange scheduledDate = ((AbstractTask) task).getScheduledForDate();
if (!(scheduledDate instanceof WeekDateRange)
- && (TaskActivityUtil.getNextWeek().next().compareTo(range) != 0 || scheduledDate.getEndDate()
- .after(end))) {
+ && (TaskActivityUtil.getNextWeek().next().compareTo(range) != 0
+ || scheduledDate.getEndDate().after(end))) {
iterator.remove();
}
}
@@ -199,7 +140,7 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
// Add due tasks if not the This Week container, and not scheduled for earlier date
if (!TaskActivityUtil.getCurrentWeek().equals(range) && !TaskActivityUtil.getNextWeek().equals(range)) {
- // tasks are due at the start of a day, so only search in the range of times that correspond to
+ // tasks are due at the start of a day, so only search in the range of times that correspond to
// the start of the day in some time zone
Calendar endDueSearch = Calendar.getInstance();
endDueSearch.setTimeInMillis(range.getStartDate().getTimeInMillis());
@@ -256,7 +197,6 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
}
private boolean isThisWeekBin() {
-
return range instanceof WeekDateRange && ((WeekDateRange) range).isThisWeek();
}
@@ -283,10 +223,6 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
}
private void addChild(Set<ITask> collection, ITask task) {
-// if (task.getSynchronizationState().isOutgoing()) {
-// return;
-// }
-
collection.add(task);
}

Back to the top