本文整理匯總了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;
}
示例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;
}
示例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
);
}
示例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);
}
示例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);
}
示例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);
}
示例7: isClassAcceptable
import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
@Override
public boolean isClassAcceptable(Class hintClass) {
return ReflectionUtil.isAssignable(RncDocument.class, hintClass);
}
示例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;
}
示例9: isClassAcceptable
import org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument; //導入依賴的package包/類
public boolean isClassAcceptable(Class hintClass) {
return ReflectionCache.isAssignable(RncDocument.class, hintClass);
}