Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-02-17 23:14:12 +0000
committerspingel2011-02-17 23:14:12 +0000
commitb29671e2bc8d61302fbace5675d7cf69a1e42587 (patch)
treed4463f62f8d7c5418519b324f85c84a84372456f /org.eclipse.mylyn.tasks.core
parent311273cf0ce2d50fc5609d38f7fbe429dc206a90 (diff)
downloadorg.eclipse.mylyn.tasks-b29671e2bc8d61302fbace5675d7cf69a1e42587.tar.gz
org.eclipse.mylyn.tasks-b29671e2bc8d61302fbace5675d7cf69a1e42587.tar.xz
org.eclipse.mylyn.tasks-b29671e2bc8d61302fbace5675d7cf69a1e42587.zip
REOPENED - bug 334445: date bins for next week should indicate the day of the week
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334445
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java20
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties3
3 files changed, 23 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
index 74edc8be5..69806866c 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
@@ -61,7 +61,9 @@ public class Messages extends NLS {
public static String PriorityLevel_Very_Low;
- public static String ScheduledTaskContainer_Date_Day_Pattern;
+ public static String ScheduledTaskContainer_Dash_Pattern;
+
+ public static String ScheduledTaskContainer_Next_Day;
public static String TaskJobFactory_Refreshing_repository_configuration;
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 7634c1597..cbbf16870 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
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.internal.tasks.core;
+import java.text.DateFormat;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashSet;
@@ -23,6 +24,7 @@ import org.eclipse.osgi.util.NLS;
/**
* @author Rob Elves
* @author Mik Kersten
+ * @author Sam Davis
*/
public class ScheduledTaskContainer extends AbstractTaskContainer {
@@ -32,16 +34,23 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
private final DateRange range;
+ private String shortSummary;
+
public ScheduledTaskContainer(TaskActivityManager activityManager, DateRange range, String summary) {
super(summary == null ? range.toString(false) : summary);
this.activityManager = activityManager;
this.range = range;
if (summary == null) {
if (range instanceof DayDateRange && TaskActivityUtil.getNextWeek().includes(range)) {
- this.summary = NLS.bind(Messages.ScheduledTaskContainer_Date_Day_Pattern, range.toString(false),
- ((DayDateRange) range).getDayOfWeek());
+ 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.shortSummary = day;
} else {
this.summary = range.toString(false);
+ this.shortSummary = this.summary;
}
} else {
this.summary = summary;
@@ -249,6 +258,13 @@ public class ScheduledTaskContainer extends AbstractTaskContainer {
return range.toString();
}
+ public String getShortSummary() {
+ if (shortSummary != null) {
+ return shortSummary;
+ }
+ return range.toString();
+ }
+
@Override
public String getHandleIdentifier() {
return summary;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
index 23c715cab..d64e1e329 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
@@ -34,7 +34,8 @@ PriorityLevel_Low=Low
PriorityLevel_Normal=Normal
PriorityLevel_Very_High=Very High
PriorityLevel_Very_Low=Very Low
-ScheduledTaskContainer_Date_Day_Pattern={0} - {1}
+ScheduledTaskContainer_Dash_Pattern={0} - {1}
+ScheduledTaskContainer_Next_Day=Next {0}
TaskJobFactory_Refreshing_repository_configuration=Refreshing repository configuration
TaskJobFactory_Receiving_configuration=Receiving configuration

Back to the top