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.
17 package com
.intellij
.codeInsight
.intention
;
19 import com
.intellij
.codeInspection
.InspectionsBundle
;
20 import com
.intellij
.openapi
.editor
.Editor
;
21 import com
.intellij
.openapi
.project
.Project
;
22 import com
.intellij
.psi
.PsiFile
;
23 import com
.intellij
.util
.IncorrectOperationException
;
24 import org
.jetbrains
.annotations
.NotNull
;
26 import java
.util
.List
;
32 public final class EmptyIntentionAction
implements IntentionAction
{
33 private final String myName
;
35 public EmptyIntentionAction(final String name
) {
40 public String
getText() {
41 return InspectionsBundle
.message("inspection.options.action.text", myName
);
45 public String
getFamilyName() {
49 public boolean isAvailable(@NotNull Project project
, Editor editor
, PsiFile file
) {
50 return true; //edit inspection settings is always enabled
53 public void invoke(@NotNull Project project
, Editor editor
, PsiFile file
) throws IncorrectOperationException
{
56 public boolean startInWriteAction() {
60 public boolean equals(final Object o
) {
61 if (this == o
) return true;
62 if (o
== null || getClass() != o
.getClass()) return false;
64 final EmptyIntentionAction that
= (EmptyIntentionAction
)o
;
66 if (myName
!= null ?
!myName
.equals(that
.myName
) : that
.myName
!= null) return false;
71 public int hashCode() {
73 result
= (myName
!= null ? myName
.hashCode() : 0);
77 // used by TeamCity plugin
79 public EmptyIntentionAction(@NotNull final String name
, @NotNull List
<IntentionAction
> options
) {