Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-13 04:07:13 +0000
committerrelves2007-06-13 04:07:13 +0000
commitf2fb9bb4cd1e7b9906b9cccc96ba519f116c975a (patch)
tree7a6851c509b9f32e2d0aef6f9c451c23c0c43ad7
parenta91558c86597605da8772ca0ff017bb16dc715b9 (diff)
downloadorg.eclipse.mylyn.tasks-f2fb9bb4cd1e7b9906b9cccc96ba519f116c975a.tar.gz
org.eclipse.mylyn.tasks-f2fb9bb4cd1e7b9906b9cccc96ba519f116c975a.tar.xz
org.eclipse.mylyn.tasks-f2fb9bb4cd1e7b9906b9cccc96ba519f116c975a.zip
REOPENED - bug 124321: [api] merge local tasks with repository tasks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=124321
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java8
-rw-r--r--org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java1
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java11
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DateRangeActivityDelegate.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DelegatingTaskExternalizer.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java1
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java4
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java5
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java12
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java4
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java8
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java25
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java26
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java8
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.mylyn.tasklist.prefs4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskReadAction.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskUnreadAction.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java75
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskReportGenerator.java25
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java36
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskPage.java (renamed from org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryTaskPage.java)4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskWizard.java (renamed from org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/Task.java)18
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java3
31 files changed, 189 insertions, 141 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
index 6e91075e2..27f9366ee 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
@@ -24,9 +24,9 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaTaskExternalizer;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListExternalizer;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TaskListManager;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -93,7 +93,7 @@ public class TaskListStandaloneTest extends TestCase {
public void testDates() {
Date start = Calendar.getInstance().getTime();
Date creation = new Date();
- Task task = new LocalTask("1", "task 1");
+ AbstractRepositoryTask task = new LocalTask("1", "task 1");
manager.getTaskList().moveToRoot(task);
assertDatesCloseEnough(task.getCreationDate(), start);
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java
index e9e5494cf..f6f198d33 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java
@@ -23,8 +23,8 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryQuery;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask;
import org.eclipse.mylyn.internal.tasks.ui.planner.CompletedTaskCollector;
import org.eclipse.mylyn.internal.tasks.ui.planner.TaskReportGenerator;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskCategory;
import org.eclipse.mylyn.tasks.ui.TaskListManager;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -55,7 +55,7 @@ public class TaskReportGeneratorTest extends TestCase {
}
public void testCompletedTasksRetrieved() throws InvocationTargetException, InterruptedException {
- Task task1 = manager.createNewLocalTask("task 1");
+ AbstractRepositoryTask task1 = manager.createNewLocalTask("task 1");
manager.getTaskList().moveToRoot(task1);
CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0));
@@ -71,7 +71,7 @@ public class TaskReportGeneratorTest extends TestCase {
}
public void testCompletedTasksDateBoundsRetrieved() throws InvocationTargetException, InterruptedException {
- Task task1 = manager.createNewLocalTask("task 1");
+ AbstractRepositoryTask task1 = manager.createNewLocalTask("task 1");
manager.getTaskList().moveToRoot(task1);
task1.setCompleted(true);
Thread.sleep(1000);
@@ -109,7 +109,7 @@ public class TaskReportGeneratorTest extends TestCase {
}
public void testCompletedTasksInCategoryRetrieved() throws InvocationTargetException, InterruptedException {
- Task task1 = manager.createNewLocalTask("task 1");
+ AbstractRepositoryTask task1 = manager.createNewLocalTask("task 1");
manager.getTaskList().moveToRoot(task1);
task1.setCompleted(true);
TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category");
diff --git a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
index 37d9106b6..12ed0b3e7 100644
--- a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
+++ b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/dialogs/UiLegendDialog.java
@@ -20,7 +20,6 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskElementLabelProvider;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.PriorityLevel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java
index cc1fff1b0..d6f8a72c9 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryTask.java
@@ -24,7 +24,7 @@ import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil;
* @author Mik Kersten
* @author Rob Elves
*/
-public abstract class AbstractRepositoryTask extends Task {
+public abstract class AbstractRepositoryTask extends AbstractTaskContainer implements ITask {
@Deprecated
public static final String DEFAULT_TASK_KIND = "task";
@@ -163,9 +163,12 @@ public abstract class AbstractRepositoryTask extends Task {
this.summary = summary;
}
-// public final String getHandleIdentifier() {
-// return RepositoryTaskHandleUtil.getHandle(repositoryUrl, taskId);
-// }
+ public final String getHandleIdentifier() {
+ // Note: when removing this consider implications to repository url refactoring
+ // which only sets the repository url (so if we simply return handle here it will
+ // be incorrect after a refactoring).
+ return RepositoryTaskHandleUtil.getHandle(repositoryUrl, taskId);
+ }
public abstract String getRepositoryKind();
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DateRangeActivityDelegate.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DateRangeActivityDelegate.java
index 2dae78526..a517ab4b2 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DateRangeActivityDelegate.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DateRangeActivityDelegate.java
@@ -231,7 +231,7 @@ public class DateRangeActivityDelegate extends AbstractTaskContainer implements
}
public int compareTo(ITaskListElement taskListElement) {
- return task.toString().compareTo(((Task) taskListElement).toString());
+ return task.toString().compareTo(((AbstractRepositoryTask) taskListElement).toString());
}
public void setSummary(String description) {
@@ -248,6 +248,6 @@ public class DateRangeActivityDelegate extends AbstractTaskContainer implements
@Override
public boolean isLocal() {
- return ((Task)task).isLocal();
+ return ((AbstractRepositoryTask)task).isLocal();
}
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DelegatingTaskExternalizer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DelegatingTaskExternalizer.java
index 7fb436637..c5aa7faf1 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DelegatingTaskExternalizer.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/DelegatingTaskExternalizer.java
@@ -246,7 +246,7 @@ public class DelegatingTaskExternalizer implements ITaskListExternalizer {
String handle = element.getAttribute(KEY_HANDLE);
ITask subTask = tasklist.getTask(handle);
if (subTask != null) {
- tasklist.addTask(subTask, (Task)task);
+ tasklist.addTask(subTask, (AbstractRepositoryTask)task);
}
}
}
@@ -380,7 +380,7 @@ public class DelegatingTaskExternalizer implements ITaskListExternalizer {
} else {
throw new TaskExternalizationException("Handle not stored for task");
}
- Task task = new LocalTask(handle, summary);
+ AbstractRepositoryTask task = new LocalTask(handle, summary);
return task;
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
index eb558af13..8c1b2ce6a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
@@ -194,7 +194,7 @@ public class TaskList {
moveToContainer(archiveContainer, task);
}
- public void renameTask(Task task, String description) {
+ public void renameTask(AbstractRepositoryTask task, String description) {
task.setSummary(description);
for (ITaskListChangeListener listener : changeListeners) {
listener.localInfoChanged(task);
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
index c8f4500d7..c6d8dc2c5 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepositoryManager.java
@@ -23,7 +23,6 @@ import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.mylyn.core.MylarStatusHandler;
-import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoriesExternalizer;
/**
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java
index 225c808b6..e20c51afd 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java
@@ -16,7 +16,7 @@ import junit.framework.TestCase;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListTableSorter;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.Task;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.TaskCategory;
/**
@@ -27,7 +27,7 @@ public class TableSorterTest extends TestCase {
public void testRootTaskSorting() {
TaskListTableSorter sorter = new TaskListTableSorter(TaskListView.getFromActivePerspective(), TaskListTableSorter.SortByIndex.SUMMARY);
- Task task = new LocalTask("1", "");
+ AbstractRepositoryTask task = new LocalTask("1", "");
TaskCategory category = new TaskCategory("cat");
assertEquals(-1, sorter.compare(null, task, category));
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
index e82358c91..f87af6c95 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
@@ -16,12 +16,11 @@ import java.util.Collection;
import org.eclipse.mylyn.context.core.ContextCorePlugin;
import org.eclipse.mylyn.context.tests.AbstractContextTest;
import org.eclipse.mylyn.internal.context.core.InteractionContext;
-import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizard;
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizardPage;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.ui.TaskListManager;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -113,7 +112,7 @@ public class TaskDataImportTest extends AbstractContextTest {
assertTrue(historyContext.getInteractionHistory().size() == 0);
assertEquals(2, TasksUiPlugin.getRepositoryManager().getAllRepositories().size());
- Task task1 = new LocalTask("999", "label");
+ AbstractRepositoryTask task1 = new LocalTask("999", "label");
taskList.addTask(task1);
Collection<ITask> tasks = taskList.getAllTasks();
assertEquals(1, tasks.size());
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java
index c13549191..38a660c29 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java
@@ -22,8 +22,8 @@ import org.eclipse.mylyn.internal.tasks.ui.actions.TaskDeactivateAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskNavigateDropDownAction.TaskNavigateAction;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskActivationHistory;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TaskListManager;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -39,15 +39,15 @@ public class TaskHistoryTest extends TestCase {
protected TaskListView taskView = null;
- protected Task task1 = null;
+ protected AbstractRepositoryTask task1 = null;
- protected Task task2 = null;
+ protected AbstractRepositoryTask task2 = null;
- protected Task task3 = null;
+ protected AbstractRepositoryTask task3 = null;
- protected Task task4 = null;
+ protected AbstractRepositoryTask task4 = null;
- protected Task task5 = null;
+ protected AbstractRepositoryTask task5 = null;
@Override
protected void setUp() throws Exception {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java
index 63c64138b..461170a26 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java
@@ -20,7 +20,7 @@ import junit.framework.TestCase;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.TaskListBackupManager;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants;
-import org.eclipse.mylyn.tasks.core.Task;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
@@ -28,7 +28,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
*/
public class TaskListBackupManagerTest extends TestCase {
- private Task task1;
+ private AbstractRepositoryTask task1;
@Override
protected void setUp() throws Exception {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java
index 833d20c8b..9c12f0afc 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListContentProviderTest.java
@@ -14,7 +14,7 @@ import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListContentProvider;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.Task;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
@@ -49,13 +49,13 @@ public class TaskListContentProviderTest extends TestCase {
public void testHasChildren() {
- Task parent = new LocalTask("parent", "parent label");
- Task completedChild = new LocalTask("completed child", "completed child label");
+ AbstractRepositoryTask parent = new LocalTask("parent", "parent label");
+ AbstractRepositoryTask completedChild = new LocalTask("completed child", "completed child label");
completedChild.setCompleted(true);
taskList.addTask(completedChild, parent);
assertFalse(provider.hasChildren(parent));
- Task incompleteChild = new LocalTask("incomplete child", "incomplete child label");
+ AbstractRepositoryTask incompleteChild = new LocalTask("incomplete child", "incomplete child label");
incompleteChild.setCompleted(false);
taskList.addTask(incompleteChild, parent);
assertTrue(provider.hasChildren(parent));
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
index ba266a6d0..30ac775fa 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
@@ -39,7 +39,6 @@ import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskCategory;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -105,7 +104,7 @@ public class TaskListManagerTest extends TestCase {
manager.readExistingOrCreateNewList();
assertEquals(2, manager.getTaskList().getAllTasks().size());
assertEquals(3, manager.getTaskList().getLastTaskNum());
- Task task4 =manager.createNewLocalTask("label");
+ AbstractRepositoryTask task4 =manager.createNewLocalTask("label");
assertTrue(task4.getHandleIdentifier() + " should end with 4", task4.getHandleIdentifier().endsWith("4"));
}
@@ -282,7 +281,7 @@ public class TaskListManagerTest extends TestCase {
public void testMoveCategories() {
assertEquals(0, manager.getTaskList().getRootTasks().size());
- Task task1 = new LocalTask("t1", "t1");
+ AbstractRepositoryTask task1 = new LocalTask("t1", "t1");
TaskCategory cat1 = new TaskCategory("cat1");
manager.getTaskList().addCategory(cat1);
@@ -300,7 +299,7 @@ public class TaskListManagerTest extends TestCase {
public void testMoveToRoot() {
assertEquals(0, manager.getTaskList().getRootTasks().size());
- Task task1 = new LocalTask("t1", "t1");
+ AbstractRepositoryTask task1 = new LocalTask("t1", "t1");
manager.getTaskList().moveToRoot(task1);
assertEquals(1, manager.getTaskList().getRootTasks().size());
assertEquals(UncategorizedCategory.HANDLE, task1.getContainer().getHandleIdentifier());
@@ -511,15 +510,15 @@ public class TaskListManagerTest extends TestCase {
public void testCreationAndExternalization() {
Set<ITask> rootTasks = new HashSet<ITask>();
- Task task1 = manager.createNewLocalTask("task 1");
+ AbstractRepositoryTask task1 = manager.createNewLocalTask("task 1");
manager.getTaskList().moveToRoot(task1);
rootTasks.add(task1);
- Task sub1 = manager.createNewLocalTask("sub 1");
+ AbstractRepositoryTask sub1 = manager.createNewLocalTask("sub 1");
manager.getTaskList().addTask(sub1, task1);
manager.getTaskList().moveToContainer(manager.getTaskList().getArchiveContainer(), sub1);
- Task task2 = manager.createNewLocalTask("task 2");
+ AbstractRepositoryTask task2 = manager.createNewLocalTask("task 2");
manager.getTaskList().moveToRoot(task2);
rootTasks.add(task2);
@@ -528,15 +527,15 @@ public class TaskListManagerTest extends TestCase {
TaskCategory cat1 = new TaskCategory("Category 1");
manager.getTaskList().addCategory(cat1);
categories.add(cat1);
- Task task3 =manager.createNewLocalTask("task 3");
+ AbstractRepositoryTask task3 =manager.createNewLocalTask("task 3");
manager.getTaskList().moveToContainer(cat1, task3);
cat1Contents.add(task3);
assertEquals(cat1, task3.getContainer());
- Task sub2 = manager.createNewLocalTask("sub 2");
+ AbstractRepositoryTask sub2 = manager.createNewLocalTask("sub 2");
manager.getTaskList().addTask(sub2, task3);
manager.getTaskList().moveToContainer(manager.getTaskList().getArchiveContainer(), sub2);
- Task task4 = manager.createNewLocalTask("task 4");
+ AbstractRepositoryTask task4 = manager.createNewLocalTask("task 4");
manager.getTaskList().moveToContainer(cat1, task4);
cat1Contents.add(task4);
@@ -586,7 +585,7 @@ public class TaskListManagerTest extends TestCase {
// String handle = AbstractRepositoryTask.getHandle("http://url/repo-location",
// 1);
- Task task1 = manager.createNewLocalTask("task 1");
+ AbstractRepositoryTask task1 = manager.createNewLocalTask("task 1");
manager.getTaskList().moveToRoot(task1);
rootTasks.add(task1);
@@ -745,8 +744,8 @@ public class TaskListManagerTest extends TestCase {
}
public void testAllTasksDeactivation() {
- Task task1 = new LocalTask("task1", "description1");
- Task task2 = new LocalTask("task2", "description2");
+ AbstractRepositoryTask task1 = new LocalTask("task1", "description1");
+ AbstractRepositoryTask task2 = new LocalTask("task2", "description2");
TaskList taskList = manager.getTaskList();
taskList.addTask(task1);
taskList.addTask(task2);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
index 22aa5c40e..83b6dfe40 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
@@ -27,10 +27,10 @@ import org.eclipse.mylyn.internal.tasks.ui.TaskPriorityFilter;
import org.eclipse.mylyn.internal.tasks.ui.actions.MarkTaskCompleteAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.NewCategoryAction;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskCategory;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.PriorityLevel;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery;
@@ -52,31 +52,31 @@ public class TaskListUiTest extends TestCase {
private TaskCategory cat1 = null;
- private Task cat1task1 = null;
+ private AbstractRepositoryTask cat1task1 = null;
- private Task cat1task2 = null;
+ private AbstractRepositoryTask cat1task2 = null;
- private Task cat1task3 = null;
+ private AbstractRepositoryTask cat1task3 = null;
- private Task cat1task4 = null;
+ private AbstractRepositoryTask cat1task4 = null;
- private Task cat1task5 = null;
+ private AbstractRepositoryTask cat1task5 = null;
- private Task cat1task1sub1 = null;
+ private AbstractRepositoryTask cat1task1sub1 = null;
private TaskCategory cat2 = null;
- private Task cat2task1 = null;
+ private AbstractRepositoryTask cat2task1 = null;
- private Task cat2task2 = null;
+ private AbstractRepositoryTask cat2task2 = null;
- private Task cat2task3 = null;
+ private AbstractRepositoryTask cat2task3 = null;
- private Task cat2task4 = null;
+ private AbstractRepositoryTask cat2task4 = null;
- private Task cat2task5 = null;
+ private AbstractRepositoryTask cat2task5 = null;
- private Task cat2task1sub1 = null;
+ private AbstractRepositoryTask cat2task1sub1 = null;
private final static int CHECK_COMPLETE_FILTER = 1;
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java
index 4c64da66d..d33904083 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java
@@ -11,19 +11,17 @@
package org.eclipse.mylyn.tasks.tests;
+import junit.framework.TestCase;
+
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskPlanningEditor;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
-import junit.framework.TestCase;
-
/**
* @author Rob Elves
*/
@@ -31,8 +29,6 @@ public class TaskPlanningEditorTest extends TestCase {
private static final String MOCK_LABEL = "label";
- private static final String MOCK_HANDLE = "handle";
-
private static final String DESCRIPTION = "summary";
private static final String NEW_DESCRIPTION = "new summary";
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java
index 2db193920..139fb6f99 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java
@@ -15,7 +15,6 @@ import junit.framework.TestCase;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.PriorityLevel;
/**
@@ -34,7 +33,7 @@ public class TaskTest extends TestCase {
}
public void testUrl() {
- Task task = new LocalTask("handle", "label");
+ AbstractRepositoryTask task = new LocalTask("handle", "label");
task.setTaskUrl("http://eclipse.org/mylar/doc.php");
assertTrue(task.hasValidUrl());
@@ -52,7 +51,7 @@ public class TaskTest extends TestCase {
}
public void testPriorityNeverNull() {
- Task task = new LocalTask("handle", "label");
+ AbstractRepositoryTask task = new LocalTask("handle", "label");
assertNotNull(task.getPriority());
PriorityLevel def = PriorityLevel.getDefault();
diff --git a/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.mylyn.tasklist.prefs b/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.mylyn.tasklist.prefs
new file mode 100644
index 000000000..b09036701
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.mylyn.tasklist.prefs
@@ -0,0 +1,4 @@
+#Tue Jun 12 20:33:52 PDT 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
index c591c4805..f04827ab6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskCompleteAction.java
@@ -16,9 +16,9 @@ import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.tasks.core.WebTask;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
@@ -38,8 +38,8 @@ public class MarkTaskCompleteAction extends Action {
setToolTipText("Mark " + ACTION_NAME);
setId(ID);
setImageDescriptor(TasksUiImages.TASK_COMPLETE);
- if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof Task)) {
- Task task = (Task) selectedElements.get(0);
+ if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof AbstractRepositoryTask)) {
+ AbstractRepositoryTask task = (AbstractRepositoryTask) selectedElements.get(0);
if (task instanceof WebTask) {
setEnabled(true);
} else {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
index 13c224a86..51f8e7ddf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskIncompleteAction.java
@@ -15,9 +15,9 @@ import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
@@ -37,8 +37,8 @@ public class MarkTaskIncompleteAction extends Action {
setToolTipText("Mark " + ACTION_NAME);
setId(ID);
setImageDescriptor(TasksUiImages.TASK_INCOMPLETE);
- if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof ITask)) {
- Task task = (Task) selectedElements.get(0);
+ if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof AbstractRepositoryTask)) {
+ AbstractRepositoryTask task = (AbstractRepositoryTask) selectedElements.get(0);
setEnabled(task.isLocal());
// } else if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof WebQueryHit)) {
// setEnabled(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskReadAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskReadAction.java
index 3a4a0f1ce..7f310498e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskReadAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskReadAction.java
@@ -15,7 +15,6 @@ import java.util.List;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
@@ -36,8 +35,8 @@ public class MarkTaskReadAction extends AbstractRepositoryTasksAction {
setEnabled(false);
} else {
setEnabled(selectedElements.size() > 0);
- if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof Task)) {
- Task task = (Task) selectedElements.get(0);
+ if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof AbstractRepositoryTask)) {
+ AbstractRepositoryTask task = (AbstractRepositoryTask) selectedElements.get(0);
setEnabled(!task.isLocal());
} else {
setEnabled(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskUnreadAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskUnreadAction.java
index 8fca6e77f..3f88bb7ff 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskUnreadAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/MarkTaskUnreadAction.java
@@ -16,7 +16,6 @@ import java.util.List;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
@@ -38,8 +37,8 @@ public class MarkTaskUnreadAction extends AbstractRepositoryTasksAction {
if (containsArchiveContainer(selectedElements)) {
setEnabled(false);
} else {
- if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof Task)) {
- Task task = (Task) selectedElements.get(0);
+ if (selectedElements.size() == 1 && (selectedElements.get(0) instanceof AbstractRepositoryTask)) {
+ AbstractRepositoryTask task = (AbstractRepositoryTask) selectedElements.get(0);
setEnabled(!task.isLocal());
} else {
setEnabled(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java
new file mode 100644
index 000000000..728c3bb66
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.actions;
+
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.mylyn.internal.tasks.ui.wizards.NewTaskWizard;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Mik Kersten
+ * @author Eugene Kuleshov
+ */
+public class NewTaskAction extends Action implements IViewActionDelegate {
+
+ public static final String ID = "org.eclipse.mylyn.tasklist.ui.repositories.actions.create";
+
+ @Override
+ public void run() {
+
+ IWizard wizard;
+ List<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories();
+ if (repositories.size() == 1) {
+ // NOTE: this click-saving should be generalized
+ TaskRepository taskRepository = repositories.get(0);
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(taskRepository.getKind());
+
+ wizard = connectorUi.getNewTaskWizard(taskRepository);
+ } else {
+ wizard = new NewTaskWizard();
+ }
+
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ if (shell != null && !shell.isDisposed()) {
+
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+
+ } else {
+ // ignore
+ }
+ }
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public void init(IViewPart view) {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
index 57d35a4f9..8a243ff73 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
@@ -31,7 +31,6 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask.PriorityLevel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
@@ -240,7 +239,7 @@ public class TaskPlanningEditor extends TaskFormPage {
if (task instanceof LocalTask) {
String label = summary.getText();
// task.setDescription(label);
- TasksUiPlugin.getTaskListManager().getTaskList().renameTask((Task) task, label);
+ TasksUiPlugin.getTaskListManager().getTaskList().renameTask((AbstractRepositoryTask) task, label);
// TODO: refactor mutation into TaskList?
task.setTaskUrl(issueReportURL.getText());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskReportGenerator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskReportGenerator.java
index 6bcb8ebba..41b2b6c2f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskReportGenerator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskReportGenerator.java
@@ -22,10 +22,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.core.MylarStatusHandler;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskList;
/**
@@ -84,28 +84,27 @@ public class TaskReportGenerator implements IRunnableWithProgress {
for (Object element : rootElements) {
monitor.worked(1);
- if (element instanceof AbstractTaskContainer) {
- AbstractTaskContainer cat = (AbstractTaskContainer) element;
- for (ITask task : cat.getChildren())
- for (ITaskCollector collector : collectors) {
- collector.consumeTask(task);
- }
-
- } else if (element instanceof Task) {
- Task task = (Task) element;
+ if (element instanceof AbstractRepositoryTask) {
+ AbstractRepositoryTask task = (AbstractRepositoryTask) element;
for (ITaskCollector collector : collectors) {
collector.consumeTask(task);
}
-
} else if (element instanceof AbstractRepositoryQuery) {
// process queries
AbstractRepositoryQuery repositoryQuery = (AbstractRepositoryQuery) element;
- for(ITask task : repositoryQuery.getChildren()) {
+ for (ITask task : repositoryQuery.getChildren()) {
for (ITaskCollector collector : collectors) {
collector.consumeTask(task);
}
}
- }
+ } else if (element instanceof AbstractTaskContainer) {
+ AbstractTaskContainer cat = (AbstractTaskContainer) element;
+ for (ITask task : cat.getChildren())
+ for (ITaskCollector collector : collectors) {
+ collector.consumeTask(task);
+ }
+
+ }
}
// Put the results all into one list (tasks)
for (ITaskCollector collector : collectors) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
index 71c42fd26..a326fef4f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
@@ -18,7 +18,6 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.swt.widgets.TreeItem;
@@ -67,7 +66,7 @@ class TaskListCellModifier implements ICellModifier {
switch (columnIndex) {
case 0:
if (!(task instanceof AbstractRepositoryTask)) {
- TasksUiPlugin.getTaskListManager().getTaskList().renameTask((Task) task,
+ TasksUiPlugin.getTaskListManager().getTaskList().renameTask((AbstractRepositoryTask) task,
((String) value).trim());
}
break;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
index c280abd1c..7125a84fb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListContentProvider.java
@@ -26,14 +26,12 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskArchive;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
/**
- * Provides custom content for the task list, e.g. guaranteed visibility of some
- * elements, ability to suppress containers showing if nothing should show under
- * them.
+ * Provides custom content for the task list, e.g. guaranteed visibility of some elements, ability to suppress
+ * containers showing if nothing should show under them.
*
* TODO: move to viewer filter architecture?
*
@@ -66,7 +64,7 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
// if (((ITask) child).getParent() != null) {
// return ((ITask) child).getParent();
// } else {
- return ((ITask) child).getContainer();
+ return ((ITask) child).getContainer();
// }
}
return null;
@@ -77,8 +75,7 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
}
/**
- * NOTE: If parent is an ITask, this method checks if parent has unfiltered
- * children (see bug 145194).
+ * NOTE: If parent is an ITask, this method checks if parent has unfiltered children (see bug 145194).
*/
public boolean hasChildren(Object parent) {
if (parent instanceof AbstractRepositoryQuery) {
@@ -201,6 +198,7 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
return false;
}
+ // TODO: This can be simplified post bug#124321
private List<ITaskListElement> getFilteredChildrenFor(Object parent) {
if (containsNoFilterText((this.view.getFilteredTree().getFilterControl()).getText())) {
List<ITaskListElement> children = new ArrayList<ITaskListElement>();
@@ -233,8 +231,8 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
}
}
return children;
- } else if (parent instanceof Task) {
- Set<ITask> subTasks = ((Task) parent).getChildren();
+ } else if (parent instanceof AbstractRepositoryTask) {
+ Set<ITask> subTasks = ((AbstractRepositoryTask) parent).getChildren();
for (ITask t : subTasks) {
if (!filter(parent, t)) {
children.add(t);
@@ -242,29 +240,11 @@ public class TaskListContentProvider implements IStructuredContentProvider, ITre
}
return children;
}
-// else if (parent instanceof AbstractQueryHit) {
-// AbstractRepositoryTask task = ((AbstractQueryHit)
-// parent).getCorrespondingTask();
-// if (task != null) {
-// for (ITask t : task.getChildren()) {
-// if (!filter(parent, t)) {
-// children.add(t);
-// }
-// }
-// }
-// return children;
-// }
} else {
List<ITaskListElement> children = new ArrayList<ITaskListElement>();
- if (parent instanceof AbstractRepositoryQuery) {
- children.addAll(((AbstractRepositoryQuery) parent).getHits());
- return children;
- } else if (parent instanceof AbstractTaskContainer) {
+ if (parent instanceof AbstractTaskContainer) {
children.addAll(((AbstractTaskContainer) parent).getChildren());
return children;
- } else if (parent instanceof Task) {
- children.addAll(((Task) parent).getChildren());
- return children;
}
}
return Collections.emptyList();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
index 104a471fb..7e9da852b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListDropAdapter.java
@@ -32,13 +32,12 @@ import org.eclipse.mylyn.internal.tasks.ui.RetrieveTitleFromUrlJob;
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskActivateAction;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylyn.tasks.core.DateRangeContainer;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskCategory;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TaskListManager;
import org.eclipse.mylyn.tasks.ui.TaskTransfer;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
@@ -54,7 +53,7 @@ import org.eclipse.swt.dnd.TransferData;
*/
public class TaskListDropAdapter extends ViewerDropAdapter {
- private Task newTask = null;
+ private AbstractRepositoryTask newTask = null;
private TransferData currentTransfer;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryTaskPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskPage.java
index 437059e1e..8a38e941e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryTaskPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskPage.java
@@ -21,9 +21,9 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
* @author Mik Kersten
* @author Eugene Kuleshov
*/
-public class NewRepositoryTaskPage extends SelectRepositoryPage {
+public class NewTaskPage extends SelectRepositoryPage {
- public NewRepositoryTaskPage(TaskRepositoryFilter taskRepositoryFilter) {
+ public NewTaskPage(TaskRepositoryFilter taskRepositoryFilter) {
super(taskRepositoryFilter);
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskWizard.java
index c5c5c1eee..18d068b68 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewTaskWizard.java
@@ -9,20 +9,22 @@
* University Of British Columbia - initial API and implementation
*******************************************************************************/
-package org.eclipse.mylyn.tasks.core;
+package org.eclipse.mylyn.internal.tasks.ui.wizards;
+import org.eclipse.mylyn.tasks.core.TaskRepositoryFilter;
/**
* @author Mik Kersten
+ * @author Eugene Kuleshov
+ * @author Steffen Pingel
*/
-public abstract class Task extends AbstractTaskContainer implements ITask {
+public class NewTaskWizard extends MultiRepositoryAwareWizard {
- public Task(String handleAndDescription) {
- super(handleAndDescription);
- // ignore
+ private static final String TITLE = "New Task";
+
+ public NewTaskWizard() {
+ super(new NewTaskPage(TaskRepositoryFilter.CAN_CREATE_NEW_TASK), TITLE);
+ setNeedsProgressMonitor(true);
}
-// private static final String REPOSITORY_KIND_LOCAL = "local";
-//
-// public static final String DEFAULT_TASK_KIND = "task";
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
index cede3010b..5ad745143 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskListManager.java
@@ -61,7 +61,6 @@ import org.eclipse.mylyn.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.tasks.core.ITaskListElement;
import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute;
import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.Task;
import org.eclipse.mylyn.tasks.core.TaskCategory;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -941,7 +940,7 @@ public class TaskListManager implements IPropertyChangeListener {
}
public boolean isOwnedByUser(ITask task) {
- if (task instanceof WebTask || (task instanceof Task && ((Task) task).isLocal())) {
+ if (task instanceof WebTask || (task instanceof AbstractRepositoryTask && ((AbstractRepositoryTask) task).isLocal())) {
return true;
}

Back to the top