當前位置: 首頁>>代碼示例>>Java>>正文


Java RncDocument類代碼示例

本文整理匯總了Java中org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument的典型用法代碼示例。如果您正苦於以下問題:Java RncDocument類的具體用法?Java RncDocument怎麽用?Java RncDocument使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RncDocument類屬於org.intellij.plugins.relaxNG.compact.psi.impl包,在下文中一共展示了RncDocument類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isAcceptable

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
@Override
public boolean isAcceptable(Object element, PsiElement context) {
  if (!(element instanceof RncDocument)) {
    return false;
  }

  final PsiFile file = ((RncDocument)element).getContainingFile();
  String namespace = null;
  if (file instanceof RncFile) {
    for (RncDecl decl : ((RncFile)file).getDeclarations()) {
      if (decl instanceof RncNsDecl) {
        namespace = decl.getDeclaredNamespace();
        break;
      }
    }
  }

  if (namespace != null) {
    for (String aMyValue : myValue) {
      if (aMyValue.equals(namespace)) return true;
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:RngHtml5MetaDataContributor.java

示例2: isAcceptable

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
public boolean isAcceptable(Object element, PsiElement context) {
  if (!(element instanceof RncDocument)) {
    return false;
  }

  final PsiFile file = ((RncDocument)element).getContainingFile();
  String namespace = null;
  if (file instanceof RncFile) {
    for (RncDecl decl : ((RncFile)file).getDeclarations()) {
      if (decl instanceof RncNsDecl) {
        namespace = decl.getDeclaredNamespace();
        break;
      }
    }
  }

  if (namespace != null) {
    for (String aMyValue : myValue) {
      if (aMyValue.equals(namespace)) return true;
    }
  }
  return false;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:24,代碼來源:RngHtml5MetaDataContributor.java

示例3: contributeMetaData

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
@Override
public void contributeMetaData(MetaDataRegistrar registrar) {
  registrar.registerMetaData(
    new AndFilter(
      new ClassFilter(RncDocument.class),
      new MyRncNamespaceFilter(XmlUtil.HTML_URI, XmlUtil.XHTML_URI)),
    RelaxedHtmlFromRngNSDescriptor.class
  );
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:RngHtml5MetaDataContributor.java

示例4: registerMetaData

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
private static void registerMetaData() {
  final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
  registrar.registerMetaData(
          new AndFilter(
                  new NamespaceFilter(RNG_NAMESPACE),
                  new ClassFilter(XmlDocument.class)
          ),
          RngNsDescriptor.class);

  registrar.registerMetaData(
          new ClassFilter(RncDocument.class),
          RngNsDescriptor.class);

  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);
        return domElement instanceof RngDefine;
      }
      return false;
    }

    @Override
    public boolean isClassAcceptable(Class hintClass) {
      return XmlTag.class.isAssignableFrom(hintClass);
    }
  }, RngDefineMetaData.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:ApplicationLoader.java

示例5: registerMetaData

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
private static void registerMetaData() {
  final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
  registrar.registerMetaData(
          new AndFilter(
                  new NamespaceFilter(RNG_NAMESPACE),
                  new ClassFilter(XmlDocument.class)
          ),
          RngNsDescriptor.class);

  registrar.registerMetaData(
          new ClassFilter(RncDocument.class),
          RngNsDescriptor.class);

  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);
        return domElement instanceof RngDefine;
      }
      return false;
    }

    public boolean isClassAcceptable(Class hintClass) {
      return XmlTag.class.isAssignableFrom(hintClass);
    }
  }, RngDefineMetaData.class);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:29,代碼來源:ApplicationLoader.java

示例6: registerMetaData

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
private static void registerMetaData()
{
	final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
	registrar.registerMetaData(new AndFilter(new NamespaceFilter(RNG_NAMESPACE), new ClassFilter(XmlDocument.class)), RngNsDescriptor.class);

	registrar.registerMetaData(new ClassFilter(RncDocument.class), RngNsDescriptor.class);

	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);
				return domElement instanceof RngDefine;
			}
			return false;
		}

		@Override
		public boolean isClassAcceptable(Class hintClass)
		{
			return XmlTag.class.isAssignableFrom(hintClass);
		}
	}, RngDefineMetaData.class);
}
 
開發者ID:consulo,項目名稱:consulo-xml,代碼行數:29,代碼來源:ApplicationLoader.java

示例7: isClassAcceptable

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
@Override
public boolean isClassAcceptable(Class hintClass) {
  return ReflectionUtil.isAssignable(RncDocument.class, hintClass);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:RngHtml5MetaDataContributor.java

示例8: isTopLevel

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
private boolean isTopLevel() {
  final PsiElement parent = myNode.getTreeParent().getPsi();
  return parent instanceof RncDocument ||
          parent instanceof RncFile ||
          parent instanceof RncGrammar && parent.getParent() instanceof RncDocument;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:RncBlock.java

示例9: isClassAcceptable

import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
public boolean isClassAcceptable(Class hintClass) {
  return ReflectionCache.isAssignable(RncDocument.class, hintClass);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:4,代碼來源:RngHtml5MetaDataContributor.java


注:本文中的org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。