Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-03-30 10:05:24 -0400
committerrelves2007-03-30 10:05:24 -0400
commit5762982c4efd2342db761373ed9b0f46619da374 (patch)
tree344460733f6989ff8652ee5625a19dd9e639b343
parent1102b9cd81fd116e8816e8ab97775d931004cc34 (diff)
downloadorg.eclipse.mylyn.tasks-5762982c4efd2342db761373ed9b0f46619da374.tar.gz
org.eclipse.mylyn.tasks-5762982c4efd2342db761373ed9b0f46619da374.tar.xz
org.eclipse.mylyn.tasks-5762982c4efd2342db761373ed9b0f46619da374.zip
NEW - bug 180071: Update resource discovery in TaskHyperlinkDetector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=180071
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
index 9813b866e..121f354ba 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskHyperlinkDetector.java
@@ -65,17 +65,21 @@ public class TaskHyperlinkDetector extends AbstractHyperlinkDetector {
}
private TaskRepository getRepository(ITextViewer textViewer) {
- if (textViewer instanceof RepositoryTextViewer) {
- RepositoryTextViewer viewer = (RepositoryTextViewer) textViewer;
- return viewer.getRepository();
- } else {
- IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- IEditorInput input = part.getEditorInput();
- IResource resource = (IResource) input.getAdapter(IResource.class);
- if (resource != null) {
- return TasksUiPlugin.getDefault().getRepositoryForResource(resource, true);
+ IResource resource = (IResource) getAdapter(IResource.class);
+ if (resource == null) {
+ if (textViewer instanceof RepositoryTextViewer) {
+ RepositoryTextViewer viewer = (RepositoryTextViewer) textViewer;
+ return viewer.getRepository();
+ } else {
+ IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .getActiveEditor();
+ IEditorInput input = part.getEditorInput();
+ resource = (IResource) input.getAdapter(IResource.class);
}
}
+ if (resource != null) {
+ return TasksUiPlugin.getDefault().getRepositoryForResource(resource, true);
+ }
return null;
}
}

Back to the top