/*
 * Copyright 2000-2005 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.codeInspection;

import com.intellij.codeHighlighting.HighlightDisplayLevel;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * User: anna
 * Date: 28-Nov-2005
 */
public abstract class InspectionProfileEntry {

  public abstract String getGroupDisplayName();

  public abstract String getDisplayName();

  /**
   * @return short name that is used in two cases: \inspectionDescriptions\&lt;short_name&gt;.html resource may contain short inspection
   *         description to be shown in "Inspect Code..." dialog and also provide some file name convention when using offline
   *         inspection or export to HTML function. Should be unique among all inspections.
   */
  @NonNls public abstract String getShortName();

  /**
   * @return highlighting level for this inspection tool that is used in default settings
   */
  public HighlightDisplayLevel getDefaultLevel() {
    return HighlightDisplayLevel.WARNING;
  }

  public boolean isEnabledByDefault() {
    return false;
  }

  /**
   * @return null if no UI options required
   */
  @Nullable
  public JComponent createOptionsPanel() {
    return null;
  }

  /**
   * Read in settings from xml config. Default implementation uses DefaultJDOMExternalizer so you may use public fields like <code>int TOOL_OPTION</code> to store your options.
   *
   * @param node to read settings from.
   * @throws InvalidDataException
   */
  public void readSettings(Element node) throws InvalidDataException {
    DefaultJDOMExternalizer.readExternal(this, node);
  }

  /**
   * Store current settings in xml config. Default implementation uses DefaultJDOMExternalizer so you may use public fields like <code>int TOOL_OPTION</code> to store your options.
   *
   * @param node to store settings to.
   * @throws WriteExternalException
   */
  public void writeSettings(Element node) throws WriteExternalException {
    DefaultJDOMExternalizer.writeExternal(this, node);
  }

  /**
   * Initialize inspection with project. Is called on project opened for all profiles as well as on profile creation
   * @param project to be associated with this entry
   */
  public void projectOpened(Project project) {
  }

  /**
   * Cleanup inspection settings conserning with project. Is called on project closed for all profiles as well as on profile deletion
   * @param project to be disassociated from this entry
   */
  public void projectClosed(Project project) {
  }
}

@@ -1015,16 +1015,96 @@
 ullable;
+%0Aimport org.jetbrains.annotations.Nls;%0Aimport org.jetbrains.annotations.NotNull;
 %0A%0Aimport
@@ -1211,16 +1211,23 @@
 ntry %7B%0A%0A
+  @Nls%0A
   public
@@ -1267,16 +1267,23 @@
 ame();%0A%0A
+  @Nls%0A
   public
@@ -1834,24 +1834,35 @@
 tings%0A   */%0A
+  @NotNull%0A
   public Hig
@@ -2396,32 +2396,65 @@
 lidDataException
+ if the loaded data was not valid
 %0A   */%0A  public 
@@ -2805,16 +2805,16 @@
 ngs to.%0A
-
    * @th
@@ -2836,24 +2836,70 @@
 nalException
+ if no data should be saved for this component
 %0A   */%0A  pub

annotate (IDEADEV-9051)