ComponentWithBrowseButton - optional remove listener on hide
[fedora-idea.git] / java / idea-ui / src / com / intellij / openapi / roots / ui / configuration / DefaultModuleEditorsProvider.java
blob7055698803e6c3301cd44d6c2b8582becfa1ce0d
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.openapi.roots.ui.configuration;
18 import com.intellij.openapi.module.Module;
19 import com.intellij.openapi.module.ModuleComponent;
20 import com.intellij.openapi.module.ModuleConfigurationEditor;
21 import com.intellij.openapi.roots.ModifiableRootModel;
22 import org.jetbrains.annotations.NotNull;
24 import java.util.ArrayList;
25 import java.util.List;
27 public class DefaultModuleEditorsProvider implements ModuleComponent, ModuleConfigurationEditorProvider {
28 @NotNull
29 public String getComponentName() {
30 return "DefaultModuleEditorsProvider";
33 public void initComponent() {}
34 public void disposeComponent() {}
35 public void projectOpened() {}
36 public void projectClosed() {}
37 public void moduleAdded() {}
39 public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
40 ModifiableRootModel rootModel = state.getRootModel();
41 Module module = rootModel.getModule();
42 String moduleName = module.getName();
43 List<ModuleConfigurationEditor> editors = new ArrayList<ModuleConfigurationEditor>();
44 editors.add(new ContentEntriesEditor(moduleName, state));
45 editors.add(new OutputEditor(state));
46 editors.add(new ClasspathEditor(state));
47 return editors.toArray(new ModuleConfigurationEditor[editors.size()]);