Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2009-05-06 16:18:27 +0000
committerrelves2009-05-06 16:18:27 +0000
commit5ef851a7058ad0a46ededc79af8d3c8e30bcbe4e (patch)
tree8190d014d45afd75998a4ed3900c679835f236c3
parent98aba547fe65b4169203581abcaee05f1c7ab1e0 (diff)
downloadorg.eclipse.mylyn.tasks-5ef851a7058ad0a46ededc79af8d3c8e30bcbe4e.tar.gz
org.eclipse.mylyn.tasks-5ef851a7058ad0a46ededc79af8d3c8e30bcbe4e.tar.xz
org.eclipse.mylyn.tasks-5ef851a7058ad0a46ededc79af8d3c8e30bcbe4e.zip
NEW - bug 269407: [api] implement TaskDataModel.getChangedOldAttributes()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=269407
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
index bee5b86a0..df6582729 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskDataModel.java
@@ -100,8 +100,20 @@ public class TaskDataModel {
}
public Set<TaskAttribute> getChangedOldAttributes() {
- // FIXME implement
- return null;
+ Set<TaskAttribute> oldAttributes = new HashSet<TaskAttribute>();
+ Set<TaskAttribute> newChangedAttributes = new HashSet<TaskAttribute>();
+ newChangedAttributes.addAll(workingCopy.getEditsData().getRoot().getAttributes().values());
+ newChangedAttributes.addAll(unsavedChangedAttributes);
+ TaskData repositoryReadData = workingCopy.getRepositoryData();
+ if (repositoryReadData != null) {
+ for (TaskAttribute taskAttribute : newChangedAttributes) {
+ TaskAttribute attOld = repositoryReadData.getRoot().getAttribute(taskAttribute.getId());
+ if (attOld != null) {
+ oldAttributes.add(attOld);
+ }
+ }
+ }
+ return oldAttributes;
}
public ITask getTask() {

Back to the top