Set the internal name of the InterestingItemTypeNode to be something that is unique so that paging works correctly when a user switches back and forth between multiple different interesting file/result sets.

This commit is contained in:
esaunders 2019-09-30 16:32:09 -04:00
parent 98cea65a61
commit 5e093d65d5

View File

@ -399,7 +399,12 @@ public class InterestingHits implements AutopsyVisitableItem {
super(Children.create(new HitFactory(setName, typeName), true), Lookups.singleton(setName)); super(Children.create(new HitFactory(setName, typeName), true), Lookups.singleton(setName));
this.typeName = typeName; this.typeName = typeName;
this.setName = setName; this.setName = setName;
super.setName(typeName); /**
* We use the combination of setName and typeName as the name of
* the node to ensure that nodes have a unique name. This comes into
* play when associating paging state with the node.
*/
super.setName(setName + "_" + typeName);
updateDisplayName(); updateDisplayName();
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); //NON-NLS this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); //NON-NLS
interestingResults.addObserver(this); interestingResults.addObserver(this);
@ -456,7 +461,12 @@ public class InterestingHits implements AutopsyVisitableItem {
private final Map<Long, BlackboardArtifact> artifactHits = new HashMap<>(); private final Map<Long, BlackboardArtifact> artifactHits = new HashMap<>();
private HitFactory(String setName, String typeName) { private HitFactory(String setName, String typeName) {
super(typeName); /**
* The node name passed to the parent constructor must be the
* same as the name set in the InterestingItemTypeNode constructor,
* i.e. setName underscore typeName
*/
super(setName + "_" + typeName);
this.setName = setName; this.setName = setName;
this.typeName = typeName; this.typeName = typeName;
interestingResults.addObserver(this); interestingResults.addObserver(this);