19 package org.sleuthkit.autopsy.datamodel;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collection;
24 import java.util.HashSet;
25 import java.util.LinkedHashMap;
26 import java.util.List;
28 import javax.swing.Action;
29 import org.openide.nodes.Sheet;
30 import org.openide.util.NbBundle;
31 import org.openide.util.Utilities;
56 public String toString() {
57 return NbBundle.getMessage(this.getClass(),
"LayoutFileNode.propertyType.parts");
71 if (lf.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.CARVED)) {
72 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-icon-16.png");
74 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
80 Sheet sheet = super.createSheet();
81 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
82 if (sheetSet == null) {
83 sheetSet = Sheet.createPropertiesSet();
89 Map<String, Object> map =
new LinkedHashMap<>();
92 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.name"),
93 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.displayName"),
94 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.desc"),
108 final String
NO_DESCR = NbBundle.getMessage(this.getClass(),
"LayoutFileNode.createSheet.noDescr.text");
109 for (Map.Entry<String, Object> entry : map.entrySet()) {
117 public <T> T accept(ContentNodeVisitor<T> visitor) {
118 return visitor.visit(
this);
128 return visitor.
visit(
this);
133 List<Action> actionsList =
new ArrayList<>();
134 actionsList.addAll(Arrays.asList(super.getActions(
true)));
136 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.viewInNewWin.text"),
this));
138 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.openInExtViewer.text"),
this));
139 actionsList.add(null);
141 actionsList.add(null);
144 final Collection<AbstractFile> selectedFilesList
145 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
146 if (selectedFilesList.size() == 1) {
151 return actionsList.toArray(
new Action[actionsList.size()]);
154 void fillPropertyMap(Map<String, Object> map) {
160 return getClass().getName();
final void addScoreProperty(Sheet.Set sheetSet, List< ContentTag > tags)
LayoutFileNode(LayoutFile lf)
final CorrelationAttributeInstance getCorrelationAttributeInstance()
static boolean useCentralRepo()
static void fillPropertyMap(Map< String, Object > map, AbstractFile content)
T visit(DataSourcesNode in)
static synchronized DeleteFileContentTagAction getInstance()
static String nameForLayoutFile(LayoutFile lf)
static final String NO_DESCR
final void addCountProperty(Sheet.Set sheetSet, CorrelationAttributeInstance attribute)
Action[] getActions(boolean context)
final void addCommentProperty(Sheet.Set sheetSet, List< ContentTag > tags, CorrelationAttributeInstance attribute)
static boolean hideCentralRepoCommentsAndOccurrences()
final List< ContentTag > getContentTagsFromDatabase()
static synchronized AddContentTagAction getInstance()