/*
  * (non-Javadoc)
  *
  * @see org.eclipse.jst.pagedesigner.properties.attrgroup.IElementContextable#setElementContext(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode,
  *      org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement)
  */
 public void setElementContext(IDOMNode ancester, IDOMElement element) {
   if (ancester == null) {
     setProject(null);
     setReferredFile(null);
   } else {
     IDOMModel model = ancester.getModel();
     IFile file = StructuredModelUtil.getFileFor(model);
     IProject prj = (file == null ? null : file.getProject());
     setProject(prj);
     setReferredFile(file);
   }
 }
 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;
 }