Search in sources :

Example 1 with Intent

use of org.jetbrains.android.dom.xml.Intent in project android by JetBrains.

the class AttributeProcessingUtil method processXmlAttributes.

/**
   * Yield attributes for resources in xml/ folder
   */
public static void processXmlAttributes(@NotNull AndroidFacet facet, @NotNull XmlTag tag, @NotNull XmlResourceElement element, @NotNull Set<XmlName> skipAttrNames, @NotNull AttributeProcessor callback) {
    final String tagName = tag.getName();
    String styleableName = AndroidXmlResourcesUtil.SPECIAL_STYLEABLE_NAMES.get(tagName);
    if (styleableName != null) {
        final Set<XmlName> newSkipAttrNames = new HashSet<>();
        if (element instanceof Intent) {
            newSkipAttrNames.add(new XmlName("action", NS_RESOURCES));
        }
        registerAttributes(facet, element, styleableName, SYSTEM_RESOURCE_PACKAGE, callback, newSkipAttrNames);
    }
    // for preferences
    Map<String, PsiClass> prefClassMap = getPreferencesClassMap(facet);
    String prefClassName = element.getXmlTag().getName();
    PsiClass c = prefClassMap.get(prefClassName);
    // register attributes by preference class
    registerAttributesForClassAndSuperclasses(facet, element, c, callback, skipAttrNames);
    // register attributes by widget
    String widgetClassName = AndroidTextUtils.trimEndOrNullize(prefClassName, PREFERENCE_TAG_NAME);
    if (widgetClassName != null) {
        PsiClass widgetClass = LayoutViewClassUtils.findClassByTagName(facet, widgetClassName, AndroidUtils.VIEW_CLASS_NAME);
        registerAttributesForClassAndSuperclasses(facet, element, widgetClass, callback, skipAttrNames);
    }
}
Also used : PsiClass(com.intellij.psi.PsiClass) XmlName(com.intellij.util.xml.XmlName) Intent(org.jetbrains.android.dom.xml.Intent)

Aggregations

PsiClass (com.intellij.psi.PsiClass)1 XmlName (com.intellij.util.xml.XmlName)1 Intent (org.jetbrains.android.dom.xml.Intent)1