package com.intellij.debugger.settings;

import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.options.BaseConfigurable;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.ide.DataManager;
import com.intellij.debugger.DebuggerBundle;

import javax.swing.*;
import java.util.List;
import java.util.ArrayList;

/**
 * @author Eugene Belyaev & Eugene Zhuravlev
 */
public class DebuggerConfigurable extends CompositeConfigurable implements ApplicationComponent {
  public DebuggerConfigurable() {
    super();
  }

  public void disposeComponent() {
  }

  public void initComponent() { }

  public Icon getIcon() {
    return IconLoader.getIcon("/general/configurableDebugger.png");
  }

  public String getDisplayName() {
    return DebuggerBundle.message("debugger.configurable.display.name");
  }

  public String getHelpTopic() {
    return "project.propDebugger";
  }

  public String getComponentName() {
    return "DebuggerConfigurable";
  }

  protected List<Configurable> createConfigurables() {
    ArrayList<Configurable> configurables = new ArrayList<Configurable>();
    Project project = (Project)DataManager.getInstance().getDataContext().getData(DataConstants.PROJECT);
    if(project == null) {
      project = ProjectManager.getInstance().getDefaultProject();
    }
    configurables.add(new DebuggerGeneralConfigurable(project));
    configurables.add(new UserRenderersConfigurable(project));
    return configurables;
  }

  public void apply() throws ConfigurationException {
    super.apply();
    NodeRendererSettings.getInstance().fireRenderersChanged();
  }
}
@@ -58,47 +58,68 @@
 lij.
-openapi.components.ApplicationComponent
+debugger.DebuggerBundle;%0Aimport com.intellij.ide.DataManager
 ;%0Aim
@@ -148,25 +148,34 @@
 api.
-diagnostic.Logger
+actionSystem.DataConstants
 ;%0Aim
@@ -204,32 +204,39 @@
 api.
-options.BaseConfigurable
+components.ApplicationComponent
 ;%0Aim
@@ -375,23 +375,38 @@
 api.
-util.IconLoader
+options.SearchableConfigurable
 ;%0Aim
@@ -532,174 +532,105 @@
 api.
-actionSystem.DataConstants;%0Aimport com.intellij.openapi.application.ApplicationManager;%0Aimport com.intellij.ide.DataManager;%0Aimport com.intellij.debugger.DebuggerBund
+util.IconLoader;%0Aimport org.jetbrains.annotations.NonNls;%0Aimport org.jetbrains.annotations.Nullab
 le;%0A
@@ -669,16 +669,21 @@
 va.util.
+Array
 List;%0Aim
@@ -693,29 +693,24 @@
 t java.util.
-Array
 List;%0A%0A/**%0A 
@@ -852,16 +852,40 @@
 omponent
+, SearchableConfigurable
  %7B%0A  pub
@@ -2000,10 +2000,216 @@
 d();%0A  %7D
+%0A%0A  @NonNls%0A  public String getId() %7B%0A    return getHelpTopic();%0A  %7D%0A%0A  public boolean clearSearch() %7B%0A    return false;%0A  %7D%0A%0A  @Nullable%0A  public Runnable enableSearch(String option) %7B%0A    return null;%0A  %7D
 %0A%7D

enable debugger search