use of org.jetbrains.android.dom.menu.MenuDomFileDescription in project android by JetBrains.
the class AndroidMissingOnClickHandlerInspection method checkFile.
@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
if (!(file instanceof XmlFile)) {
return ProblemDescriptor.EMPTY_ARRAY;
}
final AndroidFacet facet = AndroidFacet.getInstance(file);
if (facet == null) {
return ProblemDescriptor.EMPTY_ARRAY;
}
final DomFileDescription<?> description = DomManager.getDomManager(file.getProject()).getDomFileDescription((XmlFile) file);
if (!(description instanceof LayoutDomFileDescription) && !(description instanceof MenuDomFileDescription)) {
return ProblemDescriptor.EMPTY_ARRAY;
}
final Collection<PsiClass> activities = findRelatedActivities((XmlFile) file, facet, description);
final MyVisitor visitor = new MyVisitor(manager, isOnTheFly, activities);
file.accept(visitor);
return visitor.myResult.toArray(new ProblemDescriptor[visitor.myResult.size()]);
}
Aggregations