Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-08-23 16:38:22 -0400
committersminto2005-08-23 16:38:22 -0400
commitdd8061c5b5ac5d636d93251d6e8aea9e2918ddfe (patch)
tree75c29c04a204094f1cea769385b78dd8cd17d75e
parent52b28cf93a96e670b5e658647a9b492a218d9e6b (diff)
downloadorg.eclipse.mylyn.tasks-dd8061c5b5ac5d636d93251d6e8aea9e2918ddfe.tar.gz
org.eclipse.mylyn.tasks-dd8061c5b5ac5d636d93251d6e8aea9e2918ddfe.tar.xz
org.eclipse.mylyn.tasks-dd8061c5b5ac5d636d93251d6e8aea9e2918ddfe.zip
fixed Bug #107596: XP / Agile support features
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/bugzilla/tests/BugzillaSearchPluginTest.java14
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java16
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListUiTest.java24
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java57
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java54
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListManager.java22
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskList.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/internal/TaskReportGenerator.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameEditorPart.java19
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameLabelProvider.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java21
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CreateTaskAction.java2
22 files changed, 238 insertions, 72 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
index 0d8cba1a1..6376023a1 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateBugzillaTaskAction.java
@@ -72,7 +72,7 @@ public class CreateBugzillaTaskAction extends Action implements IViewActionDeleg
// return;
// }
- ITask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>", true);
+ ITask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>", true, true);
Object selectedObject = ((IStructuredSelection)TaskListView.getDefault().getViewer().getSelection()).getFirstElement();
ITaskHandler taskHandler = MylarTasklistPlugin.getDefault().getTaskHandlerForElement(newTask);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
index 0ad51d112..f91ab4c50 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/CreateNewBugzillaTaskAction.java
@@ -77,7 +77,7 @@ public class CreateNewBugzillaTaskAction extends Action implements IViewActionDe
}
- BugzillaTask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>", true);
+ BugzillaTask newTask = new BugzillaTask("Bugzilla-"+bugId, "<bugzilla info>", true, true);
Object selectedObject = null;
if(TaskListView.getDefault() != null)
selectedObject = ((IStructuredSelection)TaskListView.getDefault().getViewer().getSelection()).getFirstElement();
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
index 6a2e13002..a1c7a0a2c 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
@@ -118,7 +118,7 @@ public class BugzillaHit implements ITaskListElement {
public ITask getOrCreateCorrespondingTask() {
if(task == null){
- task = new BugzillaTask(this);
+ task = new BugzillaTask(this, true);
BugzillaUiPlugin.getDefault().getBugzillaTaskListManager().addToBugzillaTaskRegistry(task);
}
return task;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
index de17283d0..95084e425 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
@@ -112,22 +112,22 @@ public class BugzillaTask extends Task {
}
};
- public BugzillaTask(String id, String label) {
- super(id, label);
+ public BugzillaTask(String id, String label, boolean newTask) {
+ super(id, label, newTask);
isDirty = false;
scheduleDownloadReport();
}
- public BugzillaTask(String id, String label, boolean noDownload) {
- super(id, label);
+ public BugzillaTask(String id, String label, boolean noDownload, boolean newTask) {
+ super(id, label, newTask);
isDirty = false;
if (!noDownload) {
scheduleDownloadReport();
}
}
- public BugzillaTask(BugzillaHit hit) {
- this(hit.getHandle(), hit.getDescription(false));
+ public BugzillaTask(BugzillaHit hit, boolean newTask) {
+ this(hit.getHandle(), hit.getDescription(false), newTask);
setPriority(hit.getPriority());
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java
index efbdd6e49..c3263ab37 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskExternalizer.java
@@ -154,7 +154,7 @@ public class BugzillaTaskExternalizer extends DefaultTaskListExternalizer {
} else {
throw new MylarExternalizerException("Description not stored for bug report");
}
- BugzillaTask task = new BugzillaTask(handle, label, true);
+ BugzillaTask task = new BugzillaTask(handle, label, true, false);
readTaskInfo(task, tlist, element, category, parent);
task.setState(BugTaskState.FREE);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
index 284ca3984..59aa9d77e 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskHandler.java
@@ -151,7 +151,7 @@ public class BugzillaTaskHandler implements ITaskHandler {
bh.getAssociatedTask().setCategory(cat);
cat.addTask(bh.getAssociatedTask());
} else {
- BugzillaTask bt = new BugzillaTask(bh);
+ BugzillaTask bt = new BugzillaTask(bh, true);
bh.setAssociatedTask(bt);
bt.setCategory(cat);
cat.addTask(bt);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/bugzilla/tests/BugzillaSearchPluginTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/bugzilla/tests/BugzillaSearchPluginTest.java
index 77c74b26f..6dc99c288 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/bugzilla/tests/BugzillaSearchPluginTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/bugzilla/tests/BugzillaSearchPluginTest.java
@@ -218,23 +218,23 @@ public class BugzillaSearchPluginTest extends TestCase{
TaskListManager manager = MylarTasklistPlugin.getTaskListManager();
TaskCategory cat = new TaskCategory("Testing Category");
manager.addCategory(cat);
- BugzillaTask bugTask1 = new BugzillaTask(bugPrefix +94185, "<bugzilla info>");
+ BugzillaTask bugTask1 = new BugzillaTask(bugPrefix +94185, "<bugzilla info>", true);
cat.addTask(bugTask1);
while(bugTask1.getState() != BugTaskState.FREE){
Thread.sleep(500);
}
- BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 3692, "<bugzilla info>");
+ BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 3692, "<bugzilla info>", true);
cat.addTask(bugTask2);
while(bugTask2.getState() != BugTaskState.FREE){
Thread.sleep(500);
}
- BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>");
+ BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>", true);
cat.addTask(bugTask3);
while(bugTask3.getState() != BugTaskState.FREE){
Thread.sleep(500);
}
- BugzillaTask bugTask4 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>");
+ BugzillaTask bugTask4 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>", true);
cat.addTask(bugTask4);
while(bugTask4.getState() != BugTaskState.FREE){
Thread.sleep(500);
@@ -281,18 +281,18 @@ public class BugzillaSearchPluginTest extends TestCase{
TaskListManager manager = MylarTasklistPlugin.getTaskListManager();
TaskCategory cat = new TaskCategory("Testing Category");
manager.addCategory(cat);
- BugzillaTask bugTask1 = new BugzillaTask(bugPrefix + 94185, "<bugzilla info>");
+ BugzillaTask bugTask1 = new BugzillaTask(bugPrefix + 94185, "<bugzilla info>", true);
cat.addTask(bugTask1);
while(bugTask1.getState() != BugTaskState.FREE){
Thread.sleep(500);
}
- BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>");
+ BugzillaTask bugTask2 = new BugzillaTask(bugPrefix + 9583, "<bugzilla info>", true);
cat.addTask(bugTask2);
while(bugTask2.getState() != BugTaskState.FREE){
Thread.sleep(500);
}
- BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>");
+ BugzillaTask bugTask3 = new BugzillaTask(bugPrefix + 3693, "<bugzilla info>", true);
cat.addTask(bugTask3);
while(bugTask3.getState() != BugTaskState.FREE){
Thread.sleep(500);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java
index c0de614a8..cf60c5a38 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java
@@ -37,29 +37,29 @@ public class TaskListManagerTest extends TestCase {
TaskListManager manager = new TaskListManager(file);
// TaskList tlist = manager.getTaskList();
- Task task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
+ Task task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1", true);
manager.addRootTask(task1);
- Task sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub 1");
+ Task sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub 1", true);
task1.addSubTask(sub1);
sub1.setParent(task1);
- Task task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2");
+ Task task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2", true);
manager.addRootTask(task2);
TaskCategory cat1 = new TaskCategory("Category 1");
manager.addCategory(cat1);
- Task task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3");
+ Task task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3", true);
cat1.addTask(task3);
- Task sub2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub 2");
+ Task sub2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub 2", true);
task3.addSubTask(sub2);
sub2.setParent(task3);
- Task task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4");
+ Task task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4", true);
cat1.addTask(task4);
TaskCategory cat2 = new TaskCategory("Category 2");
manager.addCategory(cat2);
- Task task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5");
+ Task task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5", true);
cat2.addTask(task5);
- Task task6 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 6");
+ Task task6 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 6", true);
cat2.addTask(task6);
BugzillaTask report = new BugzillaTask("123", "label 123", true);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListUiTest.java
index a54e48c9f..d60534f06 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListUiTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListUiTest.java
@@ -60,35 +60,35 @@ public class TaskListUiTest extends TestCase {
// tlist = manager.getTaskList();
cat1 = new TaskCategory("First Category");
- cat1task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
+ cat1task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1", true);
cat1task1.setPriority("P1");
cat1task1.setCompleted(true);
cat1task1.setCategory(cat1);
cat1.addTask(cat1task1);
- cat1task1sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub task 1");
+ cat1task1sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub task 1", true);
cat1task1sub1.setPriority("P1");
cat1task1sub1.setCompleted(true);
cat1task1sub1.setParent(cat1task1);
cat1task1.addSubTask(cat1task1sub1);
- cat1task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2");
+ cat1task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2", true);
cat1task2.setPriority("P2");
cat1task2.setCategory(cat1);
cat1.addTask(cat1task2);
- cat1task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3");
+ cat1task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3", true);
cat1task3.setPriority("P3");
cat1task3.setCompleted(true);
cat1task3.setCategory(cat1);
cat1.addTask(cat1task3);
- cat1task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4");
+ cat1task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4", true);
cat1task4.setPriority("P4");
cat1task4.setCategory(cat1);
cat1.addTask(cat1task4);
- cat1task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5");
+ cat1task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5", true);
cat1task5.setPriority("P5");
cat1task5.setCompleted(true);
cat1task5.setCategory(cat1);
@@ -99,34 +99,34 @@ public class TaskListUiTest extends TestCase {
cat2 = new TaskCategory("Second Category");
- cat2task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
+ cat2task1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 1", true);
cat2task1.setPriority("P1");
cat2task1.setCategory(cat2);
cat2.addTask(cat2task1);
- cat2task1sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub task 1");
+ cat2task1sub1 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "sub task 1", true);
cat2task1sub1.setPriority("P1");
cat2task1sub1.setParent(cat2task1);
cat2task1.addSubTask(cat2task1sub1);
- cat2task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2");
+ cat2task2 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 2", true);
cat2task2.setPriority("P2");
cat2task2.setCompleted(true);
cat2task2.setCategory(cat2);
cat2.addTask(cat2task2);
- cat2task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3");
+ cat2task3 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 3", true);
cat2task3.setPriority("P3");
cat2task3.setCategory(cat2);
cat2.addTask(cat2task3);
- cat2task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4");
+ cat2task4 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 4", true);
cat2task4.setPriority("P4");
cat2task4.setCompleted(true);
cat2task4.setCategory(cat2);
cat2.addTask(cat2task4);
- cat2task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5");
+ cat2task5 = new Task(MylarTasklistPlugin.getTaskListManager().genUniqueTaskId(), "task 5", true);
cat2task5.setPriority("P5");
cat2task5.setCategory(cat2);
cat2.addTask(cat2task5);
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
index 36dd69cc8..8914c50a3 100644
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.forms,
org.eclipse.jdt.ui,
org.eclipse.pde.ui,
- org.eclipse.mylar.core
+ org.eclipse.mylar.core,
+ org.eclipse.mylar.monitor
Eclipse-AutoStart: true
Bundle-Vendor: University of British Columbia
Bundle-ClassPath: mylar-tasklist.jar
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
index 5a29a92f7..699cffbfd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
@@ -44,7 +44,7 @@ public interface ITask extends Serializable, ITaskListElement {
public abstract boolean isActive();
- public abstract void setActive(boolean active);
+ public abstract void setActive(boolean active, boolean isStalled);
public abstract boolean isCompleted();
@@ -104,6 +104,14 @@ public interface ITask extends Serializable, ITaskListElement {
public abstract String getEndDateString();
+
+ public abstract Date getCreationDate();
+
+ public abstract void setCreationDate(String date);
+
+ public abstract String getCreationDateString();
+
+
public abstract void setReminderDate(Date date);
public abstract void setReminderDate(String date);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
index 220027d34..0319ff3c6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
@@ -62,6 +62,7 @@ public class Task implements ITask {
private Date timeActivated = null;
private Date endDate = null;
+ private Date creationDate = null;
private Date reminderDate=null;
private long elapsed;
/**
@@ -88,11 +89,14 @@ public class Task implements ITask {
this.path = path;
}
}
-
- public Task(String handle, String label) {
+
+ public Task(String handle, String label, boolean newTask) {
this.handle = handle;
this.label = label;
this.path = handle;
+ if(newTask){
+ creationDate = new Date();
+ }
}
public String getHandle() {
@@ -118,24 +122,27 @@ public class Task implements ITask {
public Object getAdapter(Class adapter) {
return null;
}
-
+
/**
* Package visible in order to prevent sets that don't update the index.
*/
- public void setActive(boolean active) {
+ public void setActive(boolean active, boolean isStalled) {
this.active = active;
- if (active) {
+ if (active && !isStalled) {
timeActivated = new Date();
} else {
- calculateElapsedTime();
+ calculateElapsedTime(isStalled);
timeActivated = null;
}
}
- private void calculateElapsedTime() {
+ private void calculateElapsedTime(boolean isStalled) {
if (timeActivated == null)
return;
elapsed += new Date().getTime() - timeActivated.getTime();
+ if(isStalled){
+ elapsed-=TaskListManager.INACTIVITY_TIME_MILLIS;
+ }
if (isActive()) {
timeActivated = new Date();
} else {
@@ -275,14 +282,14 @@ public class Task implements ITask {
public String getElapsedTime() {
if (isActive()) {
- calculateElapsedTime();
+ calculateElapsedTime(false);
}
return "" + elapsed;
}
public long getElapsedTimeLong() {
if (isActive()) {
- calculateElapsedTime();
+ calculateElapsedTime(false);
}
return elapsed;
}
@@ -360,7 +367,7 @@ public class Task implements ITask {
}
public String getElapsedTimeForDisplay() {
- calculateElapsedTime();
+ calculateElapsedTime(false);
return DateUtil.getFormattedDuration(elapsed);
}
@@ -501,4 +508,34 @@ public class Task implements ITask {
return "";
}
}
+
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(String date) {
+ if (!date.equals("")) {
+ String formatString = "yyyy-MM-dd HH:mm:ss.S z";
+ SimpleDateFormat format = new SimpleDateFormat(formatString, Locale.ENGLISH);
+ try {
+ creationDate = format.parse(date);
+ } catch (ParseException e) {
+ MylarPlugin.log(e, "Could not parse end date");
+ creationDate = null;
+ }
+ } else {
+
+ }
+ }
+
+
+ public String getCreationDateString() {
+ if (creationDate != null) {
+ String f = "yyyy-MM-dd HH:mm:ss.S z";
+ SimpleDateFormat format = new SimpleDateFormat(f, Locale.ENGLISH);
+ return format.format(creationDate);
+ } else {
+ return "";
+ }
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java
new file mode 100644
index 000000000..16cfb4687
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java
@@ -0,0 +1,54 @@
+package org.eclipse.mylar.tasklist;
+
+import java.util.Date;
+
+import org.eclipse.mylar.core.InteractionEvent;
+import org.eclipse.mylar.monitor.IInteractionEventListener;
+import org.eclipse.mylar.monitor.MylarMonitorPlugin;
+import org.eclipse.mylar.monitor.planning.ActiveTimerThread;
+import org.eclipse.mylar.monitor.planning.IActiveTimerListener;
+
+public class TaskActiveTimerListener implements IActiveTimerListener, IInteractionEventListener {
+
+ private ActiveTimerThread timer;
+
+ private ITask task;
+
+ private boolean isTaskStalled = false;
+
+ public TaskActiveTimerListener(ITask task){
+ this.task = task;
+ timer = new ActiveTimerThread(TaskListManager.INACTIVITY_TIME, this);
+ timer.start();
+ MylarMonitorPlugin.getDefault().addListener(this);
+ }
+
+ public void fireTimedOut() {
+ task.setActive(task.isActive(), true);
+ isTaskStalled = true;
+ System.out.println(task.getElapsedTimeForDisplay());
+ System.out.println(new Date());
+ timer.resetTimer();
+ }
+
+ public void interactionObserved(InteractionEvent event) {
+ System.out.println("interaction > " + task.getElapsedTimeForDisplay());
+ timer.resetTimer();
+
+ if(isTaskStalled){
+ task.setActive(task.isActive(), false);
+ }
+ isTaskStalled = false;
+ }
+
+ public void start() {}
+
+ public void stopTimer() {
+ timer.killThread();
+ MylarMonitorPlugin.getDefault().removeListener(this);
+ System.out.println("listener removed");
+ }
+
+ public void stop() {}
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListManager.java
index 2380536b7..38583f9a5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListManager.java
@@ -15,7 +15,9 @@ package org.eclipse.mylar.tasklist;
import java.io.File;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.tasklist.internal.RelativePathUtil;
@@ -28,6 +30,12 @@ import org.eclipse.mylar.tasklist.internal.TaskList;
*/
public class TaskListManager {
+ public static final int INACTIVITY_TIME = 5; // in minutes
+
+ public static final long INACTIVITY_TIME_MILLIS = INACTIVITY_TIME * 1000 * 60;
+
+ private Map<ITask, TaskActiveTimerListener> listenerMap = new HashMap<ITask, TaskActiveTimerListener>();
+
private File taskListFile;
private TaskList taskList = new TaskList();
private List<ITaskActivityListener> listeners = new ArrayList<ITaskActivityListener>();
@@ -95,7 +103,10 @@ public class TaskListManager {
}
public void deleteTask(ITask task) {
- taskList.setActive(task, false);
+ TaskActiveTimerListener activeListener = listenerMap.remove(task);
+ if(activeListener != null)
+ activeListener.stopTimer();
+ taskList.setActive(task, false, false);
taskList.deleteTask(task);
}
@@ -118,12 +129,17 @@ public class TaskListManager {
}
taskList.clearActiveTasks();
}
- taskList.setActive(task, true);
+ taskList.setActive(task, true, false);
+ TaskActiveTimerListener activeListener = new TaskActiveTimerListener(task);
+ listenerMap.put(task, activeListener);
for (ITaskActivityListener listener : listeners) listener.taskActivated(task);
}
public void deactivateTask(ITask task) {
- taskList.setActive(task, false);
+ TaskActiveTimerListener activeListener = listenerMap.remove(task);
+ if(activeListener != null)
+ activeListener.stopTimer();
+ taskList.setActive(task, false, false);
for (ITaskActivityListener listener : listeners) listener.taskDeactivated(task);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
index 2349f367d..34aaeb35c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
@@ -49,6 +49,7 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
public static final String TRUE = "true";
public static final String NAME = "Name";
public static final String END_DATE = "EndDate";
+ public static final String CREATION_DATE = "CreationDate";
public static final String REMINDER_DATE = "ReminderDate";
public static final String REMINDED = "Reminded";
@@ -108,7 +109,8 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
node.setAttribute(NOTES, task.getNotes());
node.setAttribute(ELAPSED, task.getElapsedTime());
node.setAttribute(ESTIMATED, ""+task.getEstimateTime());
- node.setAttribute(END_DATE, task.getEndDateString());
+ node.setAttribute(END_DATE, task.getEndDateString());
+ node.setAttribute(CREATION_DATE, task.getCreationDateString());
node.setAttribute(REMINDER_DATE, task.getReminderDateString(false));
if (task.hasBeenReminded()) {
node.setAttribute(REMINDED, TRUE);
@@ -178,7 +180,7 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
} else {
label = "Description was corrupted in stored tasklist";
}
- Task task = new Task(handle, label);
+ Task task = new Task(handle, label, false);
readTaskInfo(task, tlist, element, category, parent);
return task;
}
@@ -196,11 +198,11 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
}
if (element.getAttribute(ACTIVE).compareTo(TRUE) == 0) {
- task.setActive(true);
- tlist.setActive(task, true);
+ task.setActive(true, false);
+ tlist.setActive(task, true, false);
new TaskActivateAction(task).run();
} else {
- task.setActive(false);
+ task.setActive(false, false);
}
if (element.hasAttribute(NOTES)) {
task.setNotes(element.getAttribute(NOTES));
@@ -234,6 +236,11 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
} else {
task.setEndDate("");
}
+ if (element.hasAttribute(CREATION_DATE)) {
+ task.setCreationDate(element.getAttribute(CREATION_DATE));
+ } else {
+ task.setCreationDate("");
+ }
if (element.hasAttribute(REMINDER_DATE)) {
task.setReminderDate(element.getAttribute(REMINDER_DATE));
} else {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskList.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskList.java
index 3314a43c1..bd716e0bf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskList.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskList.java
@@ -59,13 +59,14 @@ public class TaskList implements Serializable {
categories.add(cat);
}
- public void setActive(ITask task, boolean active) {
- task.setActive(active);
+ public void setActive(ITask task, boolean active, boolean isStalled) {
+ task.setActive(active, isStalled);
if (active && !activeTasks.contains(task)) {
activeTasks.add(task);
} else if(!active){
activeTasks.remove(task);
}
+
}
public void deleteTask(ITask task) {
@@ -191,7 +192,7 @@ public class TaskList implements Serializable {
}
public void clearActiveTasks() {
for (ITask task : activeTasks) {
- task.setActive(false);
+ task.setActive(false, false);
}
activeTasks.clear();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/internal/TaskReportGenerator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/internal/TaskReportGenerator.java
index cbdda0c80..bddd1155f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/internal/TaskReportGenerator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/internal/TaskReportGenerator.java
@@ -58,6 +58,7 @@ public class TaskReportGenerator {
}
}
}
+ // TODO need to support handling things in the bugzilla registry
for (ITasksCollector collector : collectors) {
tasks.addAll(collector.getTasks());
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameEditorPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameEditorPart.java
index ebdcf8ed4..2642884ff 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameEditorPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameEditorPart.java
@@ -42,7 +42,7 @@ public class PlanningGameEditorPart extends EditorPart {
private PlanningGameEditorInput editorInput = null;
private Table table;
private TableViewer tableViewer;
- private String[] columnNames = new String[] { "Description", "Priority", "Date Completed", "Duration"};
+ private String[] columnNames = new String[] { "Description", "Priority", "Date Created", "Date Completed", "Duration"};
@Override
public void doSave(IProgressMonitor monitor) {
@@ -143,6 +143,7 @@ public class PlanningGameEditorPart extends EditorPart {
table.setLinesVisible(true);
table.setHeaderVisible(true);
+ table.setEnabled(true);
TableColumn column = new TableColumn(table, SWT.LEFT, 0);
column.setText(columnNames[0]);
@@ -167,17 +168,27 @@ public class PlanningGameEditorPart extends EditorPart {
column = new TableColumn(table, SWT.LEFT, 2);
column.setText(columnNames[2]);
- column.setWidth(200);
+ column.setWidth(170);
column.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- tableViewer.setSorter(new PlanningGameSorter(PlanningGameSorter.DATE));
+ tableViewer.setSorter(new PlanningGameSorter(PlanningGameSorter.CREATION_DATE));
}
});
-
column = new TableColumn(table, SWT.LEFT, 3);
column.setText(columnNames[3]);
+ column.setWidth(170);
+ column.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ tableViewer.setSorter(new PlanningGameSorter(PlanningGameSorter.COMPLETED_DATE));
+ }
+ });
+
+
+ column = new TableColumn(table, SWT.LEFT, 4);
+ column.setText(columnNames[4]);
column.setWidth(100);
column.addSelectionListener(new SelectionAdapter() {
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameLabelProvider.java
index 80bfb92c9..a99a46866 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameLabelProvider.java
@@ -36,8 +36,10 @@ public class PlanningGameLabelProvider extends LabelProvider implements
case 1:
return task.getPriority();
case 2:
- return task.getEndDateString();
+ return task.getCreationDateString();
case 3:
+ return task.getEndDateString();
+ case 4:
return task.getElapsedTimeForDisplay();
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java
index a2869f358..e148e930a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/report/ui/PlanningGameSorter.java
@@ -25,8 +25,9 @@ public class PlanningGameSorter extends ViewerSorter {
*/
public final static int DESCRIPTION = 1;
public final static int PRIORITY = 2;
- public final static int DATE = 3;
- public final static int DURATION = 4;
+ public final static int CREATION_DATE = 3;
+ public final static int COMPLETED_DATE = 4;
+ public final static int DURATION = 5;
// Criteria that the instance uses
private int criteria;
@@ -52,8 +53,10 @@ public class PlanningGameSorter extends ViewerSorter {
return compareDescription(t1, t2);
case PRIORITY:
return comparePriority(t1, t2);
- case DATE:
- return compareDate(t1, t2);
+ case CREATION_DATE:
+ return compareCreationDate(t1, t2);
+ case COMPLETED_DATE:
+ return compareCompletedDate(t1, t2);
case DURATION:
return compareDuration(t1, t2);
default:
@@ -69,9 +72,13 @@ public class PlanningGameSorter extends ViewerSorter {
return task1.getPriority().compareTo(task2.getPriority());
}
- private int compareDate(ITask task1, ITask task2) {
+ private int compareCompletedDate(ITask task1, ITask task2) {
return task2.getEndDate().compareTo(task1.getEndDate());
}
+
+ private int compareCreationDate(ITask task1, ITask task2) {
+ return task2.getCreationDate().compareTo(task1.getCreationDate());
+ }
private int compareDuration(ITask task1, ITask task2) {
return task1.getElapsedTimeLong() < task2.getElapsedTimeLong() ? 1 : -1;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
index 81e8dbd19..ccbef55d8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
@@ -468,6 +468,27 @@ public class TaskSummaryEditor extends EditorPart {
text2.setLayoutData(td);
text2.setEditable(false);
text2.setEnabled(false);
+
+ l = toolkit.createLabel(container, "Task Creation Date:");
+ l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Text creationDate = toolkit.createText(container,task.getCreationDateString(), SWT.BORDER);
+ td = new TableWrapData(TableWrapData.FILL_GRAB);
+ td.grabHorizontal = true;
+ td.colspan = 2;
+ creationDate.setLayoutData(td);
+ creationDate.setEditable(false);
+ creationDate.setEnabled(false);
+
+ l = toolkit.createLabel(container, "Task Completed Date:");
+ l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Text endDate = toolkit.createText(container,task.getEndDateString(), SWT.BORDER);
+ td = new TableWrapData(TableWrapData.FILL_GRAB);
+ td.grabHorizontal = true;
+ td.colspan = 2;
+ endDate.setLayoutData(td);
+ endDate.setEditable(false);
+ endDate.setEnabled(false);
+
//text2.setForeground(background);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CreateTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CreateTaskAction.java
index 92896ce87..96aa52761 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CreateTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/actions/CreateTaskAction.java
@@ -46,7 +46,7 @@ public class CreateTaskAction extends Action {
int dialogResult = dialog.open();
if (dialogResult == Window.OK) {
Task newTask = new Task(MylarTasklistPlugin.getTaskListManager()
- .genUniqueTaskId(), dialog.getTaskname());
+ .genUniqueTaskId(), dialog.getTaskname(), true);
newTask.setPriority(dialog.getSelectedPriority());
newTask.setReminderDate(dialog.getReminderDate());

Back to the top