private void reportMissingOnClickProblem( OnClickConverter.MyReference reference, PsiClass activity, String methodName, boolean incorrectSignature) { String activityName = activity.getName(); if (activityName == null) { activityName = ""; } final String message = incorrectSignature ? AndroidBundle.message( "android.inspections.on.click.missing.incorrect.signature", methodName, activityName) : AndroidBundle.message( "android.inspections.on.click.missing.problem", methodName, activityName); final LocalQuickFix[] fixes = StringUtil.isJavaIdentifier(methodName) ? new LocalQuickFix[] {new MyQuickFix(methodName, reference.getConverter(), activity)} : LocalQuickFix.EMPTY_ARRAY; myResult.add( myInspectionManager.createProblemDescriptor( reference.getElement(), reference.getRangeInElement(), message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly, fixes)); }
@NotNull @Override public String getName() { return "Create '" + myMethodName + "(" + myConverter.getShortParameterName() + ")' in '" + myClass.getName() + "'"; }
@Nullable private static String getDescriptionDirName(PsiClass aClass) { String descriptionDir = ""; PsiClass each = aClass; while (each != null) { String name = each.getName(); if (StringUtil.isEmptyOrSpaces(name)) { return null; } descriptionDir = name + descriptionDir; each = each.getContainingClass(); } return descriptionDir; }