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.List;
25 import javax.swing.Action;
26 import org.openide.util.NbBundle;
27 import org.openide.util.Utilities;
35 import org.
sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
36 import org.
sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
56 super(file, directoryBrowseMode);
63 if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
64 if (file.getType().equals(TSK_DB_FILES_TYPE_ENUM.CARVED)) {
65 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-icon-16.png");
67 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
70 this.setIconBaseWithExtension(getIconForFileType(file));
76 List<Action> actionsList =
new ArrayList<>();
77 for (Action a : super.getActions(
true)) {
82 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"SlackFileNode.viewFileInDir.text"), this.content));
83 actionsList.add(null);
86 NbBundle.getMessage(
this.getClass(),
"SlackFileNode.getActions.viewInNewWin.text"),
this));
87 actionsList.add(null);
89 actionsList.add(null);
92 final Collection<AbstractFile> selectedFilesList =
93 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
94 if(selectedFilesList.size() == 1) {
99 return actionsList.toArray(
new Action[actionsList.size()]);
103 public <T> T accept(ContentNodeVisitor<T> v) {
104 return v.visit(
this);
108 public <T> T accept(DisplayableItemNodeVisitor<T> v) {
109 return v.visit(
this);
114 static String getIconForFileType(AbstractFile file) {
116 return "org/sleuthkit/autopsy/images/file-icon.png";
129 return getClass().getName();
Action[] getActions(boolean popup)
void setIcon(AbstractFile file)
SlackFileNode(AbstractFile file, boolean directoryBrowseMode)
boolean directoryBrowseMode
static synchronized DeleteFileContentTagAction getInstance()
SlackFileNode(AbstractFile file)
static synchronized AddContentTagAction getInstance()
boolean getDirectoryBrowseMode()