summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLily Guo2013-06-14 12:57:58 (EDT)
committerGerrit Code Review @ Eclipse.org2013-06-27 19:59:19 (EDT)
commitf9bd82cef09919ab772b6d96377bced1e8ffb1ae (patch)
tree123f0aa0c72f66d7cb5f4b791dc3c9650e17601e
parentb36528c1c41a7b24936004d0e29c823f1068187c (diff)
downloadorg.eclipse.mylyn.tasks-f9bd82cef09919ab772b6d96377bced1e8ffb1ae.zip
org.eclipse.mylyn.tasks-f9bd82cef09919ab772b6d96377bced1e8ffb1ae.tar.gz
org.eclipse.mylyn.tasks-f9bd82cef09919ab772b6d96377bced1e8ffb1ae.tar.bz2
359629: Display last commented date at top of task editorrefs/changes/22/13822/8
Change-Id: Ia49233707a55199fb897c2933efdef23fa1167e4 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=359629
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java27
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java12
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java6
5 files changed, 48 insertions, 0 deletions
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
new file mode 100644
index 0000000..dfbce63
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LastCommentedAttributeEditor.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.editors;
+
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
+
+public class LastCommentedAttributeEditor extends DateAttributeEditor {
+
+ public LastCommentedAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
+ super(manager, taskAttribute);
+ }
+
+ @Override
+ public String getLabel() {
+ return Messages.LastCommentedAttributeEditor_dateLastCommented;
+ }
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
index 7998105..a05cb62 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
@@ -55,6 +55,8 @@ public class Messages extends NLS {
public static String CheckboxMultiSelectAttributeEditor_Select_X;
+ public static String LastCommentedAttributeEditor_dateLastCommented;
+
public static String CommentGroupStrategy_Current;
public static String CommentGroupStrategy_Older;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
index cabc510..2383408 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorSummaryPart.java
@@ -12,6 +12,8 @@
package org.eclipse.mylyn.internal.tasks.ui.editors;
+import java.util.List;
+
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.mylyn.commons.ui.CommonImages;
@@ -238,6 +240,16 @@ public class TaskEditorSummaryPart extends AbstractTaskEditorPart {
TaskAttribute dateModified = getTaskData().getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
addAttribute(headerComposite, toolkit, dateModified, EditorUtil.HEADER_COLUMN_MARGIN, true, false, true);
+
+ List<TaskAttribute> commentAttributes = getTaskData().getAttributeMapper().getAttributesByType(getTaskData(),
+ TaskAttribute.TYPE_COMMENT);
+ if (!commentAttributes.isEmpty()) {
+ TaskAttribute lastComment = commentAttributes.get(commentAttributes.size() - 1);
+ if (lastComment.getMappedAttribute(TaskAttribute.COMMENT_DATE) != null) {
+ addAttribute(headerComposite, toolkit, lastComment.getMappedAttribute(TaskAttribute.COMMENT_DATE),
+ EditorUtil.HEADER_COLUMN_MARGIN, true, true, true);
+ }
+ }
}
public boolean needsHeader() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
index 0a7b7fc..62f6488 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
@@ -27,6 +27,7 @@ BrowserPreviewViewer_The_repository_does_not_support_HTML_preview=The repository
CheckboxMultiSelectAttributeEditor_Select_X=Select {0}
+LastCommentedAttributeEditor_dateLastCommented=Last commented:
CommentGroupStrategy_Current=Current
CommentGroupStrategy_Older=Older
CommentGroupStrategy_Recent=Recent
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
index 88eebb9..88e4b83 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.mylyn.tasks.ui.editors;
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.internal.tasks.ui.editors.BooleanAttributeEditor;
+import org.eclipse.mylyn.internal.tasks.ui.editors.LastCommentedAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.DateAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.DoubleAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.LongTextAttributeEditor;
@@ -83,6 +84,11 @@ public class AttributeEditorFactory {
} else if (TaskAttribute.TYPE_DATE.equals(type)) {
return new DateAttributeEditor(model, taskAttribute);
} else if (TaskAttribute.TYPE_DATETIME.equals(type)) {
+ if (taskAttribute.getParentAttribute() != null
+ && taskAttribute.getParentAttribute().getMetaData().getType().equals(TaskAttribute.TYPE_COMMENT)) {
+ LastCommentedAttributeEditor editor = new LastCommentedAttributeEditor(model, taskAttribute);
+ return editor;
+ }
DateAttributeEditor editor = new DateAttributeEditor(model, taskAttribute);
editor.setShowTime(true);
return editor;