use of org.jetbrains.android.resourceManagers.ValueResourceInfoImpl in project android by JetBrains.
the class AndroidFindStyleApplicationsAction method resolveStyleRef.
private static PsiElement resolveStyleRef(StyleRefData styleRef, AndroidFacet facet) {
final ResourceManager resourceManager = facet.getResourceManager(styleRef.getStylePackage());
if (resourceManager == null) {
return null;
}
final List<ValueResourceInfoImpl> infos = resourceManager.findValueResourceInfos(ResourceType.STYLE.getName(), styleRef.getStyleName(), true, false);
return infos.size() == 1 ? infos.get(0).computeXmlElement() : null;
}
use of org.jetbrains.android.resourceManagers.ValueResourceInfoImpl in project android by JetBrains.
the class AndroidFindStyleApplicationsProcessor method collectResDir.
private static void collectResDir(Module module, XmlAttributeValue styleNameAttrValue, String styleName, List<VirtualFile> resDirs) {
final AndroidFacet f = AndroidFacet.getInstance(module);
if (f == null) {
return;
}
final List<ValueResourceInfoImpl> resolvedStyles = f.getLocalResourceManager().findValueResourceInfos(ResourceType.STYLE.getName(), styleName, true, false);
if (resolvedStyles.size() == 1) {
final XmlAttributeValue resolvedStyleNameElement = resolvedStyles.get(0).computeXmlElement();
if (resolvedStyleNameElement != null && resolvedStyleNameElement.equals(styleNameAttrValue)) {
resDirs.addAll(f.getAllResourceDirectories());
}
}
}
Aggregations