Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Dos Santos2014-04-28 16:43:48 -0400
committerSam Davis2014-05-06 19:37:51 -0400
commit155dcd67532d50d9b35249be09a5ea3788cf2d37 (patch)
treea80bd06c82f253070d9b54c50aeb2e582b7b0318
parent572047efc509fffef7b1cdc3def9e1483e3a641a (diff)
downloadorg.eclipse.mylyn.tasks-155dcd67532d50d9b35249be09a5ea3788cf2d37.tar.gz
org.eclipse.mylyn.tasks-155dcd67532d50d9b35249be09a5ea3788cf2d37.tar.xz
org.eclipse.mylyn.tasks-155dcd67532d50d9b35249be09a5ea3788cf2d37.zip
433719: Request for AbstractRepositoryConnector.getBrowseableUrl()
Change-Id: I8b19972eb4ac1091e221a41bfd50cd30187980ce Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=433719 Signed-off-by: Leo Dos Santos <leo.dos.santos@tasktop.com>
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java17
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java4
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java42
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/AbstractRepositoryConnectorTest.java52
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/MockRepositoryConnectorTestCase.java141
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java22
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java52
7 files changed, 319 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
index f9fd5247a..d89fc5e02 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java
@@ -377,6 +377,23 @@ public abstract class AbstractRepositoryConnector {
}
/**
+ * Returns a browsable URL for <code>element</code>.
+ * <p>
+ * Returns <code>null</code> by default. Clients may override.
+ *
+ * @param repository
+ * the repository for <code>element</code>
+ * @param element
+ * the element to return the url for
+ * @return null, if no corresponding URL is available for <code>element</code>; the URL otherwise
+ * @since 3.12
+ */
+ @Nullable
+ public URL getBrowserUrl(@NonNull TaskRepository repository, @NonNull IRepositoryElement element) {
+ return null;
+ }
+
+ /**
* Returns <code>true</code>, if the state in <code>taskData</code> is different than the state stored in
* <code>task</code>.
* <p>
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
index 176d26f7f..2729cb6a5 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
@@ -17,6 +17,7 @@ import junit.framework.TestSuite;
import org.eclipse.mylyn.commons.sdk.util.ManagedTestSuite;
import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.tasks.tests.bugs.SupportHandlerManagerTest;
+import org.eclipse.mylyn.tasks.tests.core.AbstractRepositoryConnectorTest;
import org.eclipse.mylyn.tasks.tests.core.FileTaskAttachmentSourceTest;
import org.eclipse.mylyn.tasks.tests.core.ITasksCoreConstantsTest;
import org.eclipse.mylyn.tasks.tests.core.PriorityLevelTest;
@@ -43,11 +44,11 @@ import org.eclipse.mylyn.tasks.tests.ui.TaskListSynchronizationSchedulerTest;
import org.eclipse.mylyn.tasks.tests.ui.TaskListViewTest;
import org.eclipse.mylyn.tasks.tests.ui.TaskRelationHyperlinkDetectorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.AttachmentTableLabelProviderTest;
-import org.eclipse.mylyn.tasks.tests.ui.editor.TaskEditorExtensionsTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.EditorUtilTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.PlanningPartTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.RegionComparatorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.RepositoryCompletionProcessorTest;
+import org.eclipse.mylyn.tasks.tests.ui.editor.TaskEditorExtensionsTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.TaskEditorPartDescriptorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.TaskMigratorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.TaskUrlHyperlinkDetectorTest;
@@ -164,6 +165,7 @@ public class AllTasksTests {
suite.addTestSuite(TaskInitializationDataTest.class);
suite.addTestSuite(TaskDataDiffTest.class);
suite.addTestSuite(TaskEditorExtensionsTest.class);
+ suite.addTestSuite(AbstractRepositoryConnectorTest.class);
}
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
index f29dad897..9b6bad614 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
@@ -11,6 +11,9 @@
package org.eclipse.mylyn.tasks.tests;
+import java.net.MalformedURLException;
+import java.net.URL;
+
import junit.framework.TestCase;
import org.eclipse.mylyn.commons.ui.ClipboardCopier;
@@ -18,6 +21,8 @@ import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction.Mode;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockTask;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -89,4 +94,41 @@ public class CopyDetailsActionTest extends TestCase {
}
}
+ public void testGetBrowseableUrl() {
+ MockTask task = new MockTask("123");
+ task.setSummary("Ticket 123");
+ MockRepositoryConnector connector = new MockRepositoryConnector() {
+
+ @Override
+ public String getTaskUrl(String repositoryUrl, String taskId) {
+ return "URI://mock-repo/id/123";
+ }
+
+ @Override
+ public URL getBrowserUrl(TaskRepository repository, IRepositoryElement element) {
+ try {
+ return new URL("http://mock-repo-evolved.com/tickets/123");
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ };
+
+ AbstractRepositoryConnector oldConnector = TasksUi.getRepositoryManager().getRepositoryConnector(
+ MockRepositoryConnector.CONNECTOR_KIND);
+ try {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
+ assertEquals("123: Ticket 123" + ClipboardCopier.LINE_SEPARATOR
+ + "http://mock-repo-evolved.com/tickets/123",
+ CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ assertEquals("http://mock-repo-evolved.com/tickets/123",
+ CopyTaskDetailsAction.getTextForTask(task, Mode.URL));
+ } finally {
+ if (oldConnector != null) {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(oldConnector);
+ }
+ }
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/AbstractRepositoryConnectorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/AbstractRepositoryConnectorTest.java
new file mode 100644
index 000000000..c7b4d190c
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/AbstractRepositoryConnectorTest.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.tests.core;
+
+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.tests.connector.MockTask;
+import org.eclipse.mylyn.tasks.tests.util.MockRepositoryConnectorTestCase;
+
+public class AbstractRepositoryConnectorTest extends MockRepositoryConnectorTestCase {
+
+ public void testGetTaskUrl() {
+ assertEquals("http://mock-repo.com/tickets/123",
+ connectorWithUrl.getTaskUrl(repositoryWithUrl.getRepositoryUrl(), taskWithUrl.getTaskId()));
+ assertEquals(
+ "URI://mock-repo/id/123",
+ connectorWithBrowserUrl.getTaskUrl(repositoryWithBrowserUrl.getRepositoryUrl(),
+ taskWithBrowserUrl.getTaskId()));
+ }
+
+ public void testGetBrowserUrl() {
+ assertNull(connectorWithUrl.getBrowserUrl(repositoryWithUrl, taskWithUrl));
+ assertEquals("http://mock-repo-evolved.com/tickets/123",
+ connectorWithBrowserUrl.getBrowserUrl(repositoryWithBrowserUrl, taskWithBrowserUrl).toString());
+ }
+
+ public void testGetTaskByUrl() {
+ MockTask taskWithBrowserUrl2 = createMockTaskForRepository(repositoryWithBrowserUrl, "234");
+ TasksUiPlugin.getTaskList().addTask(taskWithBrowserUrl2);
+
+ MockTask taskWithUrl2 = createMockTaskForRepository(repositoryWithUrl, "234");
+ TasksUiPlugin.getTaskList().addTask(taskWithUrl2);
+
+ assertEquals(taskWithBrowserUrl2, TasksUiInternal.getTaskByUrl("http://mock-repo-evolved.com/tickets/234"));
+ assertEquals(taskWithUrl2, TasksUiInternal.getTaskByUrl("http://mock-repo.com/tickets/234"));
+ assertEquals(taskWithUrl, TasksUiInternal.getTaskByUrl("http://mock-repo.com/tickets/123"));
+ assertEquals(taskWithBrowserUrl, TasksUiInternal.getTaskByUrl("http://mock-repo-evolved.com/tickets/123"));
+ assertEquals(taskWithBrowserUrl, TasksUiInternal.getTaskByUrl("URI://mock-repo/id/123"));
+ assertNull(TasksUiInternal.getTaskByUrl(null));
+ assertNull(TasksUiInternal.getTaskByUrl(""));
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/MockRepositoryConnectorTestCase.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/MockRepositoryConnectorTestCase.java
new file mode 100644
index 000000000..0ade95344
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/util/MockRepositoryConnectorTestCase.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Tasktop Technologies 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.tests.util;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryElement;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
+import org.eclipse.mylyn.tasks.tests.connector.MockTask;
+
+public class MockRepositoryConnectorTestCase extends TestCase {
+
+ protected AbstractRepositoryConnector connectorWithUrl;
+
+ protected AbstractRepositoryConnector connectorWithBrowserUrl;
+
+ protected TaskRepository repositoryWithUrl;
+
+ protected TaskRepository repositoryWithBrowserUrl;
+
+ protected MockTask taskWithUrl;
+
+ protected MockTask taskWithBrowserUrl;
+
+ protected class MockRepositoryWithUrl extends MockRepositoryConnector {
+
+ public static final String CONNECTOR_KIND = "mock-with-url";
+
+ public static final String REPOSITORY_URL = "http://mock-repo.com";
+
+ @Override
+ public String getConnectorKind() {
+ return CONNECTOR_KIND;
+ }
+
+ @Override
+ public String getTaskUrl(String repositoryUrl, String taskId) {
+ return repositoryUrl + "/tickets/" + taskId;
+ }
+
+ }
+
+ protected class MockRepositoryWithBrowserUrl extends MockRepositoryConnector {
+
+ public static final String CONNECTOR_KIND = "mock-with-browser";
+
+ public static final String REPOSITORY_URL = "http://mock-repo-evolved.com";
+
+ @Override
+ public String getConnectorKind() {
+ return CONNECTOR_KIND;
+ }
+
+ @Override
+ public String getTaskUrl(String repositoryUrl, String taskId) {
+ return "URI://mock-repo/id/" + taskId;
+ }
+
+ @Override
+ public URL getBrowserUrl(TaskRepository repository, IRepositoryElement element) {
+ if (element instanceof ITask) {
+ try {
+ return new URL(repository.getRepositoryUrl() + "/tickets/" + ((ITask) element).getTaskId());
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ }
+
+ protected MockTask createMockTaskForRepository(final TaskRepository repository, String taskId) {
+ return new MockTask(repository.getRepositoryUrl(), taskId) {
+
+ @Override
+ public String getConnectorKind() {
+ return repository.getConnectorKind();
+ }
+
+ @Override
+ public String getUrl() {
+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
+ getConnectorKind());
+ return connector.getTaskUrl(getRepositoryUrl(), getTaskId());
+ }
+
+ };
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
+ connectorWithUrl = new MockRepositoryWithUrl();
+ connectorWithBrowserUrl = new MockRepositoryWithBrowserUrl();
+
+ manager.addRepositoryConnector(connectorWithUrl);
+ manager.addRepositoryConnector(connectorWithBrowserUrl);
+
+ repositoryWithUrl = new TaskRepository(MockRepositoryWithUrl.CONNECTOR_KIND,
+ MockRepositoryWithUrl.REPOSITORY_URL);
+ repositoryWithBrowserUrl = new TaskRepository(MockRepositoryWithBrowserUrl.CONNECTOR_KIND,
+ MockRepositoryWithBrowserUrl.REPOSITORY_URL);
+
+ manager.addRepository(repositoryWithUrl);
+ manager.addRepository(repositoryWithBrowserUrl);
+
+ taskWithUrl = createMockTaskForRepository(repositoryWithUrl, "123");
+ TasksUiPlugin.getTaskList().addTask(taskWithUrl);
+
+ taskWithBrowserUrl = createMockTaskForRepository(repositoryWithBrowserUrl, "123");
+ TasksUiPlugin.getTaskList().addTask(taskWithBrowserUrl);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
+ manager.removeRepository(repositoryWithUrl);
+ manager.removeRepository(repositoryWithBrowserUrl);
+ manager.removeRepositoryConnector(MockRepositoryWithUrl.CONNECTOR_KIND);
+ manager.removeRepositoryConnector(MockRepositoryWithBrowserUrl.CONNECTOR_KIND);
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
index 742056a8e..3f6829ba5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyTaskDetailsAction.java
@@ -11,13 +11,17 @@
package org.eclipse.mylyn.internal.tasks.ui.actions;
+import java.net.URL;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.commons.ui.ClipboardCopier;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
@@ -143,12 +147,20 @@ public class CopyTaskDetailsAction extends BaseSelectionListenerAction {
}
private static String getUrl(IRepositoryElement element) {
- if (element.getUrl() != null) {
- return element.getUrl();
- } else if (element instanceof ITask) {
+ if (element instanceof ITask) {
ITask task = (ITask) element;
- return TasksUi.getRepositoryConnector(task.getConnectorKind()).getTaskUrl(task.getRepositoryUrl(),
- task.getTaskId());
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(task.getConnectorKind());
+ TaskRepository repository = TasksUiInternal.getRepository(task);
+ URL location = connector.getBrowserUrl(repository, element);
+ if (location != null) {
+ return location.toString();
+ } else if (task.getUrl() != null) {
+ return task.getUrl();
+ } else {
+ return connector.getTaskUrl(task.getRepositoryUrl(), task.getTaskId());
+ }
+ } else if (element.getUrl() != null) {
+ return element.getUrl();
}
return null;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
index e2f3ed054..8202af336 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java
@@ -145,6 +145,9 @@ import org.eclipse.ui.statushandlers.IStatusAdapterConstants;
import org.eclipse.ui.statushandlers.StatusAdapter;
import org.eclipse.ui.statushandlers.StatusManager;
+import com.google.common.base.Strings;
+import com.google.common.collect.Ordering;
+
/**
* @author Steffen Pingel
*/
@@ -1195,16 +1198,55 @@ public class TasksUiInternal {
* @return first task with a matching URL.
*/
public static AbstractTask getTaskByUrl(String taskUrl) {
- Collection<AbstractTask> tasks = TasksUiPlugin.getTaskList().getAllTasks();
- for (AbstractTask task : tasks) {
- String currUrl = task.getUrl();
- if (currUrl != null && !currUrl.equals("") && currUrl.equals(taskUrl)) { //$NON-NLS-1$
- return task;
+ if (!Strings.isNullOrEmpty(taskUrl)) {
+ Collection<AbstractTask> tasks = TasksUiPlugin.getTaskList().getAllTasks();
+ List<AbstractTask> sortedTasks = sortTasksByRepositoryUrl(tasks);
+
+ AbstractRepositoryConnector connector = null;
+ TaskRepository repository = null;
+
+ for (AbstractTask task : sortedTasks) {
+ if (taskUrl.equals(task.getUrl())) {
+ return task;
+ } else {
+ String repositoryUrl = task.getRepositoryUrl();
+ if (repositoryUrl != null) {
+ if (repository == null || !repositoryUrl.equals(repository.getUrl())) {
+ connector = TasksUi.getRepositoryManager().getRepositoryConnector(task.getConnectorKind());
+ repository = getRepository(task);
+ }
+
+ if (connector != null) {
+ URL url = connector.getBrowserUrl(repository, task);
+ if (url != null && taskUrl.equals(url.toString())) {
+ return task;
+ }
+ }
+ }
+ }
}
}
return null;
}
+ private static List<AbstractTask> sortTasksByRepositoryUrl(Collection<AbstractTask> tasks) {
+ List<AbstractTask> sortedTasks = new Ordering<AbstractTask>() {
+
+ @Override
+ public int compare(AbstractTask left, AbstractTask right) {
+ if (left.getRepositoryUrl() == null) {
+ return 1;
+ }
+ if (right.getRepositoryUrl() == null) {
+ return -1;
+ }
+ return left.getRepositoryUrl().compareTo(right.getRepositoryUrl());
+ }
+
+ }.nullsLast().sortedCopy(tasks);
+ return sortedTasks;
+ }
+
public static boolean isTaskUrl(String taskUrl) {
Assert.isNotNull(taskUrl);
List<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories();

Back to the top