Search in sources :

Example 1 with Include

use of org.jetbrains.android.dom.layout.Include in project android by JetBrains.

the class AndroidInlineUtil method getLayoutUsageData.

@Nullable
static LayoutUsageData getLayoutUsageData(@NotNull XmlTag tag) {
    final Project project = tag.getProject();
    final DomElement domElement = DomManager.getDomManager(project).getDomElement(tag);
    if (domElement instanceof Include) {
        final GenericAttributeValue<ResourceValue> layoutAttribute = ((Include) domElement).getLayout();
        final AndroidResourceReferenceBase reference = AndroidDomUtil.getAndroidResourceReference(layoutAttribute, true);
        if (reference != null) {
            return new LayoutUsageData(project, tag, reference);
        }
    }
    return null;
}
Also used : Project(com.intellij.openapi.project.Project) DomElement(com.intellij.util.xml.DomElement) AndroidResourceReferenceBase(org.jetbrains.android.dom.converters.AndroidResourceReferenceBase) ResourceValue(org.jetbrains.android.dom.resources.ResourceValue) Include(org.jetbrains.android.dom.layout.Include) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Project (com.intellij.openapi.project.Project)1 DomElement (com.intellij.util.xml.DomElement)1 AndroidResourceReferenceBase (org.jetbrains.android.dom.converters.AndroidResourceReferenceBase)1 Include (org.jetbrains.android.dom.layout.Include)1 ResourceValue (org.jetbrains.android.dom.resources.ResourceValue)1 Nullable (org.jetbrains.annotations.Nullable)1