Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-02-16 20:53:31 +0000
committermkersten2007-02-16 20:53:31 +0000
commit3e36455c555fec53dacd9e3a48bd72970dafa5fa (patch)
tree11c92bf6172bb8fe72c83734bd3e28c97492e6e5
parent0a1942ddf958105e092e32750eb431e540a2b3ed (diff)
downloadorg.eclipse.mylyn.tasks-3e36455c555fec53dacd9e3a48bd72970dafa5fa.tar.gz
org.eclipse.mylyn.tasks-3e36455c555fec53dacd9e3a48bd72970dafa5fa.tar.xz
org.eclipse.mylyn.tasks-3e36455c555fec53dacd9e3a48bd72970dafa5fa.zip
NEW - bug 166174: invalid handle for task, can not contain: -, was: MNGECLIPSE-9
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166174
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index dce19f243..a3a0af6b9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -136,12 +136,13 @@ public class TasksUiUtil {
public static boolean openRepositoryTask(String repositoryUrl, String taskId, String fullUrl) {
boolean opened = false;
ITask task = null;
- if (taskId != null) {
- task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repositoryUrl, taskId);
- }
- if (task == null) {
+ // TODO: move, must current be first due to JIRA Connector use of key
+ if (fullUrl != null) {
task = TasksUiPlugin.getTaskListManager().getTaskList().getRepositoryTask(fullUrl);
}
+ if (task == null && taskId != null) {
+ task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repositoryUrl, taskId);
+ }
if (task != null) {
TasksUiUtil.refreshAndOpenTaskListElement(task);
@@ -201,14 +202,19 @@ public class TasksUiUtil {
repositoryTask.setTaskData(TasksUiPlugin.getDefault().getTaskDataManager()
.getRepositoryTaskData(repositoryTask.getHandleIdentifier()));
}
-
TasksUiUtil.openEditor(task, true, false);
+ TasksUiPlugin.getSynchronizationManager().setTaskRead(repositoryTask, true);
TasksUiPlugin.getSynchronizationManager().synchronize(connector, repositoryTask, false, null);
} else {
Job refreshJob = TasksUiPlugin.getSynchronizationManager().synchronize(connector,
repositoryTask, true, new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
+ // Mark read here too so that hits get
+ // marked as read upon opening
+ // TODO: if synch job failed, don't mark
+ // read
+ TasksUiPlugin.getSynchronizationManager().setTaskRead(repositoryTask, true);
TasksUiUtil.openEditor(task, false);
}
});
@@ -264,22 +270,14 @@ public class TasksUiUtil {
TaskEditor taskEditor = (TaskEditor) part;
taskEditor.setFocusOfActivePage();
}
- if (task instanceof AbstractRepositoryTask) {
- TasksUiPlugin.getSynchronizationManager().setTaskRead((AbstractRepositoryTask) task, true);
- }
}
}
});
} else {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
- final IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- openEditor(editorInput, TaskListPreferenceConstants.TASK_EDITOR_ID, page);
- if (task instanceof AbstractRepositoryTask) {
- TasksUiPlugin.getSynchronizationManager().setTaskRead((AbstractRepositoryTask) task, true);
- }
- }
+ IWorkbenchPage page = window.getActivePage();
+ openEditor(editorInput, TaskListPreferenceConstants.TASK_EDITOR_ID, page);
} else {
MylarStatusHandler.log("Unable to open editor for " + task.getSummary(), TasksUiUtil.class);
}

Back to the top