refactoring
[fedora-idea.git] / platform / lang-impl / src / com / intellij / codeInsight / intention / EmptyIntentionAction.java
blob44668a2ef223469b6b4bb7ae3424fa409720b2c6
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.
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;
28 /**
29 * User: anna
30 * Date: May 11, 2005
32 public final class EmptyIntentionAction implements IntentionAction{
33 private final String myName;
35 public EmptyIntentionAction(final String name) {
36 myName = name;
39 @NotNull
40 public String getText() {
41 return InspectionsBundle.message("inspection.options.action.text", myName);
44 @NotNull
45 public String getFamilyName() {
46 return myName;
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() {
57 return false;
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;
68 return true;
71 public int hashCode() {
72 int result;
73 result = (myName != null ? myName.hashCode() : 0);
74 return result;
77 // used by TeamCity plugin
78 @Deprecated
79 public EmptyIntentionAction(@NotNull final String name, @NotNull List<IntentionAction> options) {
80 myName = name;