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;
36 import org.
sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
37 import org.
sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
57 super(file, directoryBrowseMode);
64 if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
65 if (file.getType().equals(TSK_DB_FILES_TYPE_ENUM.CARVED)) {
66 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-x-icon-16.png");
68 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
71 this.setIconBaseWithExtension(getIconForFileType(file));
77 List<Action> actionsList =
new ArrayList<>();
78 for (Action a : super.getActions(
true)) {
82 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"SlackFileNode.getActions.viewFileInDir.text"), this.content));
83 actionsList.add(null);
86 NbBundle.getMessage(
this.getClass(),
"SlackFileNode.getActions.viewInNewWin.text"),
this));
87 actionsList.add(null);
90 actionsList.add(null);
93 final Collection<AbstractFile> selectedFilesList =
94 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
95 if(selectedFilesList.size() == 1) {
100 return actionsList.toArray(
new Action[actionsList.size()]);
104 public <T> T accept(ContentNodeVisitor<T> visitor) {
105 return visitor.visit(
this);
109 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
110 return visitor.visit(
this);
115 static String getIconForFileType(AbstractFile file) {
117 return "org/sleuthkit/autopsy/images/file-icon.png";
130 return getClass().getName();
Action[] getActions(boolean popup)
void setIcon(AbstractFile file)
static synchronized ExportCSVAction getInstance()
SlackFileNode(AbstractFile file, boolean directoryBrowseMode)
boolean directoryBrowseMode
static synchronized DeleteFileContentTagAction getInstance()
SlackFileNode(AbstractFile file)
static synchronized AddContentTagAction getInstance()
boolean getDirectoryBrowseMode()