Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-07-17 10:18:06 -0400
committerGerrit Code Review @ Eclipse.org2013-07-31 14:15:55 -0400
commit0fe431cf30eb7ab09f6cc552d3c15c4d4f21c5be (patch)
treea4fdbbf33a4896406a12771342ab78a12a7bc8dc /org.eclipse.mylyn.tasks.ui
parent86fe06072030144cd314de8d824568ba0a920714 (diff)
downloadorg.eclipse.mylyn.tasks-0fe431cf30eb7ab09f6cc552d3c15c4d4f21c5be.tar.gz
org.eclipse.mylyn.tasks-0fe431cf30eb7ab09f6cc552d3c15c4d4f21c5be.tar.xz
org.eclipse.mylyn.tasks-0fe431cf30eb7ab09f6cc552d3c15c4d4f21c5be.zip
359629: Display last commented date at top of task editor
Change-Id: Ia04cf6a9e4e673591118e605b69b61f7326d02d3 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=359629
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java2
2 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
index 74f81899f..8620fa4bd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java
@@ -15,6 +15,7 @@ import java.util.Calendar;
import java.util.Date;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.commons.core.DateUtil;
import org.eclipse.mylyn.commons.workbench.forms.DatePicker;
import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -41,11 +42,14 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
private boolean showTime;
+ private boolean showDateRelative;
+
private Text text;
public DateAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.SINGLE));
+ setShowDateRelative(false);
}
@Override
@@ -122,6 +126,8 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
if (date != null) {
if (getShowTime()) {
return EditorUtil.formatDateTime(date);
+ } else if (getShowDateRelative()) {
+ return DateUtil.getRelative(date.getTime());
} else {
return EditorUtil.formatDate(date);
}
@@ -158,4 +164,12 @@ public class DateAttributeEditor extends AbstractAttributeEditor {
return true;
}
+ public boolean getShowDateRelative() {
+ return showDateRelative;
+ }
+
+ public void setShowDateRelative(boolean showDateRelative) {
+ this.showDateRelative = showDateRelative;
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
index dfbce639b..d08b49455 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
@@ -18,10 +18,12 @@ public class LastCommentedAttributeEditor extends DateAttributeEditor {
public LastCommentedAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
+ setShowDateRelative(true);
}
@Override
public String getLabel() {
return Messages.LastCommentedAttributeEditor_dateLastCommented;
}
+
}

Back to the top