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.List;
26 import javax.swing.Action;
27 import org.openide.util.NbBundle;
28 import org.openide.util.Utilities;
37 import org.
sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
38 import org.
sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
58 super(file, directoryBrowseMode);
65 if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
66 if (file.getType().equals(TSK_DB_FILES_TYPE_ENUM.CARVED)) {
67 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-x-icon-16.png");
69 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
72 this.setIconBaseWithExtension(getIconForFileType(file));
78 List<Action> actionsList =
new ArrayList<>();
80 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"SlackFileNode.getActions.viewFileInDir.text"), this.content));
81 actionsList.add(null);
84 NbBundle.getMessage(
this.getClass(),
"SlackFileNode.getActions.viewInNewWin.text"),
this));
85 actionsList.add(null);
88 actionsList.add(null);
91 final Collection<AbstractFile> selectedFilesList =
92 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
93 if(selectedFilesList.size() == 1) {
98 actionsList.add(null);
99 actionsList.addAll(Arrays.asList(super.getActions(
true)));
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()