19 package org.sleuthkit.autopsy.directorytree;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.logging.Level;
27 import javax.swing.AbstractAction;
28 import javax.swing.Action;
29 import org.openide.util.NbBundle;
30 import org.openide.util.Utilities;
53 List<Action> actions =
new ArrayList<>();
55 actions.addAll(c.accept(instance));
74 public List<? extends Action>
visit(
final Image img) {
75 List<Action> lst =
new ArrayList<>();
78 lst.add(
new ExtractUnallocAction(
79 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.extUnallocToSingleFiles"), img));
87 public List<? extends Action>
visit(
final FileSystem fs) {
88 return new ArrayList<>();
92 public List<? extends Action>
visit(
final Volume vol) {
93 List<AbstractAction> lst =
new ArrayList<>();
94 lst.add(
new ExtractUnallocAction(
95 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.extUnallocToSingleFile"), vol));
101 public List<? extends Action>
visit(
final Directory d) {
102 List<Action> actionsList =
new ArrayList<>();
105 final Collection<AbstractFile> selectedFilesList =
106 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
107 if(selectedFilesList.size() == 1) {
116 public List<? extends Action>
visit(
final VirtualDirectory d) {
117 List<Action> actionsList =
new ArrayList<>();
118 if (!d.isDataSource()) {
121 final Collection<AbstractFile> selectedFilesList =
122 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
123 if(selectedFilesList.size() == 1) {
133 public List<? extends Action>
visit(
final LocalDirectory d) {
134 List<Action> actionsList =
new ArrayList<>();
135 if (!d.isDataSource()) {
138 final Collection<AbstractFile> selectedFilesList =
139 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
140 if(selectedFilesList.size() == 1) {
150 public List<? extends Action>
visit(
final DerivedFile d) {
151 List<Action> actionsList =
new ArrayList<>();
155 final Collection<AbstractFile> selectedFilesList =
156 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
157 if(selectedFilesList.size() == 1) {
166 public List<? extends Action>
visit(
final LocalFile d) {
167 List<Action> actionsList =
new ArrayList<>();
171 final Collection<AbstractFile> selectedFilesList =
172 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
173 if(selectedFilesList.size() == 1) {
183 List<Action> actionsList =
new ArrayList<>();
187 final Collection<AbstractFile> selectedFilesList =
188 new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
189 if(selectedFilesList.size() == 1) {
199 return Collections.<Action>emptyList();
List<?extends Action > visit(final LocalFile d)
List<?extends Action > visit(final FileSystem fs)
List<?extends Action > visit(final Volume vol)
List<?extends Action > visit(final VirtualDirectory d)
List<?extends Action > visit(final Directory d)
static List< Action > getActions(Content c)
static ExplorerNodeActionVisitor instance
static synchronized DeleteFileContentTagAction getInstance()
List<?extends Action > visit(final DerivedFile d)
List<?extends Action > visit(final org.sleuthkit.datamodel.File d)
List<?extends Action > visit(final LocalDirectory d)
synchronized static Logger getLogger(String name)
List<?extends Action > visit(final Image img)
static synchronized AddContentTagAction getInstance()
List<?extends Action > defaultVisit(Content di)