本文整理汇总了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()]);
}
示例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()]);
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例7: getAttributesDescriptors
@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(@Nullable XmlTag context) {
return XmlAttributeDescriptor.EMPTY;
}
示例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;
}