@Override
  public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
    PsiMember member = findMember(element);
    if (member == null) return;
    PsiFile file = member.getContainingFile();
    if (file == null) return;
    List<AccessModifier> modifiers = AccessModifier.getAvailableModifiers(member);
    if (modifiers.isEmpty()) return;
    AccessModifier target = myTarget;
    if (target != null && modifiers.contains(target)) {
      setModifier(member, target);
      return;
    }
    TextRange range = getRange(member);
    Document document = editor.getDocument();
    CharSequence sequence = document.getCharsSequence();
    if (range.getLength() == 0) {
      int pos = range.getStartOffset();
      while (pos < sequence.length() && StringUtil.isWhiteSpace(sequence.charAt(pos))) {
        pos++;
      }
      range = TextRange.from(pos, 0);
    }
    CaretModel model = editor.getCaretModel();
    RangeMarker cursorMarker = document.createRangeMarker(model.getOffset(), model.getOffset());
    model.moveToOffset(range.getStartOffset());
    StartMarkAction markAction;
    try {
      markAction = StartMarkAction.start(editor, project, getFamilyName());
    }
    catch (StartMarkAction.AlreadyStartedException e) {
      Messages.showErrorDialog(project, e.getMessage(), StringUtil.toTitleCase(getFamilyName()));
      return;
    }

    RangeHighlighter highlighter = editor.getMarkupModel()
      .addRangeHighlighter(EditorColors.LIVE_TEMPLATE_ATTRIBUTES, range.getStartOffset(), range.getEndOffset(), HighlighterLayer.LAST + 1,
                           HighlighterTargetArea.EXACT_RANGE);
    highlighter.setGreedyToRight(true);
    highlighter.setGreedyToLeft(true);
    ModifierUpdater updater = new ModifierUpdater(file, document, range, getFamilyName());
    AccessModifier current = ContainerUtil.find(modifiers, m -> m.hasModifier(member));
    SmartPsiElementPointer<PsiMember> memberPointer = SmartPointerManager.createPointer(member);
    JBPopup popup = JBPopupFactory.getInstance().createPopupChooserBuilder(modifiers)
      .setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
      .setSelectedValue(current, true)
      .setAccessibleName(JavaBundle.message("accessible.name.change.modifier"))
      .setMovable(false)
      .setResizable(false)
      .setRequestFocus(true)
      .setFont(editor.getColorsScheme().getFont(EditorFontType.PLAIN))
      .setItemSelectedCallback(updater::setModifier)
      .addListener(new JBPopupListener() {
        @Override
        public void onClosed(@NotNull LightweightWindowEvent event) {
          highlighter.dispose();
          model.moveToOffset(cursorMarker.getStartOffset());
          FinishMarkAction.finish(project, editor, markAction);
          if (!event.isOk()) {
            updater.undoChange();
          }
        }
      })
      .setNamerForFiltering(AccessModifier::toString)
      .setItemChosenCallback(t -> {
        if (editor instanceof EditorImpl) {
          ((EditorImpl)editor).startDumb();
        }
        MultiMap<PsiElement, String> conflicts;
        PsiModifierList modifierList;
        try {
          updater.undoChange();
          PsiDocumentManager.getInstance(project).commitDocument(document);
          if (t == current) return;
          PsiMember m = memberPointer.getElement();
          if (m == null) return;
          modifierList = m.getModifierList();
          if (modifierList == null) return;
          conflicts = checkForConflicts(m, t);
        }
        finally {
          if (editor instanceof EditorImpl) {
            ((EditorImpl)editor).stopDumbLater();
          }
        }
        if (conflicts == null) {
          return;
        }
        if (!conflicts.isEmpty()) {
          processWithConflicts(modifierList, t, conflicts);
        } else {
          changeModifier(modifierList, t, false);
        }
      })
      .createPopup();
    popup.showInBestPositionFor(editor);
  }
@Override
  public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiElement element)