diff options
author | Darin Wright | 2006-07-10 18:46:06 +0000 |
---|---|---|
committer | Darin Wright | 2006-07-10 18:46:06 +0000 |
commit | 6fa5eebf06a109dc437382a68c31639670800304 (patch) | |
tree | 477f4c471dbfacdba72a2a0ea99025b02ee39581 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java | |
parent | 57b0e08f33c0356d7c5f1828019d84dc7f92ec4f (diff) | |
download | eclipse.platform.debug-6fa5eebf06a109dc437382a68c31639670800304.tar.gz eclipse.platform.debug-6fa5eebf06a109dc437382a68c31639670800304.tar.xz eclipse.platform.debug-6fa5eebf06a109dc437382a68c31639670800304.zip |
Bug 149891 - SourceLookupFacility should use IEditorMatchingStrategy
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java index 9eb45d4f5..516b2620e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java @@ -259,27 +259,13 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro return null; } - // TODO: persist/restore the editor to use per page - if (fReuseEditor) { - editor = page.getActiveEditor(); - if (editor != null) { - // The active editor is the one we want to reuse - if (!(editor.getEditorInput().equals(input) && editor.getSite().getId().equals(id))) { - editor = null; - } - } - if (editor == null) { - // Try to find the editor we want to reuse and activate it - IEditorReference[] refs = page.getEditorReferences(); - for (int i = 0; i < refs.length; i++) { - IEditorPart refEditor= refs[i].getEditor(false); - if (refEditor != null && input.equals(refEditor.getEditorInput()) && refEditor.getSite().getId().equals(id)) { - editor = refEditor; - page.bringToTop(editor); - break; - } - } + IEditorReference[] references = page.findEditors(input, id, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT); + if (references.length > 0) { + // activate the editor we want to reuse + IEditorPart refEditor= references[0].getEditor(false); + editor = refEditor; + page.bringToTop(editor); } if (editor == null) { IEditorPart editorForPage = getEditor(page); |