IntelliJ will automatically add a suppress option when you add a quick fix (then go "right") from there. If you only want a suppress quick fix, you can add it like this in your holder.registerProblem(...)
private static class QuickFixSuppress implements SuppressQuickFix {
@NotNull private static final String SUPPRESS_ID = new EjbBusinessMethodPublicInspection().getSuppressId();
@Override
public boolean isAvailable(@NotNull Project project, @NotNull PsiElement psiElement) {
return psiElement instanceof PsiMethod;
}
@Override
public boolean isSuppressAll() {
return false;
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return "Suppress " + SUPPRESS_ID;
}
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) {
final PsiElement element = problemDescriptor.getPsiElement();
if (element instanceof PsiMethod) {
PsiMethod psiMethod = (PsiMethod) element;
JavaSuppressionUtil.addSuppressAnnotation(project, psiMethod, psiMethod, SUPPRESS_ID);
}
}
}