Search in sources :

Example 1 with DebuggerConfigurableProvider

use of com.intellij.xdebugger.settings.DebuggerConfigurableProvider in project intellij-community by JetBrains.

the class DebuggerConfigurable method compute.

private void compute() {
    if (myChildren != null) {
        return;
    }
    List<Configurable> configurables = new SmartList<>();
    configurables.add(new DataViewsConfigurable());
    DebuggerConfigurableProvider[] providers = DebuggerConfigurableProvider.EXTENSION_POINT.getExtensions();
    computeMergedConfigurables(providers, configurables);
    for (DebuggerConfigurableProvider provider : providers) {
        configurables.addAll(provider.getConfigurables(DebuggerSettingsCategory.ROOT));
    }
    MergedCompositeConfigurable mergedGeneralConfigurable = computeGeneralConfigurables(providers);
    if (configurables.isEmpty() && mergedGeneralConfigurable == null) {
        myRootConfigurable = null;
        myChildren = EMPTY_CONFIGURABLES;
    } else if (configurables.size() == 1) {
        Configurable firstConfigurable = configurables.get(0);
        if (mergedGeneralConfigurable == null) {
            myRootConfigurable = firstConfigurable;
            myChildren = EMPTY_CONFIGURABLES;
        } else {
            Configurable[] generalConfigurables = mergedGeneralConfigurable.children;
            Configurable[] mergedArray = new Configurable[generalConfigurables.length + 1];
            System.arraycopy(generalConfigurables, 0, mergedArray, 0, generalConfigurables.length);
            mergedArray[generalConfigurables.length] = firstConfigurable;
            myRootConfigurable = new MergedCompositeConfigurable("", "", mergedArray);
            myChildren = firstConfigurable instanceof SearchableConfigurable.Parent ? ((Parent) firstConfigurable).getConfigurables() : EMPTY_CONFIGURABLES;
        }
    } else {
        myChildren = configurables.toArray(new Configurable[configurables.size()]);
        myRootConfigurable = mergedGeneralConfigurable;
    }
}
Also used : DebuggerConfigurableProvider(com.intellij.xdebugger.settings.DebuggerConfigurableProvider) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) SmartList(com.intellij.util.SmartList)

Aggregations

Configurable (com.intellij.openapi.options.Configurable)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 SmartList (com.intellij.util.SmartList)1 DebuggerConfigurableProvider (com.intellij.xdebugger.settings.DebuggerConfigurableProvider)1