IJP-1058 vcs: move LST settings to VCS configurable
[idea/community.git] / platform / vcs-impl / src / com / intellij / openapi / vcs / configurable / VcsGeneralSettingsConfigurable.kt
index bacd189f0859d250f17be94c4d4b04f3fb6bc5cc..12f1d7256e66525ab09043eaa969bf2748a5a7b6 100644 (file)
@@ -5,9 +5,12 @@ import com.intellij.application.options.editor.checkBox
 import com.intellij.ide.actions.RevealFileAction
 import com.intellij.openapi.application.ApplicationNamesInfo
 import com.intellij.openapi.application.runInEdt
 import com.intellij.ide.actions.RevealFileAction
 import com.intellij.openapi.application.ApplicationNamesInfo
 import com.intellij.openapi.application.runInEdt
-import com.intellij.openapi.options.BoundSearchableConfigurable
+import com.intellij.openapi.extensions.ExtensionPointName
+import com.intellij.openapi.options.BoundCompositeConfigurable
 import com.intellij.openapi.options.Configurable
 import com.intellij.openapi.options.Configurable.NoScroll
 import com.intellij.openapi.options.Configurable
 import com.intellij.openapi.options.Configurable.NoScroll
+import com.intellij.openapi.options.ConfigurableEP
+import com.intellij.openapi.options.UnnamedConfigurable
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.ui.ComboBox
 import com.intellij.openapi.ui.DialogPanel
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.ui.ComboBox
 import com.intellij.openapi.ui.DialogPanel
@@ -27,10 +30,19 @@ import com.intellij.vcsUtil.VcsUtil
 import org.jetbrains.annotations.Nls
 import javax.swing.JComponent
 
 import org.jetbrains.annotations.Nls
 import javax.swing.JComponent
 
-class VcsGeneralSettingsConfigurable(val project: Project)
-  : BoundSearchableConfigurable(message("configurable.VcsGeneralConfigurationConfigurable.display.name"),
-                                "project.propVCSSupport.Confirmation"), NoScroll, Configurable.WithEpDependencies {
-  override fun getDependencies() = listOf(VcsEP.EP_NAME)
+internal class GeneralVcSettingsProviderEP(project: Project) : ConfigurableEP<UnnamedConfigurable>(project)
+
+private val VCS_SETTINGS_EP_NAME = ExtensionPointName<GeneralVcSettingsProviderEP>("com.intellij.generalVcsSettingsExtension")
+
+class VcsGeneralSettingsConfigurable(val project: Project) : BoundCompositeConfigurable<UnnamedConfigurable>(
+  message("configurable.VcsGeneralConfigurationConfigurable.display.name"),
+  "project.propVCSSupport.Confirmation"
+), NoScroll, Configurable.WithEpDependencies {
+
+  override fun createConfigurables(): List<UnnamedConfigurable> =
+    VCS_SETTINGS_EP_NAME.getExtensions(project).mapNotNull { it.createConfigurable() }
+
+  override fun getDependencies() = listOf(VcsEP.EP_NAME, VCS_SETTINGS_EP_NAME)
 
   override fun createPanel(): DialogPanel {
     val vcsManager = ProjectLevelVcsManagerEx.getInstanceEx(project)
 
   override fun createPanel(): DialogPanel {
     val vcsManager = ProjectLevelVcsManagerEx.getInstanceEx(project)
@@ -155,6 +167,10 @@ class VcsGeneralSettingsConfigurable(val project: Project)
           label(message("settings.checkbox.rows"))
         }
       }
           label(message("settings.checkbox.rows"))
         }
       }
+
+      for (configurable in configurables) {
+        appendDslConfigurableRow(configurable)
+      }
     }
   }
 
     }
   }