use of com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor in project intellij-community by JetBrains.
the class LibraryOptionsPanel method doConfigure.
private void doConfigure() {
switch(myButtonEnumModel.getSelected()) {
case DOWNLOAD:
final LibraryDownloadSettings oldDownloadSettings = mySettings.getDownloadSettings();
LOG.assertTrue(oldDownloadSettings != null);
final LibraryDownloadSettings newDownloadSettings = DownloadingOptionsDialog.showDialog(myPanel, oldDownloadSettings, mySettings.getCompatibleVersions(), true);
if (newDownloadSettings != null) {
mySettings.setDownloadSettings(newDownloadSettings);
}
break;
case USE_LIBRARY:
final Object item = myExistingLibraryComboBox.getSelectedItem();
if (item instanceof LibraryEditor) {
EditLibraryDialog dialog = new EditLibraryDialog(myPanel, mySettings, (LibraryEditor) item);
dialog.show();
if (item instanceof ExistingLibraryEditor) {
new WriteAction() {
protected void run(@NotNull final Result result) {
((ExistingLibraryEditor) item).commit();
}
}.execute();
}
}
break;
case USE_FROM_PROVIDER:
case SETUP_LIBRARY_LATER:
break;
}
updateState();
}
use of com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor in project intellij-community by JetBrains.
the class LibrariesModifiableModel method getLibraryEditor.
public ExistingLibraryEditor getLibraryEditor(Library library) {
final Library source = ((LibraryImpl) library).getSource();
if (source != null) {
return getLibraryEditor(source);
}
ExistingLibraryEditor libraryEditor = myLibrary2EditorMap.get(library);
if (libraryEditor == null) {
libraryEditor = createLibraryEditor(library);
}
return libraryEditor;
}
use of com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor in project intellij-community by JetBrains.
the class LibraryCompositionSettings method getOrCreateEditor.
public ExistingLibraryEditor getOrCreateEditor(@NotNull Library library) {
ExistingLibraryEditor libraryEditor = myExistingLibraryEditors.get(library);
if (libraryEditor == null) {
libraryEditor = new ExistingLibraryEditor(library, null);
Disposer.register(this, libraryEditor);
myExistingLibraryEditors.put(library, libraryEditor);
}
return libraryEditor;
}
use of com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor in project intellij-community by JetBrains.
the class LibrariesModifiableModel method deferredCommit.
public void deferredCommit() {
final List<ExistingLibraryEditor> libraryEditors = new ArrayList<>(myLibrary2EditorMap.values());
myLibrary2EditorMap.clear();
for (ExistingLibraryEditor libraryEditor : libraryEditors) {
// TODO: is seems like commit will recreate the editor, but it should not
libraryEditor.commit();
Disposer.dispose(libraryEditor);
}
if (!libraryEditors.isEmpty() || !myRemovedLibraries.isEmpty() || myLibrariesModifiableModel != null && myLibrariesModifiableModel.isChanged()) {
getLibrariesModifiableModel().commit();
myLibrariesModifiableModel = null;
}
myRemovedLibraries.clear();
}
use of com.intellij.openapi.roots.ui.configuration.libraryEditor.ExistingLibraryEditor in project intellij-community by JetBrains.
the class LibrariesModifiableModel method createLibraryEditor.
private ExistingLibraryEditor createLibraryEditor(final Library library) {
final ExistingLibraryEditor libraryEditor = new ExistingLibraryEditor(library, myLibraryEditorListener);
myLibrary2EditorMap.put(library, libraryEditor);
return libraryEditor;
}
Aggregations