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.
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
.openapi
.util
.IconLoader
;
28 import com
.intellij
.openapi
.util
.Iconable
;
29 import com
.intellij
.psi
.PsiElement
;
30 import com
.intellij
.psi
.PsiFile
;
31 import com
.intellij
.util
.IncorrectOperationException
;
32 import org
.jetbrains
.annotations
.NotNull
;
36 public abstract class SuppressIntentionAction
extends PsiElementBaseIntentionAction
implements Iconable
{
37 private static final Icon ICON
= IconLoader
.getIcon("/general/inspectionsOff.png");
39 public void invoke(@NotNull final Project project
, final Editor editor
, final PsiFile file
) throws IncorrectOperationException
{
40 final CaretModel caretModel
= editor
.getCaretModel();
41 final int position
= caretModel
.getOffset();
42 invoke(project
, editor
, file
.findElementAt(position
));
45 public abstract void invoke(Project project
, Editor editor
, PsiElement element
) throws IncorrectOperationException
;
47 public Icon
getIcon(int flags
) {