summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-01-31 16:32:22 (EST)
committerSteffen Pingel2012-01-31 16:37:56 (EST)
commit701c0f4d1ee46a6df3f4c6b1d08bd1f27f47969e (patch)
treeddca8ec481e00bc5790c15b6271be21150cc3961
parent97fa0d622ae5d53c449e4050e453cf44b9ea2597 (diff)
downloadorg.eclipse.mylyn.tasks-701c0f4d1ee46a6df3f4c6b1d08bd1f27f47969e.zip
org.eclipse.mylyn.tasks-701c0f4d1ee46a6df3f4c6b1d08bd1f27f47969e.tar.gz
org.eclipse.mylyn.tasks-701c0f4d1ee46a6df3f4c6b1d08bd1f27f47969e.tar.bz2
NEW - bug 346046: [api] provide an extension point for registering URL
handlers (was: Hyperlinks to builds should open in task editor) https://bugs.eclipse.org/bugs/show_bug.cgi?id=346046 Change-Id: I1a8ef457435453a53dae53756be5109e75d50213
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java21
1 files changed, 21 insertions, 0 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 3876fa2..fd30b8f 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
@@ -23,6 +23,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.commons.workbench.EditorHandle;
import org.eclipse.mylyn.commons.workbench.browser.BrowserUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
@@ -30,6 +31,8 @@ import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenEvent;
+import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenListener;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesView;
import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
@@ -369,6 +372,24 @@ public class TasksUiUtil {
}
/**
+ * @since 3.7
+ */
+ public static EditorHandle openTaskWithResult(TaskRepository repository, String taskId) {
+ Assert.isNotNull(repository);
+ Assert.isNotNull(taskId);
+ final EditorHandle handle = new EditorHandle();
+ boolean opened = TasksUiInternal.openTask(repository, taskId, new TaskOpenListener() {
+ @Override
+ public void taskOpened(TaskOpenEvent event) {
+ handle.setPart(event.getEditor());
+ handle.setItem(event.getTask());
+ handle.setStatus(Status.OK_STATUS);
+ }
+ });
+ return (opened) ? handle : null;
+ }
+
+ /**
* @since 3.0
*/
public static void openUrl(String location) {