public boolean isShownInEditor(Match match, IEditorPart editor) { Object element = match.getElement(); if (element instanceof IDOMNode) { // DOMNode matched IDOMNode node = (IDOMNode) element; IStructuredModel editorModel = (IStructuredModel) editor.getAdapter(IStructuredModel.class); if (editorModel != null) { // Returns true if found node belong to the current XML editor // which // has launched the search and false otherwise. return editorModel.equals(node.getModel()); } } return false; }