@Override
  public void apply() throws ConfigurationException {
    if (myApplyCompleted) {
      return;
    }

    try {
      EditorColorsManager editorColorManager = EditorColorsManager.getInstance();
      SchemeManager<EditorColorsScheme> schemeManager = ((EditorColorsManagerImpl)editorColorManager).getSchemeManager();
      EditorColorsScheme oldScheme = editorColorManager.getGlobalScheme();

      List<EditorColorsScheme> result = new ArrayList<>(myModel.allSchemes().size());
      boolean activeSchemeModified = false;
      MyColorScheme selectedScheme = getMySelectedScheme();
      if (selectedScheme == null) return;

      EditorColorsScheme activeOriginalScheme = selectedScheme.getParentScheme();
      for (MyColorScheme scheme : getMySchemes()) {
        boolean isModified = scheme.apply();
        if (isModified && !activeSchemeModified && activeOriginalScheme == scheme.getParentScheme()) {
          activeSchemeModified = true;
        }
        result.add(scheme.getParentScheme());
      }

      // refresh only if the scheme is not switched
      boolean refreshEditors = activeSchemeModified && schemeManager.getActiveScheme() == activeOriginalScheme;
      schemeManager.setSchemes(includingInvisible(result, schemeManager), activeOriginalScheme);
      if (refreshEditors) {
        ((EditorColorsManagerImpl)EditorColorsManager.getInstance()).schemeChangedOrSwitched(null);
      }

      if (myShouldChangeLafIfNecessary && !Objects.equals(oldScheme.getName(), editorColorManager.getGlobalScheme().getName())) {
        QuickChangeColorSchemeAction.changeLafIfNecessary(oldScheme, activeOriginalScheme, null);
      }

      reset();
    }
    finally {
      myApplyCompleted = true;
    }
  }
@Override
  public void apply()