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.
18 * Created by IntelliJ IDEA.
23 package com
.intellij
.openapi
.roots
.ui
.configuration
;
25 import com
.intellij
.openapi
.project
.Project
;
26 import com
.intellij
.openapi
.project
.ProjectBundle
;
27 import com
.intellij
.openapi
.roots
.ModifiableRootModel
;
28 import org
.jetbrains
.annotations
.NonNls
;
29 import org
.jetbrains
.annotations
.Nullable
;
34 public class OutputEditor
extends ModuleElementsEditor
{
35 private final BuildElementsEditor myCompilerOutputEditor
;
36 private final JavadocEditor myJavadocEditor
;
37 private final AnnotationsEditor myAnnotationsEditor
;
39 protected OutputEditor(final Project project
, final ModifiableRootModel model
) {
40 super(project
, model
);
41 myCompilerOutputEditor
= new BuildElementsEditor(project
, model
);
42 myJavadocEditor
= new JavadocEditor(project
, model
);
43 myAnnotationsEditor
= new AnnotationsEditor(project
, model
);
46 protected JComponent
createComponentImpl() {
47 final JPanel panel
= new JPanel(new GridBagLayout());
48 final GridBagConstraints gc
=
49 new GridBagConstraints(0, GridBagConstraints
.RELATIVE
, 1, 1, 1, 0, GridBagConstraints
.NORTHWEST
, GridBagConstraints
.HORIZONTAL
, new Insets(0, 0, 0, 0), 0, 0);
50 panel
.add(myCompilerOutputEditor
.createComponentImpl(), gc
);
51 final JPanel javadocPanel
= (JPanel
)myJavadocEditor
.createComponentImpl();
52 javadocPanel
.setBorder(BorderFactory
.createTitledBorder(myJavadocEditor
.getDisplayName()));
53 panel
.add(javadocPanel
, gc
);
54 final JPanel annotationsPanel
= (JPanel
)myAnnotationsEditor
.createComponentImpl();
55 annotationsPanel
.setBorder(BorderFactory
.createTitledBorder(myAnnotationsEditor
.getDisplayName()));
56 panel
.add(annotationsPanel
, gc
);
57 panel
.add(Box
.createVerticalBox(), new GridBagConstraints(0, GridBagConstraints
.RELATIVE
, 1, 1, 1, 1, GridBagConstraints
.CENTER
,
58 GridBagConstraints
.BOTH
, new Insets(0,0,0,0), 0, 0));
59 panel
.setBorder(BorderFactory
.createEmptyBorder(4, 4, 4, 4));
63 public void saveData() {
64 myCompilerOutputEditor
.saveData();
65 myJavadocEditor
.saveData();
66 myAnnotationsEditor
.saveData();
69 public String
getDisplayName() {
70 return ProjectBundle
.message("project.roots.path.tab.title");
73 public Icon
getIcon() {
74 return myCompilerOutputEditor
.getIcon();
78 public void moduleStateChanged() {
79 super.moduleStateChanged();
80 myCompilerOutputEditor
.moduleStateChanged();
81 myJavadocEditor
.moduleStateChanged();
82 myAnnotationsEditor
.moduleStateChanged();
86 public void moduleCompileOutputChanged(final String baseUrl
, final String moduleName
) {
87 super.moduleCompileOutputChanged(baseUrl
, moduleName
);
88 myCompilerOutputEditor
.moduleCompileOutputChanged(baseUrl
, moduleName
);
89 myJavadocEditor
.moduleCompileOutputChanged(baseUrl
, moduleName
);
90 myAnnotationsEditor
.moduleCompileOutputChanged(baseUrl
, moduleName
);
95 public String
getHelpTopic() {
96 return "projectStructure.modules.paths";