fix(api): allow to create input category node even if no matching files found (#2806)
This commit is contained in:
@@ -4,6 +4,7 @@ import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import jadx.gui.treemodel.JNode;
|
||||
|
||||
@@ -19,7 +20,11 @@ public interface ITreeInputCategory {
|
||||
boolean filesFilter(Path file);
|
||||
|
||||
/**
|
||||
* Build node for filtered files
|
||||
* Build node for filtered files.
|
||||
* Can be called with empty list (empty category might be useful)
|
||||
*
|
||||
* @return category node or null if not needed
|
||||
*/
|
||||
@Nullable
|
||||
JNode buildInputNode(List<Path> files);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ public class TreeInputsHelper {
|
||||
|
||||
public List<JNode> getCustomNodes() {
|
||||
return categoryData.stream()
|
||||
.filter(CategoryData::notEmpty)
|
||||
.map(CategoryData::buildInputNode)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
@@ -84,9 +83,5 @@ public class TreeInputsHelper {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean notEmpty() {
|
||||
return !collectedFiles.isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user