return new LineMarkerInfo<PsiElement>(psiMethod, psiMethod.getTextRange(), ICON,
Pass.UPDATE_ALL, null, SHOW_SUBSCRIBERS_FROM_PRODUCERS,
GutterIconRenderer.Alignment.LEFT);
}
} else if (element instanceof PsiClass) {
PsiClass psiClass = (PsiClass) element;
String qualifiedName = psiClass.getQualifiedName();
if (qualifiedName != null) {
OttoProjectHandler ottoProjectHandler = OttoProjectHandler.get(element.getProject());
if (ottoProjectHandler.isEventClass(qualifiedName)) {
PsiIdentifier nameIdentifier = psiClass.getNameIdentifier();
if (nameIdentifier != null) {
return new LineMarkerInfo<PsiClass>(psiClass, nameIdentifier.getTextRange(), ICON,
Pass.UPDATE_ALL, null, SHOW_ALL, GutterIconRenderer.Alignment.LEFT);
}
}
}
} else if (element instanceof PsiMethodCallExpression) {
PsiMethodCallExpression expression = (PsiMethodCallExpression) element;
PsiMethod psiMethod = expression.resolveMethod();
if (psiMethod != null) {
if (SubscriberMetadata.isBusPostMethod(psiMethod, element.getProject())) {
PsiType[] expressionTypes = expression.getArgumentList().getExpressionTypes();
if (expressionTypes.length > 0) {
PsiClass eventClass = PsiConsultantImpl.getClass(expressionTypes[0]);
if (eventClass != null) {
return new LineMarkerInfo<PsiElement>(element, element.getTextRange(), ICON,
Pass.UPDATE_ALL, null, SHOW_SUBSCRIBERS, GutterIconRenderer.Alignment.LEFT);
}
}