Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListManagerTest.java125
-rw-r--r--org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.pde.prefs6
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml26
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ScheduledTaskListRefreshJob.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/SynchronizeReportsAction.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/AddRepositoryAction.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/OpenTaskListElementAction.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskRepositoryLabelProvider.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractRepositoryClientWizard.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddExistingTaskWizard.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddRepositoryWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/EditRepositoryWizard.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewQueryWizard.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryClientPage.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryPage.java28
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/TaskDataImportWizard.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListExtensionReader.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListSaveManager.java44
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListWriter.java29
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryClient.java117
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/MylarTaskListPlugin.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/TaskRepositoryManager.java38
25 files changed, 259 insertions, 282 deletions
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 722d52f65..2372d45db 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
@@ -25,9 +25,11 @@ import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants;
+import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaQueryHit;
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryQuery;
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaTask;
import org.eclipse.mylar.internal.tasklist.ScheduledTaskListRefreshJob;
+import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
import org.eclipse.mylar.provisional.tasklist.ITask;
@@ -73,25 +75,25 @@ public class TaskListManagerTest extends TestCase {
File legacyListFile = new File("temptasklist.xml");
legacyListFile.deleteOnExit();
TaskTestUtil.copy(TaskTestUtil.getLocalFile("testdata/legacy/tasklist_0_4_8.xml"), legacyListFile);
-
+
assertEquals(362445, legacyListFile.length());
assertTrue(legacyListFile.exists());
-
+
manager.setTaskListFile(legacyListFile);
manager.readExistingOrCreateNewList();
manager.setTaskListFile(originalFile);
-
+
Set<ITask> allTasks = manager.getTaskList().getAllTasks();
Set<ITask> allRootTasks = manager.getTaskList().getRootTasks();
Set<ITaskContainer> allCategories = manager.getTaskList().getCategories();
- Set<ITaskListElement> allRoots = manager.getTaskList().getRootElements();
+ Set<ITaskListElement> allRoots = manager.getTaskList().getRootElements();
assertEquals(0, allRootTasks.size());
-
+
manager.saveTaskList();
TaskList list = new TaskList();
manager.setTaskList(list);
manager.readExistingOrCreateNewList();
-
+
assertEquals(allRootTasks.size(), manager.getTaskList().getRootTasks().size());
assertEquals(allCategories, manager.getTaskList().getCategories());
assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size());
@@ -102,15 +104,15 @@ public class TaskListManagerTest extends TestCase {
list = new TaskList();
manager.setTaskList(list);
manager.readExistingOrCreateNewList();
-
+
assertEquals(allRootTasks.size(), manager.getTaskList().getRootTasks().size());
assertEquals(allCategories, manager.getTaskList().getCategories());
assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size());
assertEquals(allTasks.size(), manager.getTaskList().getAllTasks().size());
-
+
manager.deactivateTask(manager.getTaskList().getActiveTask());
}
-
+
public void testRepositoryUrlHandles() {
String repository = IBugzillaConstants.ECLIPSE_BUGZILLA_URL;
@@ -136,7 +138,7 @@ public class TaskListManagerTest extends TestCase {
Task task1 = new Task("t1", "t1", true);
manager.moveToRoot(task1);
assertEquals(1, manager.getTaskList().getRootTasks().size());
- assertEquals(TaskList.LABEL_ROOT, task1.getCategory().getHandleIdentifier());
+ assertEquals(TaskList.LABEL_ROOT, task1.getCategory().getHandleIdentifier());
TaskCategory cat1 = new TaskCategory("c1");
manager.addCategory(cat1);
@@ -173,9 +175,9 @@ public class TaskListManagerTest extends TestCase {
TaskList list = new TaskList();
assertTrue(list.isEmpty());
list.internalAddRootTask(new Task("", "", true));
- assertFalse(list.isEmpty());
+ assertFalse(list.isEmpty());
}
-
+
public void testCategories() {
BugzillaTask task = new BugzillaTask("b1", "b 1", true);
TaskCategory category = new TaskCategory("cat");
@@ -186,8 +188,8 @@ public class TaskListManagerTest extends TestCase {
TaskList list = new TaskList();
manager.setTaskList(list);
manager.readExistingOrCreateNewList();
- assertEquals(2, manager.getTaskList().getCategories().size());
- assertEquals(1, manager.getTaskList().getAllTasks().size());
+ assertEquals(2, manager.getTaskList().getCategories().size());
+ assertEquals(1, manager.getTaskList().getAllTasks().size());
}
public void testDelete() {
@@ -197,7 +199,7 @@ public class TaskListManagerTest extends TestCase {
manager.deleteTask(task);
assertEquals(0, manager.getTaskList().getAllTasks().size());
}
-
+
public void testBugzillaCustomQueryExternalization() {
BugzillaRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1");
query.setCustomQuery(true);
@@ -209,10 +211,10 @@ public class TaskListManagerTest extends TestCase {
manager.setTaskList(list);
manager.readExistingOrCreateNewList();
assertEquals(1, manager.getTaskList().getQueries().size());
- BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery)manager.getTaskList().getQueries().get(0);
+ BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery) manager.getTaskList().getQueries().get(0);
assertTrue(readQuery.isCustomQuery());
}
-
+
public void testQueryExternalization() {
AbstractRepositoryQuery query = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", "label", "1");
assertEquals("repositoryUrl", query.getRepositoryUrl());
@@ -234,17 +236,17 @@ public class TaskListManagerTest extends TestCase {
BugzillaTask repositoryTask = new BugzillaTask("handle", "label", true);
repositoryTask.setKind("kind");
manager.getTaskList().addTaskToArchive(repositoryTask);
-// repositoryTask.setCategory(manager.getTaskList().getArchiveCategory());
+ // repositoryTask.setCategory(manager.getTaskList().getArchiveCategory());
assertEquals(1, manager.getTaskList().getArchiveTasks().size());
assertEquals(0, manager.getTaskList().getRootTasks().size());
manager.saveTaskList();
-
+
manager.setTaskList(new TaskList());
manager.readExistingOrCreateNewList();
assertEquals(1, manager.getTaskList().getArchiveTasks().size());
assertEquals(0, manager.getTaskList().getRootTasks().size());
}
-
+
public void testRepositoryTaskExternalization() {
BugzillaTask repositoryTask = new BugzillaTask("handle", "label", true);
repositoryTask.setKind("kind");
@@ -255,8 +257,9 @@ public class TaskListManagerTest extends TestCase {
manager.setTaskList(list);
manager.readExistingOrCreateNewList();
assertEquals(1, manager.getTaskList().getRootTasks().size());
- AbstractRepositoryTask readTask = (AbstractRepositoryTask)manager.getTaskList().getRootTasks().iterator().next();
-
+ AbstractRepositoryTask readTask = (AbstractRepositoryTask) manager.getTaskList().getRootTasks().iterator()
+ .next();
+
assertEquals(repositoryTask.getHandleIdentifier(), readTask.getHandleIdentifier());
assertEquals(repositoryTask.getDescription(), readTask.getDescription());
assertEquals(repositoryTask.getKind(), readTask.getKind());
@@ -281,23 +284,23 @@ public class TaskListManagerTest extends TestCase {
Iterator<TaskCategory> iterator = readCats.iterator();
TaskCategory readCat1 = iterator.next();
assertEquals(cat1, readCat1);
- assertEquals(1, readCat1.getChildren().size());
-
+ assertEquals(1, readCat1.getChildren().size());
+
manager.saveTaskList();
- assertNotNull(manager.getTaskList());
+ assertNotNull(manager.getTaskList());
manager.setTaskList(new TaskList());
manager.readExistingOrCreateNewList();
// read again
readCats = manager.getTaskList().getTaskCategories();
assertTrue(manager.getTaskList().getCategories().contains(cat1));
-
+
iterator = readCats.iterator();
readCat1 = iterator.next();
assertEquals(cat1, readCat1);
assertEquals(1, readCat1.getChildren().size());
}
-
+
public void testCreationAndExternalization() {
Set<ITask> rootTasks = new HashSet<ITask>();
Task task1 = new Task(manager.genUniqueTaskHandle(), "task 1", true);
@@ -335,7 +338,7 @@ public class TaskListManagerTest extends TestCase {
manager.moveToRoot(reportInRoot);
rootTasks.add(reportInRoot);
- assertEquals(""+ manager.getTaskList().getRootElements(), 5, manager.getTaskList().getRootElements().size());
+ assertEquals("" + manager.getTaskList().getRootElements(), 5, manager.getTaskList().getRootElements().size());
manager.saveTaskList();
assertNotNull(manager.getTaskList());
@@ -344,13 +347,13 @@ public class TaskListManagerTest extends TestCase {
manager.readExistingOrCreateNewList();
assertNotNull(manager.getTaskList());
- assertEquals(rootTasks, manager.getTaskList().getRootTasks());
-
+ assertEquals(rootTasks, manager.getTaskList().getRootTasks());
+
Set<ITask> readList = manager.getTaskList().getRootTasks();
for (ITask task : readList) {
if (task.equals(task1)) {
assertEquals(task1.getDescription(), task.getDescription());
- assertEquals(1, task.getChildren().size());
+ assertEquals(1, task.getChildren().size());
}
if (task.equals(reportInRoot)) {
assertEquals(reportInRoot.getDescription(), task.getDescription());
@@ -370,7 +373,63 @@ public class TaskListManagerTest extends TestCase {
ScheduledTaskListRefreshJob job = new ScheduledTaskListRefreshJob(500, manager);
job.run(new NullProgressMonitor());
Thread.sleep(1500);
- assertEquals(counter, job.getCount());
+ assertEquals(counter, job.getCount());
}
-
+
+ public void testgetQueriesAndHitsForHandle() {
+
+ BugzillaQueryHit hit1 = new BugzillaQueryHit("description1", "P1", "repositoryURL", 1, null, "status");
+ BugzillaQueryHit hit2 = new BugzillaQueryHit("description2", "P1", "repositoryURL", 2, null, "status");
+ BugzillaQueryHit hit3 = new BugzillaQueryHit("description3", "P1", "repositoryURL", 3, null, "status");
+
+ BugzillaQueryHit hit1twin = new BugzillaQueryHit("description1", "P1", "repositoryURL", 1, null, "status");
+ BugzillaQueryHit hit2twin = new BugzillaQueryHit("description2", "P1", "repositoryURL", 2, null, "status");
+ BugzillaQueryHit hit3twin = new BugzillaQueryHit("description3", "P1", "repositoryURL", 3, null, "status");
+
+ AbstractRepositoryQuery query1 = new AbstractRepositoryQuery() {
+ @Override
+ public String getRepositoryKind() {
+ // ignore
+ return "newkind";
+ }
+ };
+
+ AbstractRepositoryQuery query2 = new AbstractRepositoryQuery() {
+ @Override
+ public String getRepositoryKind() {
+ // ignore
+ return "newkind";
+ }
+ };
+
+ query1.addHit(hit1);
+ query1.addHit(hit2);
+ query1.addHit(hit3);
+ assertEquals(query1.getHits().size(), 3);
+
+ query2.addHit(hit1twin);
+ query2.addHit(hit2twin);
+ query2.addHit(hit3twin);
+ assertEquals(query2.getHits().size(), 3);
+
+ manager.addQuery(query1);
+ manager.addQuery(query2);
+
+ TaskList taskList = manager.getTaskList();
+ Set<AbstractRepositoryQuery> queriesReturned = taskList.getQueriesForHandle(AbstractRepositoryTask.getHandle(
+ "repositoryURL", 1));
+ assertNotNull(queriesReturned);
+ assertEquals(queriesReturned.size(), 2);
+ assertTrue(queriesReturned.contains(query1));
+ assertTrue(queriesReturned.contains(query2));
+
+ Set<AbstractQueryHit> hitsReturned = taskList.getQueryHitsForHandle(AbstractRepositoryTask.getHandle(
+ "repositoryURL", 2));
+ assertNotNull(hitsReturned);
+ assertEquals(hitsReturned.size(), 2);
+ assertTrue(hitsReturned.contains(hit2));
+ assertTrue(hitsReturned.contains(hit2twin));
+
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.pde.prefs
index eeef52acb..3076fc847 100644
--- a/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.pde.prefs
+++ b/org.eclipse.mylyn.tasks.ui/.settings/org.eclipse.pde.prefs
@@ -1,11 +1,11 @@
-#Tue Feb 21 19:27:12 PST 2006
+#Thu Feb 16 13:46:11 PST 2006
compilers.p.build=1
compilers.p.deprecated=2
compilers.p.no-required-att=0
compilers.p.not-externalized-att=2
-compilers.p.unknown-attribute=1
+compilers.p.unknown-attribute=0
compilers.p.unknown-class=0
-compilers.p.unknown-element=1
+compilers.p.unknown-element=0
compilers.p.unknown-resource=0
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
index e01ee6a7a..176b01be4 100644
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Mylar TaskList Plug-in
Bundle-SymbolicName: org.eclipse.mylar.tasklist; singleton:=true
-Bundle-Version: 0.4.8.v20060221-1550
+Bundle-Version: 0.4.9
Bundle-Activator: org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
index 32c339664..51e5551b5 100644
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ b/org.eclipse.mylyn.tasks.ui/plugin.xml
@@ -90,7 +90,7 @@
name="Task Repositories">
</view>
</extension>
-
+
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
<viewShortcut id="org.eclipse.mylar.tasks.ui.views.TaskListView"/>
@@ -156,6 +156,17 @@
targetID="org.eclipse.mylar.tasks.ui.views.TaskListView">
<action
+ class="org.eclipse.mylar.internal.tasklist.ui.actions.NewRepositoryTaskAction"
+ enablesFor="*"
+ icon="icons/etool16/task-repository-new.gif"
+ id="org.eclipse.mylar.bugzilla.tasklist.addNew"
+ label="New Repository Task"
+ style="push"
+ toolbarPath="reports"
+ tooltip="New Repository Task">
+ </action>
+
+ <action
class="org.eclipse.mylar.internal.tasklist.ui.SynchronizeReportsAction"
enablesFor="*"
icon="icons/etool16/repository-synchronize.gif"
@@ -182,7 +193,18 @@
label="Add Existing Repository Task"
style="push"
tooltip="Add Repository Task">
- </action>
+ </action>
+
+ <action
+ class="org.eclipse.mylar.internal.tasklist.ui.actions.NewRepositoryTaskAction"
+ enablesFor="*"
+ icon="icons/etool16/task-repository-new.gif"
+ id="org.eclipse.mylar.bugzilla.tasklist.popup.addNew"
+ label="New Repository Task"
+ menubarPath="reports"
+ tooltip="New Repository Task"/>
+
+
<action
class="org.eclipse.mylar.internal.tasklist.ui.actions.NewQueryAction"
enablesFor="*"
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ScheduledTaskListRefreshJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ScheduledTaskListRefreshJob.java
index 1148fd29e..07117f52c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ScheduledTaskListRefreshJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ScheduledTaskListRefreshJob.java
@@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskList;
@@ -55,9 +55,9 @@ public class ScheduledTaskListRefreshJob extends Job {
List<AbstractRepositoryQuery> queries = Collections.unmodifiableList(taskList.getQueries());
for (AbstractRepositoryQuery query : queries) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
query.getRepositoryKind());
- client.synchronize(query);
+ connector.synchronize(query);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/SynchronizeReportsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/SynchronizeReportsAction.java
index 390b73b60..dd9a79c4e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/SynchronizeReportsAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/SynchronizeReportsAction.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
import org.eclipse.mylar.provisional.tasklist.ITask;
@@ -53,31 +53,31 @@ public class SynchronizeReportsAction extends Action implements IViewActionDeleg
@Override
public void run() {
if (query != null) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(query.getRepositoryKind());
- if (client != null) client.synchronize(query);
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(query.getRepositoryKind());
+ if (connector != null) connector.synchronize(query);
} else if (TaskListView.getDefault() != null) {
ISelection selection = TaskListView.getDefault().getViewer().getSelection();
for (Object obj : ((IStructuredSelection) selection).toList()) {
if (obj instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery repositoryQuery = (AbstractRepositoryQuery) obj;
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(repositoryQuery.getRepositoryKind());
+ AbstractRepositoryConnector client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(repositoryQuery.getRepositoryKind());
if (client != null) client.synchronize(repositoryQuery);
} else if (obj instanceof TaskCategory) {
TaskCategory cat = (TaskCategory) obj;
for (ITask task : cat.getChildren()) {
if (task instanceof AbstractRepositoryTask) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(task.getRepositoryKind());
+ AbstractRepositoryConnector client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(task.getRepositoryKind());
if (client != null) client.requestRefresh((AbstractRepositoryTask)task);
}
}
} else if (obj instanceof AbstractRepositoryTask) {
AbstractRepositoryTask bugTask = (AbstractRepositoryTask)obj;
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(bugTask.getRepositoryKind());
+ AbstractRepositoryConnector client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(bugTask.getRepositoryKind());
if (client != null) client.requestRefresh(bugTask);
} else if (obj instanceof AbstractQueryHit) {
AbstractQueryHit hit = (AbstractQueryHit) obj;
if (hit.getCorrespondingTask() != null) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(hit.getCorrespondingTask().getRepositoryKind());
+ AbstractRepositoryConnector client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(hit.getCorrespondingTask().getRepositoryKind());
if (client != null) client.requestRefresh(hit.getCorrespondingTask());
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/AddRepositoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/AddRepositoryAction.java
index 50cee6384..b77703e6d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/AddRepositoryAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/AddRepositoryAction.java
@@ -47,6 +47,7 @@ public class AddRepositoryAction extends Action {
if (wizard != null && shell != null && !shell.isDisposed()) {
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
+ dialog.getShell().setText("Add New Task Repository");
// dialog.getShell().setText("Mylar Tasks");
dialog.setBlockOnOpen(true);
if (dialog.open() == Dialog.CANCEL) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/OpenTaskListElementAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/OpenTaskListElementAction.java
index 38dfe1e37..2769aebe6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/OpenTaskListElementAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/actions/OpenTaskListElementAction.java
@@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.mylar.internal.tasklist.ui.TaskListUiUtil;
import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
import org.eclipse.mylar.provisional.tasklist.ITask;
import org.eclipse.mylar.provisional.tasklist.ITaskContainer;
@@ -58,10 +58,10 @@ public class OpenTaskListElementAction extends Action {
//element instanceof IQueryHit;
boolean forceUpdate = false;
- final AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ final AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
task.getRepositoryKind());
- if (!task.isLocal() && client != null) {
- Job refreshJob = client.synchronize(task, forceUpdate, new IJobChangeListener() {
+ if (!task.isLocal() && connector != null) {
+ Job refreshJob = connector.synchronize(task, forceUpdate, new IJobChangeListener() {
public void done(IJobChangeEvent event) {
TaskListUiUtil.openEditor(task);
@@ -97,7 +97,7 @@ public class OpenTaskListElementAction extends Action {
TaskListUiUtil.openEditor((ITaskContainer) element);
} else if (element instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) element;
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
query.getRepositoryKind());
client.openEditQueryDialog(query);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
index 7195a5b45..bcd96cd4e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
@@ -103,7 +103,6 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.dialogs.FilteredTree;
import org.eclipse.ui.part.DrillDownAdapter;
import org.eclipse.ui.part.PluginTransfer;
import org.eclipse.ui.part.ViewPart;
@@ -1326,7 +1325,7 @@ public class TaskListView extends ViewPart {
}
- public FilteredTree getFilteredTree() {
+ public TaskListFilteredTree getFilteredTree() {
return filteredTree;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskRepositoryLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskRepositoryLabelProvider.java
index b2037d68f..c0dcc2dea 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskRepositoryLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskRepositoryLabelProvider.java
@@ -14,7 +14,7 @@ package org.eclipse.mylar.internal.tasklist.ui.views;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.mylar.internal.tasklist.ui.TaskListImages;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
import org.eclipse.swt.graphics.Image;
@@ -28,8 +28,8 @@ public class TaskRepositoryLabelProvider extends LabelProvider implements ITable
if (object instanceof TaskRepository) {
TaskRepository repository = (TaskRepository) object;
return repository.getKind() + ": " + repository.getUrl().toExternalForm();
- } else if (object instanceof AbstractRepositoryClient) {
- return ((AbstractRepositoryClient)object).getLabel();
+ } else if (object instanceof AbstractRepositoryConnector) {
+ return ((AbstractRepositoryConnector)object).getLabel();
} else {
return getText(object);
}
@@ -40,8 +40,8 @@ public class TaskRepositoryLabelProvider extends LabelProvider implements ITable
}
public Image getImage(Object object) {
- if (object instanceof AbstractRepositoryClient) {
- AbstractRepositoryClient repositoryClient = (AbstractRepositoryClient)object;
+ if (object instanceof AbstractRepositoryConnector) {
+ AbstractRepositoryConnector repositoryClient = (AbstractRepositoryConnector)object;
Image image = MylarTaskListPlugin.getDefault().getBrandingIcons().get(repositoryClient);
if (image != null) {
return image;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java
index fd0c40d01..b562353eb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.ITask;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskCategory;
@@ -36,9 +36,9 @@ public abstract class AbstractAddExistingTaskWizard extends Wizard {
@Override
public final boolean performFinish() {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
this.repository.getKind());
- ITask newTask = client.createTaskFromExistingId(repository, getTaskId());
+ ITask newTask = connector.createTaskFromExistingId(repository, getTaskId());
if (newTask != null && TaskListView.getDefault() != null) {
Object selectedObject = ((IStructuredSelection) TaskListView.getDefault().getViewer().getSelection())
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractRepositoryClientWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractRepositoryClientWizard.java
index af2c33a22..d32b6ed9d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractRepositoryClientWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractRepositoryClientWizard.java
@@ -12,7 +12,7 @@
package org.eclipse.mylar.internal.tasklist.ui.wizards;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.ui.INewWizard;
/**
@@ -24,13 +24,13 @@ public abstract class AbstractRepositoryClientWizard extends Wizard implements I
protected AbstractRepositorySettingsPage abstractRepositorySettingsPage;
- protected AbstractRepositoryClient repositoryClient;
+ protected AbstractRepositoryConnector repositoryClient;
- public void setRepositoryClient(AbstractRepositoryClient repository) {
+ public void setRepositoryClient(AbstractRepositoryConnector repository) {
this.repositoryClient = repository;
}
- public AbstractRepositoryClient getRepositoryClient() {
+ public AbstractRepositoryConnector getRepositoryClient() {
return repositoryClient;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddExistingTaskWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddExistingTaskWizard.java
index 7202fe62d..4f9ef99fa 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddExistingTaskWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddExistingTaskWizard.java
@@ -12,7 +12,7 @@
package org.eclipse.mylar.internal.tasklist.ui.wizards;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
@@ -27,11 +27,14 @@ public class AddExistingTaskWizard extends MultiRepositoryAwareWizard {
@Override
protected IWizard createWizard(TaskRepository taskRepository) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
taskRepository.getKind());
- return client.getAddExistingTaskWizard(taskRepository);
+ if (connector.canCreateTaskFromId()) {
+ return connector.getAddExistingTaskWizard(taskRepository);
+ } else {
+ return null;
+ }
}
-
});
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddRepositoryWizard.java
index 1c4af901b..9db45940e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AddRepositoryWizard.java
@@ -32,7 +32,7 @@ public class AddRepositoryWizard extends AbstractRepositoryClientWizard {
@Override
public boolean performFinish() {
if (canFinish()) {
- TaskRepository repository = new TaskRepository(repositoryClient.getKind(),
+ TaskRepository repository = new TaskRepository(repositoryClient.getRepositoryType(),
super.abstractRepositorySettingsPage.getServerUrl());
if (repository != null) {
repository.setAuthenticationCredentials(abstractRepositorySettingsPage.getUserName(),
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/EditRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/EditRepositoryWizard.java
index 533cf4f1d..a14e56562 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/EditRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/EditRepositoryWizard.java
@@ -13,7 +13,7 @@ package org.eclipse.mylar.internal.tasklist.ui.wizards;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
import org.eclipse.ui.INewWizard;
@@ -32,9 +32,9 @@ public class EditRepositoryWizard extends Wizard implements INewWizard {
super();
oldRepository = repository;
// super.setForcePreviousAndNextButtons(true);
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
repository.getKind());
- abstractRepositorySettingsPage = client.getSettingsPage();
+ abstractRepositorySettingsPage = connector.getSettingsPage();
abstractRepositorySettingsPage.setRepository(repository);
abstractRepositorySettingsPage.setWizard(this);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewQueryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewQueryWizard.java
index c07cd29df..33a8b7593 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewQueryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/NewQueryWizard.java
@@ -12,7 +12,7 @@
package org.eclipse.mylar.internal.tasklist.ui.wizards;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
@@ -26,9 +26,9 @@ public class NewQueryWizard extends MultiRepositoryAwareWizard {
@Override
protected IWizard createWizard(TaskRepository taskRepository) {
- AbstractRepositoryClient client = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryClient(
taskRepository.getKind());
- return client.getQueryWizard(taskRepository);
+ return connector.getQueryWizard(taskRepository);
}
});
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryClientPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryClientPage.java
index d5e541c49..410dae054 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryClientPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryClientPage.java
@@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylar.internal.tasklist.ui.views.TaskRepositoryLabelProvider;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
@@ -78,8 +78,8 @@ public class SelectRepositoryClientPage extends WizardPage {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- if (selection.getFirstElement() instanceof AbstractRepositoryClient) {
- wizard.setRepositoryClient((AbstractRepositoryClient) selection.getFirstElement());
+ if (selection.getFirstElement() instanceof AbstractRepositoryConnector) {
+ wizard.setRepositoryClient((AbstractRepositoryConnector) selection.getFirstElement());
SelectRepositoryClientPage.this.setPageComplete(true);
wizard.getContainer().updateButtons();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryPage.java
index 7ad30b039..0b8a59902 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/SelectRepositoryPage.java
@@ -11,13 +11,15 @@
package org.eclipse.mylar.internal.tasklist.ui.wizards;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizard;
@@ -45,7 +47,7 @@ public abstract class SelectRepositoryPage extends WizardSelectionPage {
protected MultiRepositoryAwareWizard wizard;
- private String repositoryKind = null;
+ private List<String> repositoryKinds = null;
class RepositoryContentProvider implements IStructuredContentProvider {
@@ -56,8 +58,12 @@ public abstract class SelectRepositoryPage extends WizardSelectionPage {
}
public Object[] getElements(Object parent) {
- if (repositoryKind != null) {
- return MylarTaskListPlugin.getRepositoryManager().getRepositories(repositoryKind).toArray();
+ if (repositoryKinds != null) {
+ List<TaskRepository> repositories = new ArrayList<TaskRepository>();
+ for (String repositoryKind : repositoryKinds) {
+ repositories.addAll(MylarTaskListPlugin.getRepositoryManager().getRepositories(repositoryKind));
+ }
+ return repositories.toArray();
} else {
return MylarTaskListPlugin.getRepositoryManager().getAllRepositories().toArray();
}
@@ -70,9 +76,9 @@ public abstract class SelectRepositoryPage extends WizardSelectionPage {
setDescription(DESCRIPTION);
}
- public SelectRepositoryPage(String repositoryKind) {
+ public SelectRepositoryPage(List<String> repositoryKinds) {
this();
- this.repositoryKind = repositoryKind;
+ this.repositoryKinds = repositoryKinds;
}
public void createControl(Composite parent) {
@@ -104,11 +110,11 @@ public abstract class SelectRepositoryPage extends WizardSelectionPage {
});
viewer.getTable().setFocus();
- TaskRepository defaultRepository = MylarTaskListPlugin.getRepositoryManager().getDefaultRepository(
- repositoryKind);
- if (defaultRepository != null) {
- viewer.setSelection(new StructuredSelection(defaultRepository));
- }
+// TaskRepository defaultRepository = MylarTaskListPlugin.getRepositoryManager().getDefaultRepository(
+// repositoryKind);
+// if (defaultRepository != null) {
+// viewer.setSelection(new StructuredSelection(defaultRepository));
+// }
setControl(container);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/TaskDataImportWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/TaskDataImportWizard.java
index 73d1d0da9..ed927793a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/TaskDataImportWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/TaskDataImportWizard.java
@@ -115,6 +115,7 @@ public class TaskDataImportWizard extends Wizard implements IImportWizard {
if (!sourceZipFile.exists()) {
MessageDialog
.openError(getShell(), "File not found", sourceZipFile.toString() + " could not be found.");
+ return false;
}
Enumeration entries;
@@ -170,10 +171,8 @@ public class TaskDataImportWizard extends Wizard implements IImportWizard {
// Get file paths to check for existence
String sourceDir = importPage.getSourceDirectory();
sourceDirFile = new File(sourceDir);
- if (!sourceDirFile.exists() || !sourceDirFile.isDirectory()) {
- // This should never happen
- MylarStatusHandler.fail(new Exception("File Import Exception"),
- "Could not import data because specified location does not exist or is not a folder", true);
+ if (!sourceDirFile.exists() || !sourceDirFile.isDirectory()) {
+ MessageDialog.openError(getShell(), "Location not found", sourceZipFile.toString() + " could not be found or is not a folder.");
return false;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListExtensionReader.java
index db67c183a..fa946a14d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListExtensionReader.java
@@ -24,7 +24,7 @@ import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.internal.tasklist.ui.IDynamicSubMenuContributor;
import org.eclipse.mylar.internal.tasklist.ui.ITaskEditorFactory;
import org.eclipse.mylar.internal.tasklist.ui.TaskListImages;
-import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryClient;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.ITaskListExternalizer;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -151,19 +151,18 @@ public class TaskListExtensionReader {
try {
Object type = element.getAttribute(ELMNT_TYPE);
Object repository = element.createExecutableExtension(ATTR_CLASS);
- if (repository instanceof AbstractRepositoryClient && type != null) {
- MylarTaskListPlugin.getRepositoryManager().addRepositoryClient((AbstractRepositoryClient) repository);
+ if (repository instanceof AbstractRepositoryConnector && type != null) {
+ MylarTaskListPlugin.getRepositoryManager().addRepositoryClient((AbstractRepositoryConnector) repository);
String iconPath = element.getAttribute(ATTR_BRANDING_ICON);
if (iconPath != null) {
-
- ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespace(),
- iconPath);
-
+
// ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(),
// iconPath);
+ ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespace(),
+ iconPath);
if (descriptor != null) {
- MylarTaskListPlugin.getDefault().getBrandingIcons().put((AbstractRepositoryClient) repository, TaskListImages.getImage(descriptor));
+ MylarTaskListPlugin.getDefault().getBrandingIcons().put((AbstractRepositoryConnector) repository, TaskListImages.getImage(descriptor));
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListSaveManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListSaveManager.java
index 8cc1a7694..fbf351eab 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListSaveManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListSaveManager.java
@@ -40,6 +40,8 @@ public class TaskListSaveManager implements ITaskActivityListener, DisposeListen
private static final String FILE_SUFFIX_BACKUP = "-backup.xml";
private BackgroundSaveTimer saveTimer = null;
+
+ private boolean initializationWarningDialogShow = false;
/**
* Fort testing.
@@ -49,23 +51,13 @@ public class TaskListSaveManager implements ITaskActivityListener, DisposeListen
public TaskListSaveManager() {
saveTimer = new BackgroundSaveTimer(this);
saveTimer.setSaveIntervalMillis(DEFAULT_SAVE_INTERVAL);
- saveTimer.start();
+ saveTimer.start();
}
/**
* Called periodically by the save timer
*/
public void saveRequested() {
- if (!MylarTaskListPlugin.getDefault().isInitialized()) {
- if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getDisplay() != null) {
- MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), MylarTaskListPlugin.TITLE_DIALOG,
- "If task list is blank, Mylar Task List may have failed to initialize.\n\n" +
- "First, try restarting to see if that corrects the problem.\n\n" +
- "Then, check the Error Log view for messages, and the FAQ for solutions.\n\n" +
- MylarTaskListPlugin.URL_HOMEPAGE);
- }
- }
-
if (MylarTaskListPlugin.getDefault() != null && MylarTaskListPlugin.getDefault().isShellActive()
|| forceBackgroundSave) {
try {
@@ -76,15 +68,33 @@ public class TaskListSaveManager implements ITaskActivityListener, DisposeListen
}
}
- public void saveTaskListAndContexts() {
- if (MylarTaskListPlugin.getDefault() != null) {
+ public void saveTaskListAndContexts() {
+ if (MylarTaskListPlugin.getDefault() != null && MylarTaskListPlugin.getDefault().isInitialized()) {
MylarTaskListPlugin.getTaskListManager().saveTaskList();
- for (ITask task : new ArrayList<ITask>(MylarTaskListPlugin.getTaskListManager().getTaskList().getActiveTasks())) {
+ for (ITask task : new ArrayList<ITask>(MylarTaskListPlugin.getTaskListManager().getTaskList()
+ .getActiveTasks())) {
MylarPlugin.getContextManager().saveContext(task.getHandleIdentifier());
}
+ } else {
+ MylarStatusHandler.log("Possible task list initialization failure, not saving list.", this);
+ if (PlatformUI.getWorkbench() != null && !initializationWarningDialogShow) {
+ initializationWarningDialogShow = true;
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getDisplay() != null) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ MylarTaskListPlugin.TITLE_DIALOG,
+ "If task list is blank, Mylar Task List may have failed to initialize.\n\n"
+ + "First, try restarting to see if that corrects the problem.\n\n"
+ + "Then, check the Error Log view for messages, and the FAQ for solutions.\n\n"
+ + MylarTaskListPlugin.URL_HOMEPAGE);
+ }
+ }
+ });
+ }
}
}
-
+
/**
* Copies all files in the current data directory to the specified folder.
* Will overwrite.
@@ -163,9 +173,9 @@ public class TaskListSaveManager implements ITaskActivityListener, DisposeListen
}
public void repositoryInfoChanged(ITask task) {
- // ignore
+ // ignore
}
-
+
public void tasklistRead() {
// ignore
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListWriter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListWriter.java
index 5a2460d1b..94d9c6b65 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListWriter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/util/TaskListWriter.java
@@ -100,13 +100,18 @@ public class TaskListWriter {
for (AbstractRepositoryQuery query : taskList.getQueries()) {
Element element = null;
- for (ITaskListExternalizer externalizer : externalizers) {
- if (externalizer.canCreateElementFor(query))
- element = externalizer.createQueryElement(query, doc, root);
- }
- if (element == null && delagatingExternalizer.canCreateElementFor(query)) {
- delagatingExternalizer.createQueryElement(query, doc, root);
- } else if (element == null) {
+ try {
+ for (ITaskListExternalizer externalizer : externalizers) {
+ if (externalizer.canCreateElementFor(query))
+ element = externalizer.createQueryElement(query, doc, root);
+ }
+ if (element == null && delagatingExternalizer.canCreateElementFor(query)) {
+ delagatingExternalizer.createQueryElement(query, doc, root);
+ }
+ } catch (Throwable t) {
+ MylarStatusHandler.fail(t, "Did not externalize: " + query.getDescription(), true);
+ }
+ if (element == null) {
MylarStatusHandler.log("Did not externalize: " + query, this);
}
}
@@ -115,13 +120,6 @@ public class TaskListWriter {
createTaskElement(doc, root, task);
}
-// for (ITask task : taskList.getArchiveTasks()) {
-// createTaskElement(doc, root, task);
-// }
-
-// for (ITask task : taskList.getRootTasks()) {
-// createTaskElement(doc, root, task);
-// }
doc.appendChild(root);
writeDOMtoFile(doc, outFile);
return;
@@ -307,16 +305,13 @@ public class TaskListWriter {
// A factory API that enables applications to obtain a parser
// that produces DOM object trees from XML documents
- //
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// Using DocumentBuilder, obtain a Document from XML file.
- //
DocumentBuilder builder = null;
Document document = null;
try {
// create new instance of DocumentBuilder
- //
builder = factory.newDocumentBuilder();
} catch (ParserConfigurationException pce) {
inputFile.renameTo(new File(inputFile.getName() + FILE_SUFFIX_SAVE));
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryClient.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryClient.java
deleted file mode 100644
index e7e65401e..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryClient.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * 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.mylar.provisional.tasklist;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractRepositorySettingsPage;
-
-/**
- * @author Mik Kersten
- */
-public abstract class AbstractRepositoryClient {
-
- private static final int MAX_REFRESH_JOBS = 5;
-
-// private TaskCategory archiveCategory = null;
-
- private List<AbstractRepositoryTask> toBeRefreshed = new LinkedList<AbstractRepositoryTask>();
-
- private Map<AbstractRepositoryTask, Job> currentlyRefreshing = new HashMap<AbstractRepositoryTask, Job>();
-
- public void requestRefresh(AbstractRepositoryTask task) {
- if (!currentlyRefreshing.containsKey(task) && !toBeRefreshed.contains(task)) {
- toBeRefreshed.add(task);
- }
- updateRefreshState();
- }
-
- public void removeTaskToBeRefreshed(AbstractRepositoryTask task) {
- toBeRefreshed.remove(task);
- if (currentlyRefreshing.get(task) != null) {
- currentlyRefreshing.get(task).cancel();
- currentlyRefreshing.remove(task);
- }
- updateRefreshState();
- }
-
- public void removeRefreshingTask(AbstractRepositoryTask task) {
- if (currentlyRefreshing.containsKey(task)) {
- currentlyRefreshing.remove(task);
- }
- updateRefreshState();
- }
-
- public void clearAllRefreshes() {
- toBeRefreshed.clear();
- List<Job> l = new ArrayList<Job>();
- l.addAll(currentlyRefreshing.values());
- for (Job j : l) {
- if (j != null)
- j.cancel();
- }
- currentlyRefreshing.clear();
- }
-
- private void updateRefreshState() {
- if (currentlyRefreshing.size() < MAX_REFRESH_JOBS && toBeRefreshed.size() > 0) {
- AbstractRepositoryTask bugzillaTask = toBeRefreshed.remove(0);
- Job refreshJob = synchronize(bugzillaTask, true, null);
- if (refreshJob != null) {
- currentlyRefreshing.put(bugzillaTask, refreshJob);
- }
- }
- }
-
- public abstract String getLabel();
-
- /**
- * @return the unique type of the repository, e.g. "bugzilla"
- */
- public abstract String getKind();
-
- /**
- * @param id
- * identifier, e.g. "123" bug Bugzilla bug 123
- * @return null if task could not be created
- */
- public abstract ITask createTaskFromExistingId(TaskRepository repository, String id);
-
- /**
- * Synchronize state with the repository (e.g. queries, task contents)
- */
- public abstract void synchronize();
-
- /**
- * @param listener can be null
- * @return TODO
- */
- public abstract Job synchronize(ITask task, boolean forceUpdate, IJobChangeListener listener);
-
- public abstract void synchronize(AbstractRepositoryQuery repositoryQuery);
-
- public abstract AbstractRepositorySettingsPage getSettingsPage();
-
- public abstract IWizard getQueryWizard(TaskRepository repository);
-
- public abstract void openEditQueryDialog(AbstractRepositoryQuery query);
-
- public abstract IWizard getAddExistingTaskWizard(TaskRepository repository);
-
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/MylarTaskListPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/MylarTaskListPlugin.java
index c8268eba4..c6058b737 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/MylarTaskListPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/MylarTaskListPlugin.java
@@ -66,7 +66,7 @@ public class MylarTaskListPlugin extends AbstractUIPlugin implements IStartup {
private static TaskRepositoryManager taskRepositoryManager;
- private TaskListSaveManager taskListSaveManager = new TaskListSaveManager();
+ private TaskListSaveManager taskListSaveManager;
private TaskListRefreshManager taskListRefreshManager;
@@ -94,7 +94,7 @@ public class MylarTaskListPlugin extends AbstractUIPlugin implements IStartup {
private boolean initialized = false;
- private Map<AbstractRepositoryClient, Image> brandingIcons = new HashMap<AbstractRepositoryClient, Image>();
+ private Map<AbstractRepositoryConnector, Image> brandingIcons = new HashMap<AbstractRepositoryConnector, Image>();
public enum TaskListSaveMode {
ONE_HOUR, THREE_HOURS, DAY;
@@ -284,14 +284,12 @@ public class MylarTaskListPlugin extends AbstractUIPlugin implements IStartup {
taskRepositoryManager.readRepositories();
taskListManager.addListener(CONTEXT_TASK_ACTIVITY_LISTENER);
- taskListManager.addListener(taskListSaveManager);
-
taskListManager.readExistingOrCreateNewList();
initialized = true;
migrateHandlesToRepositorySupport();
if (getPrefs().getBoolean(TaskListPreferenceConstants.REPOSITORY_SYNCH_ON_STARTUP)) {
- for (AbstractRepositoryClient repositoryClient : taskRepositoryManager.getRepositoryClients()) {
+ for (AbstractRepositoryConnector repositoryClient : taskRepositoryManager.getRepositoryClients()) {
repositoryClient.synchronize();
}
}
@@ -305,6 +303,9 @@ public class MylarTaskListPlugin extends AbstractUIPlugin implements IStartup {
taskListRefreshManager = new TaskListRefreshManager();
taskListRefreshManager.startRefreshJob();
+ taskListSaveManager = new TaskListSaveManager();
+ taskListManager.addListener(taskListSaveManager);
+
MylarPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(PREFERENCE_LISTENER);
getPrefs().addPropertyChangeListener(taskListRefreshManager);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().addDisposeListener(
@@ -575,14 +576,14 @@ public class MylarTaskListPlugin extends AbstractUIPlugin implements IStartup {
return taskRepositoryManager;
}
- public Map<AbstractRepositoryClient, Image> getBrandingIcons() {
+ public Map<AbstractRepositoryConnector, Image> getBrandingIcons() {
return brandingIcons;
}
public boolean isInitialized() {
return initialized;
}
-}
+}
// /**
// * Sets the directory containing the task list file to use.
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/TaskRepositoryManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/TaskRepositoryManager.java
index dfa49cd5d..ffa6131ff 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/TaskRepositoryManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/TaskRepositoryManager.java
@@ -33,7 +33,7 @@ public class TaskRepositoryManager {
public static final String PREF_REPOSITORIES = "org.eclipse.mylar.tasklist.repositories.";
- private Map<String, AbstractRepositoryClient> repositoryClients = new HashMap<String, AbstractRepositoryClient>();
+ private Map<String, AbstractRepositoryConnector> repositoryClients = new HashMap<String, AbstractRepositoryConnector>();
private Map<String, Set<TaskRepository>> repositoryMap = new HashMap<String, Set<TaskRepository>>();
@@ -51,21 +51,21 @@ public class TaskRepositoryManager {
private static final String PREF_STORE_DELIM = ", ";
- public Collection<AbstractRepositoryClient> getRepositoryClients() {
+ public Collection<AbstractRepositoryConnector> getRepositoryClients() {
return Collections.unmodifiableCollection(repositoryClients.values());
}
- public AbstractRepositoryClient getRepositoryClient(String kind) {
+ public AbstractRepositoryConnector getRepositoryClient(String kind) {
return repositoryClients.get(kind);
}
- public void addRepositoryClient(AbstractRepositoryClient repositoryClient) {
+ public void addRepositoryClient(AbstractRepositoryConnector repositoryClient) {
if (!repositoryClients.values().contains(repositoryClient)) {
- repositoryClients.put(repositoryClient.getKind(), repositoryClient);
+ repositoryClients.put(repositoryClient.getRepositoryType(), repositoryClient);
}
}
- public void removeRepositoryClient(AbstractRepositoryClient repositoryClient) {
+ public void removeRepositoryClient(AbstractRepositoryConnector repositoryClient) {
repositoryClients.remove(repositoryClient);
}
@@ -118,9 +118,9 @@ public class TaskRepositoryManager {
public List<TaskRepository> getAllRepositories() {
List<TaskRepository> repositories = new ArrayList<TaskRepository>();
- for (AbstractRepositoryClient repositoryClient : repositoryClients.values()) {
- if (repositoryMap.containsKey(repositoryClient.getKind())) {
- repositories.addAll(repositoryMap.get(repositoryClient.getKind()));
+ for (AbstractRepositoryConnector repositoryClient : repositoryClients.values()) {
+ if (repositoryMap.containsKey(repositoryClient.getRepositoryType())) {
+ repositories.addAll(repositoryMap.get(repositoryClient.getRepositoryType()));
}
}
return repositories;
@@ -162,8 +162,8 @@ public class TaskRepositoryManager {
}
public Map<String, Set<TaskRepository>> readRepositories() {
- for (AbstractRepositoryClient repositoryClient : repositoryClients.values()) {
- String read = MylarTaskListPlugin.getPrefs().getString(PREF_REPOSITORIES + repositoryClient.getKind());
+ for (AbstractRepositoryConnector repositoryClient : repositoryClients.values()) {
+ String read = MylarTaskListPlugin.getPrefs().getString(PREF_REPOSITORIES + repositoryClient.getRepositoryType());
Set<TaskRepository> repositories = new HashSet<TaskRepository>();
if (read != null) {
StringTokenizer st = new StringTokenizer(read, PREF_STORE_DELIM);
@@ -171,8 +171,8 @@ public class TaskRepositoryManager {
String urlString = st.nextToken();
try {
URL url = new URL(urlString);
- repositoryMap.put(repositoryClient.getKind(), repositories);
- repositories.add(new TaskRepository(repositoryClient.getKind(), url));
+ repositoryMap.put(repositoryClient.getRepositoryType(), repositories);
+ repositories.add(new TaskRepository(repositoryClient.getRepositoryType(), url));
} catch (MalformedURLException e) {
MylarStatusHandler.fail(e, "could not restore URL: " + urlString, false);
}
@@ -186,13 +186,13 @@ public class TaskRepositoryManager {
}
private void saveRepositories() {
- for (AbstractRepositoryClient repositoryClient : repositoryClients.values()) {
- if (repositoryMap.containsKey(repositoryClient.getKind())) {
+ for (AbstractRepositoryConnector repositoryClient : repositoryClients.values()) {
+ if (repositoryMap.containsKey(repositoryClient.getRepositoryType())) {
String repositoriesToStore = "";
- for (TaskRepository repository : repositoryMap.get(repositoryClient.getKind())) {
+ for (TaskRepository repository : repositoryMap.get(repositoryClient.getRepositoryType())) {
repositoriesToStore += repository.getUrl().toExternalForm() + PREF_STORE_DELIM;
}
- String prefId = PREF_REPOSITORIES + repositoryClient.getKind();
+ String prefId = PREF_REPOSITORIES + repositoryClient.getRepositoryType();
MylarTaskListPlugin.getPrefs().setValue(prefId, repositoriesToStore);
}
}
@@ -207,8 +207,8 @@ public class TaskRepositoryManager {
*/
public void clearRepositories() {
repositoryMap.clear();
- for (AbstractRepositoryClient repositoryClient : repositoryClients.values()) {
- String prefId = PREF_REPOSITORIES + repositoryClient.getKind();
+ for (AbstractRepositoryConnector repositoryClient : repositoryClients.values()) {
+ String prefId = PREF_REPOSITORIES + repositoryClient.getRepositoryType();
MylarTaskListPlugin.getPrefs().setValue(prefId, "");
}
}

Back to the top