LocalQuickFix (boolean onTheFly) { return new InvertBooleanFix(InspectionGadgetsBundle.message("invert.method.quickfix")) { @Override public void doFix(@NotNull PsiElement element) { if (onTheFly) { //show the dialog, suggest to rename super.doFix(element); } else { PsiElement elementToRefactor = getElementToRefactor(element); new InvertBooleanProcessor(elementToRefactor, ((PsiNamedElement)elementToRefactor).getName()).run(); } } }; }