mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Arq: add libs to container - draft
This commit is contained in:
+12
-16
@@ -68,22 +68,18 @@ public class RepositoryLibrarySupport {
|
||||
}
|
||||
final DependencyScope dependencyScope = LibraryDependencyScopeSuggester.getDefaultScope(library);
|
||||
final ModifiableRootModel moduleModifiableModel = modifiableModelsProvider.getModuleModifiableModel(module);
|
||||
try {
|
||||
LibraryOrderEntry foundEntry =
|
||||
(LibraryOrderEntry)Iterables.find(Arrays.asList(moduleModifiableModel.getOrderEntries()), new Predicate<OrderEntry>() {
|
||||
@Override
|
||||
public boolean apply(@Nullable OrderEntry entry) {
|
||||
return entry instanceof LibraryOrderEntry
|
||||
&& ((LibraryOrderEntry)entry).getScope() == dependencyScope
|
||||
&& isLibraryEqualsToSelected(((LibraryOrderEntry)entry).getLibrary());
|
||||
}
|
||||
}, null);
|
||||
if (foundEntry == null) {
|
||||
rootModel.addLibraryEntry(library).setScope(dependencyScope);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
moduleModifiableModel.dispose();
|
||||
LibraryOrderEntry foundEntry =
|
||||
(LibraryOrderEntry)Iterables.find(Arrays.asList(moduleModifiableModel.getOrderEntries()), new Predicate<OrderEntry>() {
|
||||
@Override
|
||||
public boolean apply(@Nullable OrderEntry entry) {
|
||||
return entry instanceof LibraryOrderEntry
|
||||
&& ((LibraryOrderEntry)entry).getScope() == dependencyScope
|
||||
&& isLibraryEqualsToSelected(((LibraryOrderEntry)entry).getLibrary());
|
||||
}
|
||||
}, null);
|
||||
modifiableModelsProvider.disposeModuleModifiableModel(moduleModifiableModel);
|
||||
if (foundEntry == null) {
|
||||
rootModel.addLibraryEntry(library).setScope(dependencyScope);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -74,7 +74,11 @@ public class RepositoryLibraryType extends LibraryType<RepositoryLibraryProperti
|
||||
if (properties == null || !(properties instanceof RepositoryLibraryProperties)) {
|
||||
return MavenIcons.MavenLogo;
|
||||
}
|
||||
return RepositoryLibraryDescription.findDescription((RepositoryLibraryProperties)properties).getIcon();
|
||||
RepositoryLibraryProperties repositoryLibraryProperties = (RepositoryLibraryProperties)properties;
|
||||
if (repositoryLibraryProperties.getGroupId() == null || repositoryLibraryProperties.getArtifactId() == null) {
|
||||
return MavenIcons.MavenLogo;
|
||||
}
|
||||
return RepositoryLibraryDescription.findDescription(repositoryLibraryProperties).getIcon();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user