19 package org.sleuthkit.autopsy.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.HashSet;
24 import java.util.LinkedHashMap;
25 import java.util.List;
27 import javax.swing.Action;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
30 import org.openide.util.Utilities;
50 public String toString() {
51 return NbBundle.getMessage(this.getClass(),
"LayoutFileNode.propertyType.parts");
65 if (lf.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.CARVED)) {
66 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-icon-16.png");
68 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
74 Sheet sheet = super.createSheet();
75 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
76 if (sheetSet == null) {
77 sheetSet = Sheet.createPropertiesSet();
81 Map<String, Object> map =
new LinkedHashMap<>();
84 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.name"),
85 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.displayName"),
86 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.createSheet.name.desc"),
89 final String
NO_DESCR = NbBundle.getMessage(this.getClass(),
"LayoutFileNode.createSheet.noDescr.text");
90 for (Map.Entry<String, Object> entry : map.entrySet()) {
101 public <T> T accept(ContentNodeVisitor<T> visitor) {
102 return visitor.visit(
this);
112 return visitor.
visit(
this);
117 List<Action> actionsList =
new ArrayList<>();
118 for (Action a : super.getActions(
true)) {
122 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.viewInNewWin.text"),
this));
124 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.openInExtViewer.text"),
this));
125 actionsList.add(null);
127 actionsList.add(null);
130 final Collection<AbstractFile> selectedFilesList =
131 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
132 if(selectedFilesList.size() == 1) {
137 return actionsList.toArray(
new Action[actionsList.size()]);
141 void fillPropertyMap(Map<String, Object> map) {
143 map.put(LayoutContentPropertyType.PARTS.toString(), content.getNumParts());
148 return getClass().getName();
LayoutFileNode(LayoutFile lf)
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
Action[] getActions(boolean context)
void addTagProperty(Sheet.Set sheetSet)
static synchronized AddContentTagAction getInstance()