From 2bcade64f487da102df3fc0da69e55b67c0104b7 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Fri, 26 Feb 2021 11:13:45 -0500 Subject: [PATCH] commenting --- .../DirectoryTreeTopComponent.java | 21 ++++++++++++++----- .../directorytree/ViewContextAction.java | 6 ++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index ee83cf3e29..4a3a432aed 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -1144,6 +1144,17 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat return null; } + /** + * Navigates to artifact and shows in view. + * + * NOTE: This code will likely need updating in the event that the structure + * of the nodes is changed (i.e. adding parent levels). Places to look when + * changing node structure include: + * + * DirectoryTreeTopComponent.viewArtifact, ViewContextAction + * + * @param art The artifact. + */ public void viewArtifact(final BlackboardArtifact art) { int typeID = art.getArtifactTypeID(); String typeName = art.getArtifactTypeName(); @@ -1238,16 +1249,16 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat if (setNode == null) { return; } - + Children fileArtifactChildren = setNode.getChildren(); Node[] fileArtifactNodes = fileArtifactChildren == null ? null : fileArtifactChildren.getNodes(); if (fileArtifactNodes == null || fileArtifactNodes.length != 2) { return; } - - treeNode = (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID()) ? - fileArtifactNodes[0] : - fileArtifactNodes[1]; + + treeNode = (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID()) + ? fileArtifactNodes[0] + : fileArtifactNodes[1]; } catch (TskCoreException ex) { LOGGER.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java index cd66b54971..bb8fd7c561 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java @@ -147,6 +147,12 @@ public class ViewContextAction extends AbstractAction { * branch of the tree view to the level of the parent of the content, * selecting the parent in the tree view, then selecting the content in the * results view. + * + * NOTE: This code will likely need updating in the event that the structure + * of the nodes is changed (i.e. adding parent levels). Places to look when + * changing node structure include: + * + * DirectoryTreeTopComponent.viewArtifact, ViewContextAction * * @param event The action event. */