package ro.redeul.google.go.ide;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleConfigurationEditor;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.roots.ui.configuration.DefaultModuleConfigurationEditorFactory;
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationEditorProvider;
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationState;
import java.util.ArrayList;
import java.util.List;
/**
* Author: Toader Mihai Claudiu <mtoader@gmail.com>
* <p/>
* Date: 1/2/11
* Time: 11:40 AM
*/
public class GoModuleEditorsProvider implements ModuleConfigurationEditorProvider {
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
final Module module = state.getRootModel().getModule();
final ModuleType moduleType = ModuleType.get(module);
if (!(moduleType instanceof GoModuleType) &&
!(moduleType instanceof GoAppEngineModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}
final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
List<ModuleConfigurationEditor> editors = new ArrayList<ModuleConfigurationEditor>();
editors.add(editorFactory.createModuleContentRootsEditor(state));
editors.add(editorFactory.createOutputEditor(state));
editors.add(editorFactory.createClasspathEditor(state));
// editors.add(new PluginModuleBuildConfEditor(state));
return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
}