19 package org.sleuthkit.autopsy.filequery;
21 import java.util.Arrays;
22 import java.util.HashSet;
23 import java.util.List;
25 import java.util.TreeSet;
26 import org.openide.nodes.Children;
27 import org.openide.nodes.Node;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
38 class DiscoveryThumbnailChildren
extends Children.Keys<AbstractFile> {
40 private final List<AbstractFile> files;
45 DiscoveryThumbnailChildren(List<AbstractFile> files) {
53 protected Node[] createNodes(AbstractFile t) {
54 return new Node[]{
new ThumbnailNode(t)};
58 protected void addNotify() {
61 Set<AbstractFile> thumbnails =
new TreeSet<>((AbstractFile file1, AbstractFile file2) -> {
62 int result = Long.compare(file1.getSize(), file2.getSize());
64 result = file1.getName().compareTo(file2.getName());
69 thumbnails.addAll(files);
76 static class ThumbnailNode
extends FileNode {
78 ThumbnailNode(AbstractFile file) {
83 protected Sheet createSheet() {
84 Sheet sheet = super.createSheet();
85 Set<String> keepProps =
new HashSet<>(Arrays.asList(
86 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.nameColLbl"),
87 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.createSheet.score.name"),
88 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.createSheet.comment.name"),
89 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.createSheet.count.name"),
90 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.sizeColLbl"),
91 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.mimeType"),
92 NbBundle.getMessage(AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.knownColLbl")));
95 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
96 for (Node.Property<?> p : sheetSet.getProperties()) {
97 if (!keepProps.contains(p.getName())) {
98 sheetSet.remove(p.getName());