当前位置: 首页>>代码示例>>Java>>正文


Java XmlAttributeDescriptor.EMPTY属性代码示例

本文整理汇总了Java中com.intellij.xml.XmlAttributeDescriptor.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java XmlAttributeDescriptor.EMPTY属性的具体用法?Java XmlAttributeDescriptor.EMPTY怎么用?Java XmlAttributeDescriptor.EMPTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.xml.XmlAttributeDescriptor的用法示例。


在下文中一共展示了XmlAttributeDescriptor.EMPTY属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributesDescriptors

@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context) {
  if (context == null) return XmlAttributeDescriptor.EMPTY;

  DomElement domElement = myManager.getDomElement(context);
  if (domElement == null) return XmlAttributeDescriptor.EMPTY;

  final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
  List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();

  for (DomAttributeChildDescription description : descriptions) {
    descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
  }
  List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
  for (CustomDomChildrenDescription custom : customs) {
    CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
    if (descriptor != null) {
      for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
        AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
        descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
      }
    }
  }
  return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AbstractDomChildrenDescriptor.java

示例2: getAttributeDescriptors

@Override
public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag context) {
  if (!HtmlUtil.isHtml5Context(context)) {
    return XmlAttributeDescriptor.EMPTY;
  }
  final String tagName = context.getName();
  List<XmlAttributeDescriptor> result = new ArrayList<XmlAttributeDescriptor>();
  final boolean goodContextForProps =
    "div".equalsIgnoreCase(tagName) || "span".equalsIgnoreCase(tagName) || "a".equalsIgnoreCase(tagName);
  if (goodContextForProps && hasScopeTag(context)) {
    result.add(new MicrodataPropertyAttributeDescriptor(context));
  }
  if (context.getAttribute(ITEM_SCOPE) == null) {
    result.add(new AnyXmlAttributeDescriptor(ITEM_SCOPE));
  }
  else {
    result.add(new XmlAttributeDescriptorWithEmptyDefaultValue(ITEM_ID));
    result.add(new XmlAttributeDescriptorWithEmptyDefaultValue(ITEM_TYPE));
    result.add(new XmlAttributeDescriptorWithEmptyDefaultValue(ITEM_REF));
  }
  return result.toArray(new XmlAttributeDescriptor[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:MicrodataAttributeDescriptorsProvider.java

示例3: getAttributesDescriptors

@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable XmlTag context) {
  if (context != null) {
    final String name = context.getName();
    if (Comparing.equal(name, getName()) && myPsiClass != null) {
      final List<XmlAttributeDescriptor> simpleAttrs = new ArrayList<XmlAttributeDescriptor>();
      collectInstanceProperties(simpleAttrs);
      collectStaticAttributesDescriptors(context, simpleAttrs);
      for (String defaultProperty : FxmlConstants.FX_DEFAULT_PROPERTIES) {
        simpleAttrs.add(new JavaFxDefaultAttributeDescriptor(defaultProperty, myPsiClass));
      }
      return simpleAttrs.isEmpty() ? XmlAttributeDescriptor.EMPTY : simpleAttrs.toArray(new XmlAttributeDescriptor[simpleAttrs.size()]);
    }
  }
  return XmlAttributeDescriptor.EMPTY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JavaFxClassBackedElementDescriptor.java

示例4: getAttributeDescriptors

@Override
public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag xmlTag) {
  final Project project = xmlTag.getProject();
  CatberryProjectConfigurationManager manager = CatberryProjectConfigurationManager.getInstance(project);

  if (manager.isCatberryEnabled() && (xmlTag.getDescriptor() instanceof CatberryComponentTagDescriptor)) {
    return new CatberryAttributeDescriptor[] {new CatberryAttributeDescriptor(project, "cat-store")};
  }
  return XmlAttributeDescriptor.EMPTY;
}
 
开发者ID:catberry,项目名称:catberry-idea-plugin,代码行数:10,代码来源:CatberryAttributeDescriptorsProvider.java

示例5: getCommonAttributeDescriptors

public static XmlAttributeDescriptor[] getCommonAttributeDescriptors(XmlTag context) {
  final XmlNSDescriptor nsDescriptor = context != null ? context.getNSDescriptor(context.getNamespace(), false) : null;
  if (nsDescriptor instanceof HtmlNSDescriptorImpl) {
    XmlElementDescriptor descriptor = ((HtmlNSDescriptorImpl)nsDescriptor).getElementDescriptorByName("div");
    descriptor = descriptor == null ? ((HtmlNSDescriptorImpl)nsDescriptor).getElementDescriptorByName("span") : descriptor;
    if (descriptor != null) {
      return descriptor.getAttributesDescriptors(context);
    }
  }
  return XmlAttributeDescriptor.EMPTY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:HtmlNSDescriptorImpl.java

示例6: updateElementDescriptor

public static void updateElementDescriptor(XmlElementDescriptor descriptor, ParameterInfoUIContext context,
                                           Function<String, Boolean> attributePresentFun) {
  final XmlAttributeDescriptor[] attributes = descriptor != null ? getSortedDescriptors(descriptor) : XmlAttributeDescriptor.EMPTY;

  StringBuilder buffer = new StringBuilder();
  int highlightStartOffset = -1;
  int highlightEndOffset = -1;

  if (attributes.length == 0) {
    buffer.append(CodeInsightBundle.message("xml.tag.info.no.attributes"));
  }
  else {
    StringBuilder text1 = new StringBuilder(" ");
    StringBuilder text2 = new StringBuilder(" ");
    StringBuilder text3 = new StringBuilder(" ");

    for (XmlAttributeDescriptor attribute : attributes) {
      if (Boolean.TRUE.equals(attributePresentFun.fun(attribute.getName()))) {
        if (!(text1.toString().equals(" "))) {
          text1.append(", ");
        }
        text1.append(attribute.getName());
      }
      else if (attribute.isRequired()) {
        if (!(text2.toString().equals(" "))) {
          text2.append(", ");
        }
        text2.append(attribute.getName());
      }
      else {
        if (!(text3.toString().equals(" "))) {
          text3.append(", ");
        }
        text3.append(attribute.getName());
      }
    }

    if (!text1.toString().equals(" ") && !text2.toString().equals(" ")) {
      text1.append(", ");
    }

    if (!text2.toString().equals(" ") && !text3.toString().equals(" ")) {
      text2.append(", ");
    }

    if (!text1.toString().equals(" ") && !text3.toString().equals(" ") && text2.toString().equals(" ")) {
      text1.append(", ");
    }

    buffer.append(text1);
    highlightStartOffset = buffer.length();
    buffer.append(text2);
    highlightEndOffset = buffer.length();
    buffer.append(text3);
  }

  context.setupUIComponentPresentation(buffer.toString(), highlightStartOffset, highlightEndOffset, false,
                                       false, true, context.getDefaultParameterColor());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:59,代码来源:XmlParameterInfoHandler.java

示例7: getAttributesDescriptors

@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable XmlTag context) {
  return XmlAttributeDescriptor.EMPTY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaFxPropertyElementDescriptor.java

示例8: getAttributesDescriptors

@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable XmlTag context) {
  final List<String> defaultAttributeList = FxmlConstants.FX_ELEMENT_ATTRIBUTES.get(getName());
  if (defaultAttributeList != null) {
    final List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();
    for (String defaultAttrName : defaultAttributeList) {
      descriptors.add(new JavaFxDefaultAttributeDescriptor(defaultAttrName, getName()));
    }
    JavaFxClassBackedElementDescriptor.collectStaticAttributesDescriptors(context, descriptors);
    final XmlTag referencedTag = getReferencedTag(myXmlTag);
    if (referencedTag != null) {
      final XmlElementDescriptor referencedDescriptor = referencedTag.getDescriptor();
      if (referencedDescriptor != null) {
        final XmlAttributeDescriptor[] attributesDescriptors = referencedDescriptor.getAttributesDescriptors(referencedTag);
        if (attributesDescriptors != null) {
          Collections.addAll(descriptors, attributesDescriptors);
        }
      }
    } else {
      final JavaFxClassBackedElementDescriptor rootTagDescriptor = getRootTagDescriptor(context);
      if (rootTagDescriptor != null) {
        Collections.addAll(descriptors, rootTagDescriptor.getAttributesDescriptors(context));
      }
      final XmlTag includedRoot = getIncludedRoot(context);
      if (includedRoot != null) {
        final XmlElementDescriptor includedRootDescriptor = includedRoot.getDescriptor();
        if (includedRootDescriptor instanceof JavaFxClassBackedElementDescriptor) {
          ((JavaFxClassBackedElementDescriptor)includedRootDescriptor).collectInstanceProperties(descriptors);
        } 
        else if (includedRootDescriptor instanceof JavaFxDefaultPropertyElementDescriptor) {
          final JavaFxClassBackedElementDescriptor includedRootTagDescriptor = ((JavaFxDefaultPropertyElementDescriptor)includedRootDescriptor).getRootTagDescriptor(includedRoot);
          if (includedRootTagDescriptor != null) {
            includedRootTagDescriptor.collectInstanceProperties(descriptors);
          }
        }
      }
    }
    return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
  }
  return XmlAttributeDescriptor.EMPTY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:JavaFxDefaultPropertyElementDescriptor.java


注:本文中的com.intellij.xml.XmlAttributeDescriptor.EMPTY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。