19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.util.List;
23 import java.util.logging.Level;
24 import org.openide.nodes.ChildFactory;
25 import org.openide.nodes.Node;
30 import static org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT;
38 final class ContactsChildNodeFactory
extends ChildFactory<BlackboardArtifact> {
40 private static final Logger logger = Logger.getLogger(ContactsChildNodeFactory.class.getName());
42 private SelectionInfo selectionInfo;
50 ContactsChildNodeFactory(SelectionInfo selectionInfo) {
51 this.selectionInfo = selectionInfo;
60 public void refresh(SelectionInfo selectionInfo) {
61 this.selectionInfo = selectionInfo;
74 protected boolean createKeys(List<BlackboardArtifact> list) {
76 if (selectionInfo == null) {
80 final Set<Content> relationshipSources;
82 relationshipSources = selectionInfo.getRelationshipSources();
83 }
catch (TskCoreException ex) {
84 logger.log(Level.SEVERE,
"Failed to load relationship sources.", ex);
88 relationshipSources.stream().filter((content) -> (content instanceof BlackboardArtifact)).forEachOrdered((content) -> {
90 BlackboardArtifact bba = (BlackboardArtifact) content;
91 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(bba.getArtifactTypeID());
93 if (fromID == TSK_CONTACT) {
102 protected Node createNodeForKey(BlackboardArtifact key) {
103 return new ContactNode(key);