package com.intellij.openapi.roots.ui.configuration;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleComponent;
import com.intellij.openapi.module.ModuleConfigurationEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModifiableRootModel;

import java.util.ArrayList;
import java.util.List;

public class DefaultModuleEditorsProvider implements ModuleComponent, ModuleConfigurationEditorProvider {
  public String getComponentName() {
    return "DefaultModuleEditorsProvider";
  }

  public void initComponent() {}
  public void disposeComponent() {}
  public void projectOpened() {}
  public void projectClosed() {}
  public void moduleAdded() {}

  public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
    ModifiableRootModel rootModel = state.getRootModel();
    Module module = rootModel.getModule();
    String moduleName = module.getName();
    ModulesProvider provider = state.getModulesProvider();
    Project project = state.getProject();
    List<ModuleConfigurationEditor> editors = new ArrayList<ModuleConfigurationEditor>();
    editors.add(new ContentEntriesEditor(project, moduleName, rootModel, provider));
    editors.add(new LibrariesEditor(project, rootModel));
    if (provider.getModules().length > 1) {
      editors.add(new DependenciesEditor(project, rootModel, provider));
    }
    editors.add(new OrderEntryEditor(project, rootModel));
    editors.add(new JavadocEditor(project, rootModel));
    return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
  }
}
@@ -1281,54 +1281,8 @@
 ));%0A
-    if (provider.getModules().length %3E 1) %7B%0A  
     
@@ -1352,14 +1352,8 @@
 ));%0A
-    %7D%0A
     

fix error with not showing dependencies tab for the first module when second module is added to the project