LookupElement (boolean implemented, PsiMethod baseMethod, PsiClass baseClass, PsiSubstitutor substitutor, boolean generateDefaultMethods, PsiClass targetClass, @Nullable Consumer<? super InsertionContext> wizardRunner) { RowIcon icon = IconManager .getInstance() .createRowIcon(baseMethod.getIcon(0), implemented ? AllIcons.Gutter.ImplementingMethod : AllIcons.Gutter.OverridingMethod); InsertHandler<LookupElement> handler; if (wizardRunner != null) { handler = new InsertHandler<>() { @Override public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement item) { removeLookupString(context); context.setAddCompletionChar(false); context.setLaterRunnable(() -> wizardRunner.accept(context)); } }; } else { handler = new InsertHandler<>() { @Override public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement item) { removeLookupString(context); final PsiClass parent = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiClass.class, false); if (parent == null) return; try (AccessToken ignored = generateDefaultMethods ? forceDefaultMethodsInside() : AccessToken.EMPTY_ACCESS_TOKEN) { List<PsiMethod> prototypes = OverrideImplementUtil.overrideOrImplementMethod(parent, baseMethod, false); insertGenerationInfos(context, OverrideImplementUtil.convert2GenerationInfos(prototypes)); } } }; } return createGenerateMethodElement(baseMethod, substitutor, icon, baseClass.getName(), handler, wizardRunner != null, generateDefaultMethods, targetClass); }