@Override
  protected void doOKAction() {
    final LibraryCompositionSettings librarySettings = myComponent.getLibraryCompositionSettings();
    if (librarySettings != null) {
      final ModifiableRootModel modifiableModel =
          myModifiableModelsProvider.getModuleModifiableModel(myModule);
      if (!askAndRemoveDuplicatedLibraryEntry(
          modifiableModel, librarySettings.getLibraryDescription())) {
        if (myConfigurable.isOnlyLibraryAdded()) {
          myModifiableModelsProvider.disposeModuleModifiableModel(modifiableModel);
          return;
        }
        return;
      }

      // Fix
      new WriteAction() {
        @Override
        protected void run(final Result result) {
          myModifiableModelsProvider.commitModuleModifiableModel(modifiableModel);
        }
      }.execute();

      final boolean downloaded = librarySettings.downloadFiles(getRootPane());
      if (!downloaded) {
        int answer =
            Messages.showYesNoDialog(
                getRootPane(),
                ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
                CommonBundle.getWarningTitle(),
                Messages.getWarningIcon());
        if (answer != 0) {
          return;
        }
      }
    }

    new WriteAction() {
      @Override
      protected void run(final Result result) {
        final ModifiableRootModel rootModel =
            myModifiableModelsProvider.getModuleModifiableModel(myModule);
        if (librarySettings != null) {
          librarySettings.addLibraries(
              rootModel, new ArrayList<Library>(), myModel.getLibrariesContainer());
        }
        myConfigurable.addSupport(myModule, rootModel, myModifiableModelsProvider);
        myModifiableModelsProvider.commitModuleModifiableModel(rootModel);
      }
    }.execute();
    super.doOKAction();
  }
 @Override
 protected JComponent createCenterPanel() {
   return myComponent.getMainPanel();
 }