update copyright
[fedora-idea.git] / java / idea-ui / src / com / intellij / openapi / roots / ui / configuration / projectRoot / FacetTypeConfigurable.java
blob88db4c5dfe0172b9071e6ce8cb29898d514c92f7
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.projectRoot;
18 import com.intellij.openapi.ui.NamedConfigurable;
19 import com.intellij.openapi.options.ConfigurationException;
20 import com.intellij.openapi.project.ProjectBundle;
21 import com.intellij.facet.FacetType;
22 import com.intellij.facet.impl.ui.facetType.FacetTypeEditor;
24 import javax.swing.*;
26 /**
27 * @author nik
29 public class FacetTypeConfigurable extends NamedConfigurable<FacetType> {
30 private final FacetStructureConfigurable myFacetStructureConfigurable;
31 private final FacetType myFacetType;
33 public FacetTypeConfigurable(final FacetStructureConfigurable facetStructureConfigurable, final FacetType facetType) {
34 myFacetStructureConfigurable = facetStructureConfigurable;
35 myFacetType = facetType;
38 public void setDisplayName(final String name) {
41 public FacetType getEditableObject() {
42 return myFacetType;
45 public String getBannerSlogan() {
46 return ProjectBundle.message("facet.type.banner.text", myFacetType.getPresentableName());
49 public JComponent createOptionsPanel() {
50 return myFacetStructureConfigurable.getOrCreateFacetTypeEditor(myFacetType).createComponent();
53 public String getDisplayName() {
54 return myFacetType.getPresentableName();
57 public Icon getIcon() {
58 return myFacetType.getIcon();
61 public String getHelpTopic() {
62 final FacetTypeEditor editor = myFacetStructureConfigurable.getFacetTypeEditor(myFacetType);
63 return editor != null ? editor.getHelpTopic() : null;
66 public boolean isModified() {
67 return false;
70 public void apply() throws ConfigurationException {
73 public void reset() {
76 public void disposeUIResources() {
79 public void updateComponent() {
80 resetOptionsPanel();