Merge pull request #3534 from millmanorama/942-tagged-status

942 tagged status
This commit is contained in:
Richard Cordovano 2018-03-12 16:13:09 -04:00 committed by GitHub
commit fafc9131d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 9 deletions

View File

@ -46,7 +46,7 @@ import org.sleuthkit.datamodel.TskCoreException;
final class RelationshipNode extends BlackboardArtifactNode {
private static final Logger logger = Logger.getLogger(RelationshipNode.class.getName());
RelationshipNode(BlackboardArtifact artifact) {
super(artifact);
final String stripEnd = StringUtils.stripEnd(artifact.getDisplayName(), "s");
@ -113,6 +113,9 @@ final class RelationshipNode extends BlackboardArtifactNode {
break;
}
}
addTagProperty(ss);
return s;
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2017 Basis Technology Corp.
* Copyright 2017-18 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -706,7 +706,7 @@ public class MessageContentViewer extends javax.swing.JPanel implements DataCont
private static class AttachmentNode extends FileNode {
AttachmentNode(AbstractFile file) {
super(file, true);
super(file, false);
}
@Override

View File

@ -29,6 +29,7 @@ import java.util.EnumSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
@ -78,8 +79,12 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
private final BlackboardArtifact artifact;
private Content associated = null;
private List<NodeProperty<? extends Object>> customProperties;
private final static String NO_DESCR = NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.noDesc.text");
/*
* Artifact types which should have the full unique path of the associated
* content as a property.
@ -310,7 +315,6 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
ss = Sheet.createPropertiesSet();
s.put(ss);
}
final String NO_DESCR = NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.noDesc.text");
Map<String, Object> map = new LinkedHashMap<>();
fillPropertyMap(map, artifact);
@ -438,6 +442,22 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
}
}
addTagProperty(ss);
return s;
}
/**
* Used by (subclasses of) BlackboardArtifactNode to add the tags property
* to their sheets.
*
* @param ss the modifiable Sheet.Set returned by
* Sheet.get(Sheet.PROPERTIES)
*/
@NbBundle.Messages({
"BlackboardArtifactNode.createSheet.tags.displayName=Tags"})
protected void addTagProperty(Sheet.Set ss) throws MissingResourceException {
// add properties for tags
List<Tag> tags = new ArrayList<>();
try {
@ -446,10 +466,8 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex);
}
ss.put(new NodeProperty<>("Tags", NbBundle.getMessage(AbstractAbstractFileNode.class, "BlackboardArtifactNode.createSheet.tags.displayName"),
ss.put(new NodeProperty<>("Tags", Bundle.BlackboardArtifactNode_createSheet_tags_displayName(),
NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(", "))));
return s;
}
private void updateSheet() {

View File

@ -207,8 +207,6 @@ DeleteReportAction.actionDisplayName.multipleReports=Delete Reports
DeleteReportAction.actionPerformed.showConfirmDialog.title=Confirm Deletion
DeleteReportAction.actionPerformed.showConfirmDialog.single.msg=Do you want to delete 1 report from the case?
DeleteReportAction.actionPerformed.showConfirmDialog.multiple.msg=Do you want to delete {0} reports from the case?
BlackboardArtifactNode.createSheet.tags.name=Tags
BlackboardArtifactNode.createSheet.tags.displayName=Tags
FileTypeExtensionFilters.tskImgFilter.text=Images
FileTypeExtensionFilters.tskVideoFilter.text=Videos
FileTypeExtensionFilters.tskAudioFilter.text=Audio