if (page != null) {
IEditorReference[] references = page.getEditorReferences();
for (int i = 0; i < references.length; i++) {
IEditorPart part = references[i].getEditor(false);
if (part != null && part instanceof XMLMultiPageEditorPart) {
XMLMultiPageEditorPart editor = (XMLMultiPageEditorPart) part;
IEditorInput editorInput = editor.getEditorInput();
if (editorInput != null
&& editorInput instanceof IFileEditorInput) {
IResource resource = ((IFileEditorInput) editorInput)
.getFile();
IModelElement modelElement = BeansModelUtils
.getResourceModelElement(resource);
if (modelElement != null
&& element.getHandleIdentifier().equals(
modelElement.getElementID())) {
editor.dispose();
}
}
}
}
}