Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-06-08 14:26:36 -0400
committerspingel2010-06-08 14:26:36 -0400
commit9f1f53d0d2295b4bca5f55b37f423673c1e6fd1a (patch)
tree87ebec55406c8d88f72691da1a6276315e7dd6c7 /org.eclipse.mylyn.tasks.ui
parentb2bacb722951ddfc3eca3035367d894818aa883c (diff)
downloadorg.eclipse.mylyn.tasks-9f1f53d0d2295b4bca5f55b37f423673c1e6fd1a.tar.gz
org.eclipse.mylyn.tasks-9f1f53d0d2295b4bca5f55b37f423673c1e6fd1a.tar.xz
org.eclipse.mylyn.tasks-9f1f53d0d2295b4bca5f55b37f423673c1e6fd1a.zip
RESOLVED - bug 296963: [api] allow different URL's for opening task in browser and copying task details
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296963
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiInternal.java44
1 files changed, 19 insertions, 25 deletions
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 09657b6b9..ae637056a 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
@@ -88,11 +88,11 @@ import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
-import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentSource;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy;
@@ -862,9 +862,8 @@ public class TasksUiInternal {
if (window != null) {
TaskRepository taskRepository = TasksUi.getRepositoryManager().getRepository(task.getConnectorKind(),
task.getRepositoryUrl());
- boolean openWithBrowser = !TasksUiPlugin.getDefault()
- .getPreferenceStore()
- .getBoolean(ITasksUiPreferenceConstants.EDITOR_TASKS_RICH);
+ boolean openWithBrowser = !TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
+ ITasksUiPreferenceConstants.EDITOR_TASKS_RICH);
if (openWithBrowser) {
TasksUiUtil.openWithBrowser(taskRepository, task);
return new TaskOpenEvent(taskRepository, task, taskId, null, true);
@@ -1195,21 +1194,15 @@ public class TasksUiInternal {
TasksUiInternal.displayStatus(title, new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Command execution failed", e)); //$NON-NLS-1$
} catch (NotDefinedException e) {
- TasksUiInternal.displayStatus(
- title,
- new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind(
- "The command with the id ''{0}'' is not defined.", commandId), e)); //$NON-NLS-1$
+ TasksUiInternal.displayStatus(title, new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ NLS.bind("The command with the id ''{0}'' is not defined.", commandId), e)); //$NON-NLS-1$
} catch (NotHandledException e) {
- TasksUiInternal.displayStatus(
- title,
- new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind(
- "The command with the id ''{0}'' is not bound.", commandId), e)); //$NON-NLS-1$
+ TasksUiInternal.displayStatus(title, new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ NLS.bind("The command with the id ''{0}'' is not bound.", commandId), e)); //$NON-NLS-1$
}
} else {
- TasksUiInternal.displayStatus(
- title,
- new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind(
- "The command with the id ''{0}'' does not exist.", commandId))); //$NON-NLS-1$
+ TasksUiInternal.displayStatus(title, new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind(
+ "The command with the id ''{0}'' does not exist.", commandId))); //$NON-NLS-1$
}
} else {
TasksUiInternal.displayStatus(
@@ -1273,16 +1266,17 @@ public class TasksUiInternal {
public static String getAuthenticatedUrl(TaskRepository repository, IRepositoryElement element) {
IRepositoryManager repositoryManager = TasksUi.getRepositoryManager();
AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(repository.getConnectorKind());
- URL authenticatedUrl = connector.getAuthenticatedUrl(repository, element);
- if (authenticatedUrl != null) {
- return authenticatedUrl.toString();
- } else {
- String url = element.getUrl();
- if (TasksUiInternal.isValidUrl(url)) {
- return url;
+ if (connector != null) {
+ URL authenticatedUrl = connector.getAuthenticatedUrl(repository, element);
+ if (authenticatedUrl != null) {
+ return authenticatedUrl.toString();
+ } else {
+ String url = element.getUrl();
+ if (TasksUiInternal.isValidUrl(url)) {
+ return url;
+ }
}
}
return null;
}
-
}

Back to the top