diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.form b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.form
new file mode 100644
index 000000000000..6255628ea536
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.form
@@ -0,0 +1,133 @@
+
+
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.java b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.java
new file mode 100644
index 000000000000..0d24748ffbf4
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/DownloadingOptionsDialog.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.facet.impl.ui.libraries;
+
+import com.intellij.facet.ui.libraries.LibraryInfo;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.project.ProjectBundle;
+import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainer;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.ui.TextFieldWithBrowseButton;
+import com.intellij.ui.CheckBoxList;
+import com.intellij.ui.CollectionListModel;
+import com.intellij.ui.EnumComboBoxModel;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class DownloadingOptionsDialog extends DialogWrapper {
+
+ private JPanel myPanel;
+ private CheckBoxList myFilesList;
+ private TextFieldWithBrowseButton myDirectoryField;
+ private JTextField myLibraryNameField;
+ private JComboBox myLevelComboBox;
+ private JCheckBox myDownloadSourcesCheckBox;
+ private JLabel myFilesToDownloadLabel;
+ private JLabel myCopyDownloadedFilesToLabel;
+ private JCheckBox myDownloadJavadocsCheckBox;
+ private final LibraryCompositionSettings mySettings;
+
+ protected DownloadingOptionsDialog(Component parent, LibraryCompositionSettings settings) {
+ super(parent, true);
+ setTitle("Downloading Options");
+ mySettings = settings;
+
+ myFilesList.setModel(new CollectionListModel(ContainerUtil.map2Array(settings.getLibraryInfos(), new Function() {
+ @Override
+ public Object fun(LibraryInfo libraryInfo) {
+ return new JCheckBox(libraryInfo.getPresentableName(), libraryInfo.isSelected());
+ }
+ })));
+ myFilesToDownloadLabel.setLabelFor(myFilesList);
+
+ myDirectoryField.addBrowseFolderListener(ProjectBundle.message("file.chooser.directory.for.downloaded.libraries.title"),
+ ProjectBundle.message("file.chooser.directory.for.downloaded.libraries.description"), null,
+ FileChooserDescriptorFactory.createSingleFolderDescriptor());
+
+ myCopyDownloadedFilesToLabel.setLabelFor(myDirectoryField);
+ myDirectoryField.setText(settings.getDirectoryForDownloadedLibrariesPath());
+
+ myDownloadSourcesCheckBox.setSelected(settings.isDownloadSources());
+ myDownloadJavadocsCheckBox.setSelected(settings.isDownloadJavadocs());
+ myLibraryNameField.setText(settings.getLibraryName());
+ myLevelComboBox.setModel(new EnumComboBoxModel(LibrariesContainer.LibraryLevel.class));
+ myLevelComboBox.setSelectedItem(settings.getLibraryLevel());
+ init();
+ }
+
+ @Override
+ protected JComponent createCenterPanel() {
+ return myPanel;
+ }
+
+ @Override
+ public JComponent getPreferredFocusedComponent() {
+ return myFilesList;
+ }
+
+ @Override
+ protected void doOKAction() {
+ mySettings.setLibraryName(myLibraryNameField.getText());
+ mySettings.setLibraryLevel((LibrariesContainer.LibraryLevel)myLevelComboBox.getSelectedItem());
+ mySettings.setDirectoryForDownloadedLibrariesPath(myDirectoryField.getText());
+ LibraryInfo[] libraryInfos = mySettings.getLibraryInfos();
+ for (int i = 0, libraryInfosLength = libraryInfos.length; i < libraryInfosLength; i++) {
+ LibraryInfo info = libraryInfos[i];
+ info.setSelected(myFilesList.isItemSelected(i));
+ }
+ mySettings.setDownloadSources(myDownloadSourcesCheckBox.isSelected());
+ mySettings.setDownloadJavadocs(myDownloadJavadocsCheckBox.isSelected());
+ super.doOKAction();
+ }
+}
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.form b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.form
new file mode 100644
index 000000000000..8a1edd8da239
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.form
@@ -0,0 +1,81 @@
+
+
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.java b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.java
new file mode 100644
index 000000000000..e25bf7c0f1e1
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.facet.impl.ui.libraries;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.roots.impl.libraries.ApplicationLibraryTable;
+import com.intellij.openapi.roots.libraries.Library;
+import com.intellij.openapi.roots.libraries.LibraryTable;
+import com.intellij.openapi.roots.libraries.LibraryTablePresentation;
+import com.intellij.openapi.roots.ui.configuration.LibraryTableModifiableModelProvider;
+import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryTableEditor;
+import com.intellij.openapi.ui.DialogWrapper;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class EditLibraryDialog extends DialogWrapper {
+
+ private ApplicationLibraryTable myLibraryTable = new ApplicationLibraryTable();
+ private Library myLibrary;
+ private JTextField myTextField1;
+ private JComboBox myComboBox1;
+ private JPanel myEditorPanel;
+ private JPanel myPanel;
+
+ protected EditLibraryDialog(Component parent) {
+ super(parent, true);
+ setTitle("Edit Library");
+ ApplicationManager.getApplication().runWriteAction(new Runnable() {
+ @Override
+ public void run() {
+ myLibrary = myLibraryTable.createLibrary("xxx");
+ }
+ });
+ init();
+
+ }
+
+ @Override
+ protected JComponent createCenterPanel() {
+
+ JComponent editor = LibraryTableEditor.editLibrary(new LibraryTableModifiableModelProvider() {
+
+ @Override
+ public LibraryTable.ModifiableModel getModifiableModel() {
+ return myLibraryTable.getModifiableModel();
+ }
+
+ @Override
+ public String getTableLevel() {
+ return myLibraryTable.getTableLevel();
+ }
+
+ @Override
+ public LibraryTablePresentation getLibraryTablePresentation() {
+ return myLibraryTable.getPresentation();
+ }
+
+ @Override
+ public boolean isLibraryTableEditable() {
+ return false;
+ }
+ }, myLibrary).getComponent();
+
+ myEditorPanel.add(editor, BorderLayout.CENTER);
+ return myPanel;
+ }
+}
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionOptionsPanel.java b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionOptionsPanel.java
index dbac47342136..1f7d0c5402e8 100644
--- a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionOptionsPanel.java
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionOptionsPanel.java
@@ -33,7 +33,6 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.ui.IdeBorderFactory;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -74,14 +73,15 @@ public class LibraryCompositionOptionsPanel {
private final LibraryDownloadingMirrorsMap myMirrorsMap;
private List myMirrorPanelsList;
- public LibraryCompositionOptionsPanel(final @NotNull LibrariesContainer librariesContainer, final @NotNull LibraryCompositionSettings libraryCompositionSettings,
+ public LibraryCompositionOptionsPanel(final @NotNull LibrariesContainer librariesContainer,
+ final @NotNull LibraryCompositionSettings libraryCompositionSettings,
final @NotNull LibraryDownloadingMirrorsMap mirrorsMap) {
+
myLibrariesContainer = librariesContainer;
myLibraryCompositionSettings = libraryCompositionSettings;
myMirrorsMap = mirrorsMap;
addMirrorsPanels();
- myMainPanel.setBorder(BorderFactory.createCompoundBorder(IdeBorderFactory.createTitledBorder(libraryCompositionSettings.getTitle()), IdeBorderFactory.createEmptyBorder(5,5,5,5)));
myDirectoryField.addBrowseFolderListener(ProjectBundle.message("file.chooser.directory.for.downloaded.libraries.title"),
ProjectBundle.message("file.chooser.directory.for.downloaded.libraries.description"), null,
FileChooserDescriptorFactory.createSingleFolderDescriptor());
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionSettings.java b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionSettings.java
index 4e9968ec4f11..b17a33933d0a 100644
--- a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionSettings.java
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionSettings.java
@@ -47,6 +47,8 @@ public class LibraryCompositionSettings {
private LibrariesContainer.LibraryLevel myLibraryLevel = LibrariesContainer.LibraryLevel.PROJECT;
private String myLibraryName;
private final Icon myIcon;
+ private boolean myDownloadSources = true;
+ private boolean myDownloadJavadocs = true;
public LibraryCompositionSettings(final @NotNull LibraryInfo[] libraryInfos,
final @NotNull String defaultLibraryName,
@@ -191,4 +193,20 @@ public class LibraryCompositionSettings {
}
return library;
}
+
+ public boolean isDownloadSources() {
+ return myDownloadSources;
+ }
+
+ public void setDownloadSources(boolean downloadSources) {
+ myDownloadSources = downloadSources;
+ }
+
+ public boolean isDownloadJavadocs() {
+ return myDownloadJavadocs;
+ }
+
+ public void setDownloadJavadocs(boolean downloadJavadocs) {
+ myDownloadJavadocs = downloadJavadocs;
+ }
}
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.form b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.form
new file mode 100644
index 000000000000..f9f3a65c530a
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.form
@@ -0,0 +1,81 @@
+
+
diff --git a/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.java b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.java
new file mode 100644
index 000000000000..48282ebfe77b
--- /dev/null
+++ b/java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryOptionsPanel.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.facet.impl.ui.libraries;
+
+import com.intellij.ide.IdeBundle;
+import com.intellij.openapi.fileChooser.FileChooser;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.MessageFormat;
+
+/**
+ * @author Dmitry Avdeev
+ */
+public class LibraryOptionsPanel {
+
+ private JLabel myMessage;
+ private JPanel myPanel;
+ private JRadioButton myDownloadFromMavenButton;
+ private JRadioButton myDoNotCreateButton;
+ private JButton myConfigureButton;
+ private JRadioButton myLocateOnDiskButton;
+
+ private LibraryCompositionSettings myLibraryCompositionSettings;
+
+ public LibraryOptionsPanel(LibraryCompositionSettings libraryCompositionSettings) {
+ myLibraryCompositionSettings = libraryCompositionSettings;
+ ActionListener listener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ updateState();
+ }
+ };
+ myDownloadFromMavenButton.addActionListener(listener);
+ myLocateOnDiskButton.addActionListener(listener);
+ myDoNotCreateButton.addActionListener(listener);
+
+ myConfigureButton.addActionListener(new ActionListener() {
+ public void actionPerformed(final ActionEvent e) {
+ final Point point = myConfigureButton.getLocationOnScreen();
+ if (myLocateOnDiskButton.isSelected()) {
+ EditLibraryDialog dialog = new EditLibraryDialog(myConfigureButton) {
+ @Override
+ public Point getInitialLocation() {
+ point.translate(- 50, - getSize().height);
+ return point;
+ }
+ };
+ dialog.show();
+ }
+ else {
+ new DownloadingOptionsDialog(myConfigureButton, myLibraryCompositionSettings) {
+ @Override
+ public Point getInitialLocation() {
+ point.translate(- 50, - getSize().height);
+ return point;
+ }
+ }.show();
+ }
+ }
+ });
+
+ updateState();
+ }
+
+
+ private VirtualFile[] showFileChooser() {
+ final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, false, true, false, false, true);
+ descriptor.setTitle(IdeBundle.message("file.chooser.select.paths.title"));
+ descriptor.setDescription(IdeBundle.message("file.chooser.multiselect.description"));
+ return FileChooser.chooseFiles(myConfigureButton, descriptor, getBaseDirectory());
+ }
+
+ @Nullable
+ private VirtualFile getBaseDirectory() {
+ String path = myLibraryCompositionSettings.getBaseDirectoryForDownloadedFiles();
+ VirtualFile dir = LocalFileSystem.getInstance().findFileByPath(path);
+ if (dir == null) {
+ path = path.substring(0, path.lastIndexOf('/'));
+ dir = LocalFileSystem.getInstance().findFileByPath(path);
+ }
+ return dir;
+ }
+
+ private void updateState() {
+ if (myMessage.isEnabled()) {
+ myMessage.setForeground(Color.black);
+ }
+ myConfigureButton.setEnabled(true);
+ if (myDownloadFromMavenButton.isSelected()) {
+ String path = myLibraryCompositionSettings.getDirectoryForDownloadedLibrariesPath().substring(myLibraryCompositionSettings.getBaseDirectoryForDownloadedFiles().length());
+ String message = MessageFormat.format("{0} jar(s) will be downloaded into {1} directory
" +
+ "{2} level library {3} will be created",
+ myLibraryCompositionSettings.getLibraryInfos().length,
+ path,
+ myLibraryCompositionSettings.getLibraryLevel(),
+ myLibraryCompositionSettings.getLibraryName());
+ myMessage.setText(message);
+ }
+ else if (myLocateOnDiskButton.isSelected()) {
+ if (myLibraryCompositionSettings.getAddedJars().isEmpty()) {
+ myMessage.setForeground(Color.red);
+ myMessage.setText("Press Configure button to add classes to the library");
+ }
+ else {
+ String message = MessageFormat.format("{0} level library {1}
" +
+ "with {2} file(s) will be created",
+ myLibraryCompositionSettings.getLibraryLevel(),
+ myLibraryCompositionSettings.getLibraryName(),
+ myLibraryCompositionSettings.getAddedJars().size());
+ myMessage.setText(message);
+ }
+ }
+ else {
+ myMessage.setText("No library will be created
" +
+ "You can add it later manually");
+ myConfigureButton.setEnabled(false);
+ }
+ }
+
+ public LibraryCompositionSettings getLibraryCompositionSettings() {
+ return myLibraryCompositionSettings;
+ }
+
+
+ public void apply() {
+
+ }
+
+ public JComponent getMainPanel() {
+ return myPanel;
+ }
+}
diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java
index e4a143fc4fb6..f43eef778f40 100644
--- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java
+++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java
@@ -16,9 +16,9 @@
package com.intellij.ide.util.newProjectWizard;
-import com.intellij.facet.impl.ui.libraries.LibraryCompositionOptionsPanel;
import com.intellij.facet.impl.ui.libraries.LibraryCompositionSettings;
import com.intellij.facet.impl.ui.libraries.LibraryDownloadingMirrorsMap;
+import com.intellij.facet.impl.ui.libraries.LibraryOptionsPanel;
import com.intellij.facet.ui.FacetBasedFrameworkSupportProvider;
import com.intellij.facet.ui.libraries.LibraryDownloadInfo;
import com.intellij.facet.ui.libraries.LibraryInfo;
@@ -131,10 +131,7 @@ public class AddSupportForFrameworksPanel implements Disposable {
myLastSelectedNode = selectedNode;
if (selectedNode != null) {
- final LibraryCompositionOptionsPanel newOptionsPanel = selectedNode.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
- if (newOptionsPanel != null) {
- newOptionsPanel.updateRepositoriesMirrors(myMirrorsMap);
- }
+ selectedNode.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
}
}
}
@@ -145,9 +142,8 @@ public class AddSupportForFrameworksPanel implements Disposable {
private void applyLibraryOptionsForSelected() {
if (myLastSelectedNode != null) {
- final LibraryCompositionOptionsPanel optionsPanel = myLastSelectedNode.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
+ final LibraryOptionsPanel optionsPanel = myLastSelectedNode.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
if (optionsPanel != null) {
- optionsPanel.saveSelectedRepositoriesMirrors(myMirrorsMap);
optionsPanel.apply();
}
}
@@ -174,13 +170,17 @@ public class AddSupportForFrameworksPanel implements Disposable {
private void initializeOptionsPanel(final FrameworkSupportNode node) {
final String id = node.getProvider().getId();
if (!myInitializedOptionsPanelIds.contains(id)) {
- final JPanel optionsPanel = new JPanel(new VerticalFlowLayout());
+ VerticalFlowLayout layout = new VerticalFlowLayout();
+ layout.setVerticalFill(true);
+ final JPanel optionsPanel = new JPanel(layout);
+
JComponent separator = SeparatorFactory.createSeparator(node.getTitle() + " Settings", null);
separator.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 5, 5));
-
optionsPanel.add(separator);
+
final FrameworkSupportConfigurable configurable = node.getConfigurable();
optionsPanel.add(configurable.getComponent());
+
final JPanel librariesOptionsPanelWrapper = new JPanel(new BorderLayout());
optionsPanel.add(librariesOptionsPanelWrapper);
configurable.addListener(new FrameworkSupportConfigurableListener() {
@@ -197,8 +197,11 @@ public class AddSupportForFrameworksPanel implements Disposable {
}
private void addLibrariesOptionsPanel(FrameworkSupportNode node, JPanel librariesOptionsPanelWrapper) {
- final LibraryCompositionOptionsPanel libraryOptionsPanel = node.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
+ final LibraryOptionsPanel libraryOptionsPanel = node.getLibraryCompositionOptionsPanel(myLibrariesContainer, myMirrorsMap);
if (libraryOptionsPanel != null) {
+ JComponent separator = SeparatorFactory.createSeparator("Libraries", null);
+ separator.setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 5, 5));
+ librariesOptionsPanelWrapper.add(BorderLayout.NORTH, separator);
librariesOptionsPanelWrapper.add(BorderLayout.CENTER, libraryOptionsPanel.getMainPanel());
}
}
diff --git a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/FrameworkSupportNode.java b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/FrameworkSupportNode.java
index 351b992ec178..e49fffbe98c1 100644
--- a/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/FrameworkSupportNode.java
+++ b/java/idea-ui/src/com/intellij/ide/util/newProjectWizard/FrameworkSupportNode.java
@@ -15,9 +15,9 @@
*/
package com.intellij.ide.util.newProjectWizard;
-import com.intellij.facet.impl.ui.libraries.LibraryCompositionOptionsPanel;
import com.intellij.facet.impl.ui.libraries.LibraryCompositionSettings;
import com.intellij.facet.impl.ui.libraries.LibraryDownloadingMirrorsMap;
+import com.intellij.facet.impl.ui.libraries.LibraryOptionsPanel;
import com.intellij.facet.ui.libraries.LibraryInfo;
import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable;
import com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider;
@@ -50,7 +50,7 @@ public class FrameworkSupportNode extends CheckedTreeNode {
private final List myChildren = new ArrayList();
private LibraryCompositionSettings myLibraryCompositionSettings;
private final Computable myBaseDirForLibrariesGetter;
- private LibraryCompositionOptionsPanel myLibraryCompositionOptionsPanel;
+ private LibraryOptionsPanel myLibraryCompositionOptionsPanel;
public FrameworkSupportNode(final FrameworkSupportProvider provider, final FrameworkSupportNode parentNode, final FrameworkSupportModelImpl model,
Computable baseDirForLibrariesGetter, Disposable parentDisposable) {
@@ -75,12 +75,12 @@ public class FrameworkSupportNode extends CheckedTreeNode {
}
@Nullable
- public LibraryCompositionOptionsPanel getLibraryCompositionOptionsPanel(LibrariesContainer librariesContainer,
+ public LibraryOptionsPanel getLibraryCompositionOptionsPanel(LibrariesContainer librariesContainer,
LibraryDownloadingMirrorsMap mirrorsMap) {
final LibraryCompositionSettings libraryCompositionSettings = getLibraryCompositionSettings();
if (myLibraryCompositionOptionsPanel == null || !myLibraryCompositionOptionsPanel.getLibraryCompositionSettings().equals(libraryCompositionSettings)) {
if (libraryCompositionSettings != null) {
- myLibraryCompositionOptionsPanel = new LibraryCompositionOptionsPanel(librariesContainer, libraryCompositionSettings, mirrorsMap);
+ myLibraryCompositionOptionsPanel = new LibraryOptionsPanel(libraryCompositionSettings);
}
else {
myLibraryCompositionOptionsPanel = null;
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainer.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainer.java
index 25ed711b32c0..7b7cabfcf609 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainer.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/LibrariesContainer.java
@@ -18,6 +18,7 @@ package com.intellij.openapi.roots.ui.configuration.projectRoot;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.roots.libraries.Library;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -31,7 +32,12 @@ public interface LibrariesContainer {
@Nullable
Project getProject();
- enum LibraryLevel {GLOBAL, PROJECT, MODULE}
+ enum LibraryLevel {GLOBAL, PROJECT, MODULE;
+
+ public String toString() {
+ return StringUtil.capitalize(name().toLowerCase());
+ }
+ }
@NotNull
Library[] getLibraries(@NotNull LibraryLevel libraryLevel);
diff --git a/platform/lang-api/src/com/intellij/facet/ui/libraries/LibraryInfo.java b/platform/lang-api/src/com/intellij/facet/ui/libraries/LibraryInfo.java
index 2d2534dfe41f..47fbaae8918c 100644
--- a/platform/lang-api/src/com/intellij/facet/ui/libraries/LibraryInfo.java
+++ b/platform/lang-api/src/com/intellij/facet/ui/libraries/LibraryInfo.java
@@ -26,9 +26,11 @@ import java.util.Arrays;
*/
public class LibraryInfo {
public static final LibraryInfo[] EMPTY_ARRAY = new LibraryInfo[0];
+
private @Nullable final LibraryDownloadInfo myDownloadInfo;
private @NonNls final String myPresentableName;
private @NonNls final String[] myRequiredClasses;
+ private boolean mySelected = true;
public LibraryInfo(final @NonNls String presentableName, final @Nullable @NonNls String version,
final @Nullable @NonNls String downloadingUrl,
@@ -87,4 +89,17 @@ public class LibraryInfo {
result = 31 * result + Arrays.hashCode(myRequiredClasses);
return result;
}
+
+ @Override
+ public String toString() {
+ return getPresentableName();
+ }
+
+ public boolean isSelected() {
+ return mySelected;
+ }
+
+ public void setSelected(boolean selected) {
+ mySelected = selected;
+ }
}