3e52f89d8105372e3acde98294edca6cdfa15175
[fedora-idea.git] / platform / lang-api / src / com / intellij / codeInspection / SuppressIntentionAction.java
blob3e52f89d8105372e3acde98294edca6cdfa15175
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * User: anna
19 * Date: 24-Dec-2007
21 package com.intellij.codeInspection;
23 import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
24 import com.intellij.openapi.editor.CaretModel;
25 import com.intellij.openapi.editor.Editor;
26 import com.intellij.openapi.project.Project;
27 import com.intellij.psi.PsiElement;
28 import com.intellij.psi.PsiFile;
29 import com.intellij.util.IncorrectOperationException;
30 import org.jetbrains.annotations.NotNull;
32 public abstract class SuppressIntentionAction extends PsiElementBaseIntentionAction {
33 public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
34 final CaretModel caretModel = editor.getCaretModel();
35 final int position = caretModel.getOffset();
36 invoke(project, editor, file.findElementAt(position));
39 public abstract void invoke(Project project, Editor editor, PsiElement element) throws IncorrectOperationException;