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.
17 package com
.intellij
.openapi
.roots
.ui
.configuration
.projectRoot
;
19 import com
.intellij
.openapi
.options
.ConfigurationException
;
20 import com
.intellij
.openapi
.roots
.libraries
.LibraryTable
;
21 import com
.intellij
.openapi
.ui
.NamedConfigurable
;
22 import com
.intellij
.openapi
.ui
.PanelWithText
;
23 import com
.intellij
.openapi
.util
.IconLoader
;
27 public class LibrariesConfigurable
extends NamedConfigurable
<String
> {
28 private static final Icon ICON
= IconLoader
.getIcon("/modules/library.png");
30 private LibraryTable myLibraryTable
;
32 private final PanelWithText myPanel
= new PanelWithText();
34 protected LibrariesConfigurable(final LibraryTable libraryTable
) {
35 myLibraryTable
= libraryTable
;
39 // nothing to implement
42 public final void apply() throws ConfigurationException
{
45 public final void disposeUIResources() {
46 myLibraryTable
= null;
49 public final boolean isModified() {
54 public JComponent
createOptionsPanel() {
55 myPanel
.setText(myLibraryTable
.getPresentation().getDescription());
60 public String
getDisplayName() {
61 return myLibraryTable
.getPresentation().getDisplayName(true);
64 public String
getHelpTopic() {
65 return "preferences.jdkGlobalLibs";
68 public Icon
getIcon() {
72 public void setDisplayName(final String name
) {
76 public String
getEditableObject() {
77 return myLibraryTable
.getTableLevel();
80 public String
getBannerSlogan() {
81 return getDisplayName();