/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intellij.codeInsight.intention;

import com.intellij.codeInspection.InspectionsBundle;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * User: anna
 * Date: May 11, 2005
 */
public final class EmptyIntentionAction implements IntentionAction, LowPriorityAction{
  private final String myName;

  public EmptyIntentionAction(@NotNull String name) {
    myName = name;
  }

  @Override
  @NotNull
  public String getText() {
    return InspectionsBundle.message("inspection.options.action.text", myName);
  }

  @Override
  @NotNull
  public String getFamilyName() {
    return myName;
  }

  @Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    return true; //edit inspection settings is always enabled
  }

  @Override
  public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  }

  @Override
  public boolean startInWriteAction() {
    return false;
  }

  public boolean equals(final Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    final EmptyIntentionAction that = (EmptyIntentionAction)o;

    return myName.equals(that.myName);
  }

  public int hashCode() {
    return myName.hashCode();
  }

  // used by TeamCity plugin
  @Deprecated
  public EmptyIntentionAction(@NotNull final String name, @NotNull List<IntentionAction> options) {
    myName = name;
  }
}

@@ -690,24 +690,60 @@
 ionsBundle;%0A
+import com.intellij.icons.AllIcons;%0A
 import com.i
@@ -773,16 +773,16 @@
 Editor;%0A
-
 import c
@@ -818,16 +818,59 @@
 roject;%0A
+import com.intellij.openapi.util.Iconable;%0A
 import c
@@ -991,16 +991,38 @@
 tNull;%0A%0A
+import javax.swing.*;%0A
 import j
@@ -1081,16 +1081,16 @@
 005%0A */%0A
-
 public f
@@ -1166,16 +1166,27 @@
 tyAction
+, Iconable 
 %7B%0A  priv
@@ -2348,11 +2348,121 @@
 ame;%0A  %7D
+%0A%0A  @Override%0A  public Icon getIcon(@IconFlags int flags) %7B%0A    return AllIcons.Actions.RealIntentionBulb;%0A  %7D
 %0A%7D%0A

edit inspections settings action placeholder should be better marked with intention icon (IDEA-99191)