@Override
public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
/*final IntentionsInfo intentionsInfo = new IntentionsInfo();
intentionsInfo.filterActions();
IntentionHintComponent.showIntentionHint(project, element.getContainingFile(), editor, intentionsInfo, true);*/
final PsiDocCommentOwner container = getContainer(element);
assert container != null;
if (!FileModificationServiceUtil.preparePsiElementForWrite(container)) {
return;
}
@SuppressWarnings({"ConstantConditions"})
final ReadonlyStatusHandler.OperationStatus status = ReadonlyStatusHandler.getInstance(project).ensureFilesWritable(container.getContainingFile().getVirtualFile());
if (status.hasReadonlyFiles()) {
return;
}
if (use15Suppressions(container)) {
final PsiModifierList modifierList = container.getModifierList();
if (modifierList != null) {
addSuppressAnnotation(project, editor, container, modifierList, getID(container));
}
} else {
final PsiDocComment docComment = container.getDocComment();
final PsiManager manager = PsiManager.getInstance(project);
//noinspection IfStatementWithIdenticalBranches
if (docComment == null) {
/*final String commentText = "*//** @" + SUPPRESS_INSPECTIONS_TAG_NAME + ' ' + getID(container) + "*//*";
docComment = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createDocCommentFromText(commentText, null);