
Home
.. Links
.. Search
.. Plugins
.. Help
.. Irc Faq
Projects
.. Platform/Faq
.. JDT/Faq/Plan
.. PDE/Faq
.. SWT/Faq
.. RCP/Faq
Tools Projects
.. CDT/Faq
.. GEF/Faq
.. EMF/Faq
Wiki Tutorials
Hosted Projects
.. MTJ
.. Google Summer Of Code 2007
.. Update Manager 2.0
.. EasyEclipse
.. Stylebase for Eclipse
Archives
| |
public IEditorPart findEditorFor(IFile file, IWorkbench workbench) {
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
for (int i = 0; i < windows.length; i++) { IWorkbenchPage[] pages = windows[i].getPages(); for (int x = 0; x < pages.length; x++) {
IEditorReference[] editors = pages[x].getEditorReferences();
for (int z = 0; z < editors.length; z++) {
IEditorReference ref = editors[z]; IEditorPart editor = ref.getEditor(true);
if (editor == null) { continue; }
IEditorInput input = editor.getEditorInput(); IFile editorFile = (IFile) input.getAdapter(IFile.class); if (editorFile != null && editorFile .equals(file)) return editor;
} } } return null; }
Last Modified 1/9/06 3:13 PM
| Hide Tools
|