use of org.jetbrains.android.dom.manifest.ManifestElementWithRequiredName in project kotlin by JetBrains.
the class KotlinAndroidGotoDeclarationHandler method collectManifestElements.
private static void collectManifestElements(@NotNull String nestedClassName, @NotNull String fieldName, @NotNull AndroidFacet facet, @NotNull List<PsiElement> result) {
Manifest manifest = facet.getManifest();
if (manifest == null) {
return;
}
List<? extends ManifestElementWithRequiredName> list;
if ("permission".equals(nestedClassName)) {
list = manifest.getPermissions();
} else if ("permission_group".equals(nestedClassName)) {
list = manifest.getPermissionGroups();
} else {
return;
}
for (ManifestElementWithRequiredName domElement : list) {
AndroidAttributeValue<String> nameAttribute = domElement.getName();
String name = nameAttribute.getValue();
if (AndroidUtils.equal(name, fieldName, false)) {
XmlElement psiElement = nameAttribute.getXmlAttributeValue();
if (psiElement != null) {
result.add(psiElement);
}
}
}
}
use of org.jetbrains.android.dom.manifest.ManifestElementWithRequiredName in project android by JetBrains.
the class AndroidGotoDeclarationHandler method collectManifestElements.
private static void collectManifestElements(@NotNull String nestedClassName, @NotNull String fieldName, @NotNull AndroidFacet facet, @NotNull List<PsiElement> result) {
final Manifest manifest = facet.getManifest();
if (manifest == null) {
return;
}
List<? extends ManifestElementWithRequiredName> list;
if ("permission".equals(nestedClassName)) {
list = manifest.getPermissions();
} else if ("permission_group".equals(nestedClassName)) {
list = manifest.getPermissionGroups();
} else {
return;
}
for (ManifestElementWithRequiredName domElement : list) {
final AndroidAttributeValue<String> nameAttribute = domElement.getName();
final String name = nameAttribute.getValue();
if (AndroidUtils.equal(name, fieldName, false)) {
final XmlElement psiElement = nameAttribute.getXmlAttributeValue();
if (psiElement != null) {
result.add(psiElement);
}
}
}
}
Aggregations