Java 类com.intellij.util.xml.DomMetaData 实例源码

项目:intellij-ce-playground    文件:DomMetaDataContributor.java   
@Override
public void contributeMetaData(MetaDataRegistrar registrar) {
  registrar.registerMetaData(new ElementFilter() {
    @Override
    public boolean isAcceptable(Object element, PsiElement context) {
      if (element instanceof XmlTag) {
        final XmlTag tag = (XmlTag)element;
        final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
        if (domElement != null) {
          return domElement.getGenericInfo().getNameDomElement(domElement) != null;
        }
      }
      return false;
    }

    @Override
    public boolean isClassAcceptable(Class hintClass) {
      return XmlTag.class.isAssignableFrom(hintClass);
    }
  }, DomMetaData.class);
}
项目:tools-idea    文件:DomMetaDataContributor.java   
@Override
public void contributeMetaData(MetaDataRegistrar registrar) {
  registrar.registerMetaData(new ElementFilter() {
    public boolean isAcceptable(Object element, PsiElement context) {
      if (element instanceof XmlTag) {
        final XmlTag tag = (XmlTag)element;
        final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
        if (domElement != null) {
          return domElement.getGenericInfo().getNameDomElement(domElement) != null;
        }
      }
      return false;
    }

    public boolean isClassAcceptable(Class hintClass) {
      return XmlTag.class.isAssignableFrom(hintClass);
    }
  }, DomMetaData.class);
}
项目:consulo-xml    文件:DomMetaDataContributor.java   
@Override
public void contributeMetaData(MetaDataRegistrar registrar)
{
    registrar.registerMetaData(new ElementFilter()
    {
        @Override
        public boolean isAcceptable(Object element, PsiElement context)
        {
            if(element instanceof XmlTag)
            {
                final XmlTag tag = (XmlTag) element;
                final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
                if(domElement != null)
                {
                    return domElement.getGenericInfo().getNameDomElement(domElement) != null;
                }
            }
            return false;
        }

        @Override
        public boolean isClassAcceptable(Class hintClass)
        {
            return XmlTag.class.isAssignableFrom(hintClass);
        }
    }, DomMetaData.class);
}