@Override
protected ViewUpdate doInBackground() {
// Get the lookup for the node for access to its underlying content and
// blackboard artifact, if any.
Lookup lookup = selectedNode.getLookup();
// Get the content.
Content content = lookup.lookup(Content.class);
if (content == null) {
return new ViewUpdate(getArtifactContentStrings().size(), currentPage, ERROR_TEXT);
}
// Get all of the blackboard artifacts associated with the content. These are what this
// viewer displays.
ArrayList<BlackboardArtifact> artifacts;
try {
artifacts = content.getAllArtifacts();
}
catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't get artifacts", ex); //NON-NLS
return new ViewUpdate(getArtifactContentStrings().size(), currentPage, ERROR_TEXT);
}
if (isCancelled()) {
return null;
}
// Build the new artifact strings cache.
ArrayList<ArtifactStringContent> artifactStrings = new ArrayList<>();
for (BlackboardArtifact artifact : artifacts) {
artifactStrings.add(new ArtifactStringContent(artifact));
}
// If the node has an underlying blackboard artifact, show it. If not,
// show the first artifact.
int index = 0;
BlackboardArtifact artifact = lookup.lookup(BlackboardArtifact.class);
if (artifact != null) {
index = artifacts.indexOf(artifact);
if (index == -1) {
index = 0;
} else {