IDEADEV-41372: Artifacts: exception on right0clicking on just deleted library
[fedora-idea.git] / java / idea-ui / src / com / intellij / openapi / roots / ui / configuration / projectRoot / LibrariesConfigurable.java
blobed457c70e51266d75afde21b240a6ad698675cf3
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.
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;
25 import javax.swing.*;
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;
38 public void reset() {
39 // nothing to implement
42 public final void apply() throws ConfigurationException {
45 public final void disposeUIResources() {
46 myLibraryTable = null;
49 public final boolean isModified() {
50 return false;
54 public JComponent createOptionsPanel() {
55 myPanel.setText(myLibraryTable.getPresentation().getDescription());
56 return myPanel;
60 public String getDisplayName() {
61 return myLibraryTable.getPresentation().getDisplayName(true);
64 public String getHelpTopic() {
65 return "preferences.jdkGlobalLibs";
68 public Icon getIcon() {
69 return ICON;
72 public void setDisplayName(final String name) {
73 //do nothing
76 public String getEditableObject() {
77 return myLibraryTable.getTableLevel();
80 public String getBannerSlogan() {
81 return getDisplayName();