mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OrderEnumerator: call addCustomRootsForLibrary() when calculating urls
This commit is contained in:
@@ -60,9 +60,9 @@ public abstract class OrderEnumerationHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean addCustomOutput(@NotNull OrderEntry forOrderEntry,
|
||||
@NotNull OrderRootType type,
|
||||
@NotNull Collection<String> urls) {
|
||||
public boolean addCustomRootsForLibrary(@NotNull OrderEntry forOrderEntry,
|
||||
@NotNull OrderRootType type,
|
||||
@NotNull Collection<String> urls) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -326,11 +326,11 @@ abstract class OrderEnumeratorBase extends OrderEnumerator implements OrderEnume
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean addCustomOutput(OrderEntry forOrderEntry, OrderRootType type, Collection<VirtualFile> result) {
|
||||
boolean addCustomRootsForLibrary(OrderEntry forOrderEntry, OrderRootType type, Collection<VirtualFile> result) {
|
||||
for (OrderEnumerationHandler handler : myCustomHandlers) {
|
||||
final List<String> urls = new ArrayList<String>();
|
||||
final boolean added =
|
||||
handler.addCustomOutput(forOrderEntry, type, urls);
|
||||
handler.addCustomRootsForLibrary(forOrderEntry, type, urls);
|
||||
for (String url : urls) {
|
||||
ContainerUtil.addIfNotNull(VirtualFileManager.getInstance().findFileByUrl(url), result);
|
||||
}
|
||||
@@ -341,6 +341,19 @@ abstract class OrderEnumeratorBase extends OrderEnumerator implements OrderEnume
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean addCustomRootUrlsForLibrary(OrderEntry forOrderEntry, OrderRootType type, Collection<String> result) {
|
||||
for (OrderEnumerationHandler handler : myCustomHandlers) {
|
||||
final List<String> urls = new ArrayList<String>();
|
||||
final boolean added =
|
||||
handler.addCustomRootsForLibrary(forOrderEntry, type, urls);
|
||||
result.addAll(urls);
|
||||
if (added) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean addCustomOutputUrls(Module forModule, ModuleRootModel orderEntryRootModel, OrderRootType type, Collection<String> result) {
|
||||
for (OrderEnumerationHandler handler : myCustomHandlers) {
|
||||
if (handler.addCustomOutput(forModule, orderEntryRootModel, type, this, result)) {
|
||||
|
||||
+4
-1
@@ -128,7 +128,7 @@ public class OrderRootsEnumeratorImpl implements OrderRootsEnumerator {
|
||||
Collections.addAll(result, myCustomRootProvider.fun(orderEntry));
|
||||
return true;
|
||||
}
|
||||
if (myOrderEnumerator.addCustomOutput(orderEntry, type, result)) {
|
||||
if (myOrderEnumerator.addCustomRootsForLibrary(orderEntry, type, result)) {
|
||||
return true;
|
||||
}
|
||||
Collections.addAll(result, orderEntry.getFiles(type));
|
||||
@@ -168,6 +168,9 @@ public class OrderRootsEnumeratorImpl implements OrderRootsEnumerator {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (myOrderEnumerator.addCustomRootUrlsForLibrary(orderEntry, type, result)) {
|
||||
return true;
|
||||
}
|
||||
Collections.addAll(result, orderEntry.getUrls(type));
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user