return;
}
final IFile selectedFile = (IFile)resource;
final IEditorReference[] editorReferences = aPage.getEditorReferences();
for (int i = 0; i < editorReferences.length; i++) {
final IEditorReference reference = editorReferences[i];
if (reference==null) {
continue;
}
final IEditorInput editorInput;
try {
editorInput = reference.getEditorInput();
} catch (PartInitException e) {
//TODO proper logging
e.printStackTrace();
continue;
}
if (editorInput==null) {
continue;
}
if (!(editorInput instanceof IFileEditorInput)) {
continue;
}
final IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
final IFile file = fileEditorInput.getFile();
if (file==null) {
continue;
}
if (file.equals(selectedFile)) {
aPage.bringToTop(reference.getEditor(true));
}
}
}