本文整理汇总了Java中com.intellij.xml.impl.schema.AnyXmlElementDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java AnyXmlElementDescriptor类的具体用法?Java AnyXmlElementDescriptor怎么用?Java AnyXmlElementDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnyXmlElementDescriptor类属于com.intellij.xml.impl.schema包,在下文中一共展示了AnyXmlElementDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Nullable
@Override
public XmlElementDescriptor getDescriptor(XmlTag xmlTag) {
final Project project = xmlTag.getProject();
CatberryProjectConfigurationManager manager = CatberryProjectConfigurationManager.getInstance(project);
if (!(xmlTag instanceof HtmlTag && manager.isCatberryEnabled())) return null;
final XmlNSDescriptor nsDescriptor = xmlTag.getNSDescriptor(xmlTag.getNamespace(), false);
final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(xmlTag) : null;
final boolean special = CatberryConstants.SPECIAL_COMPONENT_NAMES.contains(xmlTag.getName());
if (descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor || special)) return null;
final String name = CatberryComponentUtils.normalizeName(xmlTag.getName());
final PsiFile file = CatberryComponentUtils.findComponent(project, name);
return file != null ? new CatberryComponentTagDescriptor(xmlTag.getName(), file) : null;
}
开发者ID:catberry,项目名称:catberry-idea-plugin,代码行数:18,代码来源:CatberryComponentTagDescriptorsProvider.java
示例2: checkTag
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
private void checkTag(XmlTag tag) {
if (ourDoJaxpTesting) return;
if (!myHolder.hasErrorResults()) {
checkTagByDescriptor(tag);
}
if (!myHolder.hasErrorResults()) {
if (!skipValidation(tag)) {
final XmlElementDescriptor descriptor = tag.getDescriptor();
if (tag instanceof HtmlTag &&
( descriptor instanceof AnyXmlElementDescriptor ||
descriptor == null
)
) {
return;
}
checkReferences(tag);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:XmlHighlightVisitor.java
示例3: resolve
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
public PsiElement resolve() {
final XmlTag tag = getTagElement();
final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor():null;
if (LOG.isDebugEnabled()) {
LOG.debug("Descriptor for tag " +
(tag != null ? tag.getName() : "NULL") +
" is " +
(descriptor != null ? (descriptor.toString() + ": " + descriptor.getClass().getCanonicalName()) : "NULL"));
}
if (descriptor != null){
return descriptor instanceof AnyXmlElementDescriptor ? tag : descriptor.getDeclaration();
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TagNameReference.java
示例4: getElementDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
if (LOG.isDebugEnabled()) {
LOG.debug("Descriptor from rng for tag " +
tag.getName() +
" is " +
(elementDescriptor != null ? elementDescriptor.getClass().getCanonicalName() : "NULL"));
}
String namespace;
if (elementDescriptor == null &&
!((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
return new AnyXmlElementDescriptor(
null,
XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
);
}
return elementDescriptor;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:RelaxedHtmlFromRngNSDescriptor.java
示例5: getElementDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
if (LOG.isDebugEnabled()) {
LOG.debug("Descriptor from rng for tag " +
tag.getName() +
" is " +
(elementDescriptor != null ? elementDescriptor.getClass().getCanonicalName() : "NULL"));
}
String namespace;
if (elementDescriptor == null &&
!((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
return new AnyXmlElementDescriptor(
null,
XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
);
}
return elementDescriptor;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:RelaxedHtmlFromRngNSDescriptor.java
示例6: getDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Nullable
@Override
public XmlElementDescriptor getDescriptor(XmlTag xmlTag) {
if (!(xmlTag instanceof HtmlTag && EmberIndexUtil.hasEmberJS(xmlTag.getProject()))) return null;
final String componentName = ComponentUtil.getAttributeName(xmlTag.getName());
final XmlNSDescriptor nsDescriptor = xmlTag.getNSDescriptor(xmlTag.getNamespace(), false);
final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(xmlTag) : null;
if (descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor)) {
return null;
}
final Project project = xmlTag.getProject();
final JSNamedElementProxy component = ComponentUtil.getComponentProxy(componentName, project);
return component != null ? new EmberJSTagDescriptor(componentName, component) : null;
}
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:18,代码来源:EmberJSTagDescriptorsProvider.java
示例7: couldContainDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
static boolean couldContainDescriptor(final XmlTag parentTag, final XmlElementDescriptor parentDescriptor, final XmlElementDescriptor childDescriptor, String childNamespace, boolean strict)
{
if(XmlUtil.nsFromTemplateFramework(childNamespace))
{
return true;
}
if(parentTag == null)
{
return true;
}
if(parentDescriptor == null)
{
return false;
}
final XmlTag childTag = parentTag.createChildTag(childDescriptor.getName(), childNamespace, null, false);
childTag.putUserData(XmlElement.INCLUDING_ELEMENT, parentTag);
XmlElementDescriptor descriptor = parentDescriptor.getElementDescriptor(childTag, parentTag);
return descriptor != null && (!strict || !(descriptor instanceof AnyXmlElementDescriptor));
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:21,代码来源:TagNameVariantCollector.java
示例8: resolve
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
public PsiElement resolve()
{
final XmlTag tag = getTagElement();
final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor() : null;
if(LOG.isDebugEnabled())
{
LOG.debug("Descriptor for tag " + (tag != null ? tag.getName() : "NULL") + " is " + (descriptor != null ? (descriptor.toString() + ": " + descriptor.getClass().getCanonicalName()) :
"NULL"));
}
if(descriptor != null)
{
return descriptor instanceof AnyXmlElementDescriptor ? tag : descriptor.getDeclaration();
}
return null;
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:19,代码来源:TagNameReference.java
示例9: isNamespaceBound
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
protected boolean isNamespaceBound(PsiElement psiElement) {
PsiElement parent = psiElement.getParent();
if (!(parent instanceof XmlTag)) return false;
final XmlTag tag = (XmlTag) parent;
final XmlElementDescriptor tagDescriptor = tag.getDescriptor();
final String tagNamespace = tag.getNamespace();
return tagDescriptor != null && !(tagDescriptor instanceof AnyXmlElementDescriptor) && namespace.equals(tagNamespace);
}
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:9,代码来源:MuleElementInsertHandler.java
示例10: shouldBeRenamedInplace
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
private boolean shouldBeRenamedInplace(Project project, PsiElement[] elements) {
boolean inProject = PsiManager.getInstance(project).isInProject(elements[0]);
if(inProject && elements[0] instanceof XmlTag) {
XmlElementDescriptor descriptor = ((XmlTag)elements[0]).getDescriptor();
return descriptor instanceof AnyXmlElementDescriptor;
} else {
return !inProject;
}
}
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:FlowRenameHandler.java
示例11: checkAttribute
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
protected void checkAttribute(@NotNull final XmlAttribute attribute, @NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
final XmlTag tag = attribute.getParent();
if (tag instanceof HtmlTag) {
XmlElementDescriptor elementDescriptor = tag.getDescriptor();
if (elementDescriptor == null || elementDescriptor instanceof AnyXmlElementDescriptor) {
return;
}
XmlAttributeDescriptor attributeDescriptor = elementDescriptor.getAttributeDescriptor(attribute);
if (attributeDescriptor == null && !attribute.isNamespaceDeclaration()) {
final String name = attribute.getName();
if (!XmlUtil.attributeFromTemplateFramework(name, tag) && (!isCustomValuesEnabled() || !isCustomValue(name))) {
boolean maySwitchToHtml5 = HtmlUtil.isCustomHtml5Attribute(name) && !HtmlUtil.hasNonHtml5Doctype(tag);
LocalQuickFix[] quickfixes = new LocalQuickFix[maySwitchToHtml5 ? 3 : 2];
quickfixes[0] = new AddCustomHtmlElementIntentionAction(ATTRIBUTE_KEY, name, XmlBundle.message("add.custom.html.attribute", name));
quickfixes[1] = new RemoveAttributeIntentionAction(name);
if (maySwitchToHtml5) {
quickfixes[2] = new SwitchToHtml5WithHighPriorityAction();
}
registerProblemOnAttributeName(attribute, XmlErrorMessages.message("attribute.is.not.allowed.here", attribute.getName()), holder,
quickfixes);
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:HtmlUnknownAttributeInspectionBase.java
示例12: couldContainDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
static boolean couldContainDescriptor(final XmlTag parentTag,
final XmlElementDescriptor parentDescriptor,
final XmlElementDescriptor childDescriptor,
String childNamespace, boolean strict) {
if (XmlUtil.nsFromTemplateFramework(childNamespace)) return true;
if (parentTag == null) return true;
if (parentDescriptor == null) return false;
final XmlTag childTag = parentTag.createChildTag(childDescriptor.getName(), childNamespace, null, false);
childTag.putUserData(XmlElement.INCLUDING_ELEMENT, parentTag);
XmlElementDescriptor descriptor = parentDescriptor.getElementDescriptor(childTag, parentTag);
return descriptor != null && (!strict || !(descriptor instanceof AnyXmlElementDescriptor));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TagNameVariantCollector.java
示例13: getElementDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
String namespace;
if (elementDescriptor == null &&
!((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
return new AnyXmlElementDescriptor(
null,
XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
);
}
return elementDescriptor;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RelaxedHtmlFromSchemaNSDescriptor.java
示例14: getRelaxedDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
public static XmlElementDescriptor getRelaxedDescriptor(XmlElementDescriptor base, final XmlTag childTag) {
final String namespace = childTag.getNamespace();
final XmlExtension extension = XmlExtension.getExtensionByElement(childTag);
if(!XmlUtil.XHTML_URI.equals(namespace) &&
( base.getContentType() != XmlElementDescriptor.CONTENT_TYPE_EMPTY ||
(extension != null && extension.isCustomTagAllowed(childTag)) // allow custom tag
) ) {
return new AnyXmlElementDescriptor(base,childTag.getNSDescriptor(namespace,true));
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RelaxedHtmlFromSchemaElementDescriptor.java
示例15: isAcceptableMetaData
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
public boolean isAcceptableMetaData(final PsiMetaData metaData, final String url) {
if (metaData instanceof XmlNSDescriptorImpl) {
final XmlNSDescriptorImpl nsDescriptor = (XmlNSDescriptorImpl)metaData;
final XmlElementDescriptor descriptor = nsDescriptor.getElementDescriptor(searchFor(), url);
return descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor);
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CreateNSDeclarationIntentionFix.java
示例16: shouldBeRenamedInplace
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
private static boolean shouldBeRenamedInplace(Project project, PsiElement[] elements) {
boolean inProject = PsiManager.getInstance(project).isInProject(elements[0]);
if (inProject && elements[0] instanceof XmlTag) {
XmlElementDescriptor descriptor = ((XmlTag)elements[0]).getDescriptor();
return descriptor instanceof AnyXmlElementDescriptor;
}
return !inProject;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XmlTagRenameHandler.java
示例17: getElementDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Override
@Nullable
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
if (myPattern == null) {
return null;
}
XmlTag _tag = tag;
final LinkedList<XmlTag> chain = new LinkedList<XmlTag>();
while (_tag != null) {
chain.addFirst(_tag);
_tag = _tag.getParentTag();
}
XmlElementDescriptor desc;
do {
desc = findRootDescriptor(chain.removeFirst());
} while (desc == null && chain.size() > 0);
if (desc != null) {
for (XmlTag xmlTag : chain) {
desc = desc.getElementDescriptor(xmlTag, xmlTag.getParentTag());
if (desc == null) {
break;
}
}
}
if (desc == null || desc instanceof AnyXmlElementDescriptor) {
return findRootDescriptor(tag);
}
return desc;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:RngNsDescriptor.java
示例18: getDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
@Nullable
@Override
public XmlElementDescriptor getDescriptor(XmlTag tag) {
if (!(tag instanceof HtmlTag)) {
return null;
}
final XmlNSDescriptor nsDescriptor = tag.getNSDescriptor(tag.getNamespace(), false);
final XmlElementDescriptor descriptor = nsDescriptor != null ? nsDescriptor.getElementDescriptor(tag) : null;
if (descriptor != null && !(descriptor instanceof AnyXmlElementDescriptor)) {
return null;
}
return new ISMLTagDescriptor(tag.getName(), tag);
}
开发者ID:nek4life,项目名称:intellij-demandware,代码行数:16,代码来源:ISMLTagDescriptorsProvider.java
示例19: resolve
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
public PsiElement resolve() {
final XmlTag tag = getTagElement();
final XmlElementDescriptor descriptor = tag != null ? tag.getDescriptor():null;
LOG.debug("Descriptor for tag " +
(tag != null ? tag.getName() : "NULL") +
" is " +
(descriptor != null ? (descriptor.toString() + ": " + descriptor.getClass().getCanonicalName()) : "NULL"));
if (descriptor != null){
return descriptor instanceof AnyXmlElementDescriptor ? tag : descriptor.getDeclaration();
}
return null;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:TagNameReference.java
示例20: getElementDescriptor
import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; //导入依赖的package包/类
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
XmlElementDescriptor elementDescriptor = super.getElementDescriptor(tag);
String namespace;
if (elementDescriptor == null &&
!((namespace = tag.getNamespace()).equals(XmlUtil.XHTML_URI))) {
return new AnyXmlElementDescriptor(
null,
XmlUtil.HTML_URI.equals(namespace) ? this : tag.getNSDescriptor(tag.getNamespace(), true)
);
}
return elementDescriptor;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:RelaxedHtmlFromSchemaNSDescriptor.java
注:本文中的com.intellij.xml.impl.schema.AnyXmlElementDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论