diff options
author | relves | 2009-05-06 16:18:27 +0000 |
---|---|---|
committer | relves | 2009-05-06 16:18:27 +0000 |
commit | 5ef851a7058ad0a46ededc79af8d3c8e30bcbe4e (patch) | |
tree | 8190d014d45afd75998a4ed3900c679835f236c3 | |
parent | 98aba547fe65b4169203581abcaee05f1c7ab1e0 (diff) | |
download | org.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.java | 16 |
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() { |