19 package org.sleuthkit.autopsy.directorytree;
21 import java.awt.event.ActionEvent;
22 import java.beans.PropertyVetoException;
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.logging.Level;
26 import javax.swing.AbstractAction;
27 import javax.swing.Action;
28 import org.openide.explorer.ExplorerManager;
29 import org.openide.nodes.AbstractNode;
30 import org.openide.nodes.FilterNode;
31 import org.openide.nodes.Node;
32 import org.openide.nodes.Sheet;
33 import org.openide.util.NbBundle;
101 super(node,
new DataResultFilterChildren(node, em));
118 List<Action> actions =
new ArrayList<>();
121 actions.addAll(originalNode.accept(getActionsDIV));
124 return actions.toArray(
new Action[actions.size()]);
135 final Node original = this.getOriginal();
141 final DisplayableItemNode originalNode = (DisplayableItemNode) this.getOriginal();
142 return originalNode.
accept(getPreferredActionsDIV);
147 Node.PropertySet[] propertySets = super.getPropertySets();
149 for (
int i = 0; i < propertySets.length; i++) {
150 Node.PropertySet ps = propertySets[i];
152 if (ps.getName().equals(Sheet.PROPERTIES)) {
153 Sheet.Set newPs =
new Sheet.Set();
154 newPs.setName(ps.getName());
155 newPs.setDisplayName(ps.getDisplayName());
156 newPs.setShortDescription(ps.getShortDescription());
158 newPs.put(ps.getProperties());
162 propertySets[i] = newPs;
182 List<Action> actions =
new ArrayList<>();
185 for (Action a : ban.getActions(
true)) {
194 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.viewFileInDir.text"), ban));
201 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.viewFileInDir.text"), c));
205 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.viewSrcFileInDir.text"), ban));
209 boolean md5Action =
false;
213 }
else if ((c = ban.getLookup().lookup(
Directory.class)) != null) {
217 }
else if ((c = ban.getLookup().lookup(
LayoutFile.class)) != null) {
219 }
else if ((c = ban.getLookup().lookup(
LocalFile.class)) != null
220 || (c = ban.getLookup().lookup(
DerivedFile.class)) != null) {
226 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.viewInNewWin.text"), n));
228 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.openInExtViewer.text"), n));
233 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.searchFilesSameMd5.text"), n));
254 List<Action> actions =
new ArrayList<>();
256 for (Action action : ditem.getActions(
true)) {
269 switch (attr.getValueType()) {
271 int i = attr.getValueInt();
277 long l = attr.getValueLong();
286 Logger.
getLogger(this.getClass().getName()).log(Level.WARNING,
"Error getting linked file", ex);
380 NbBundle.getMessage(
this.getClass(),
"DataResultFilterNode.action.viewInDir.text"), ban);
421 if (fn.hasContentChildren()) {
430 if (dfn.hasContentChildren()) {
464 return reportNode.getPreferredAction();
480 private AbstractAction
openChild(
final AbstractNode dataModelNode) {
486 final Node currentSelectionInDirectoryTree = sourceEm.getSelectedNodes()[0];
488 return new AbstractAction() {
490 public void actionPerformed(ActionEvent e) {
491 if (currentSelectionInDirectoryTree != null) {
493 final org.openide.nodes.Children children = currentSelectionInDirectoryTree.getChildren();
495 Node newSelection = children.findChild(dataModelNode.getName());
504 if (newSelection != null) {
506 sourceEm.setExploredContextAndSelection(newSelection,
new Node[]{newSelection});
507 }
catch (PropertyVetoException ex) {
509 logger.log(Level.WARNING,
"Error: can't open the selected directory.", ex);
527 Node[] selectedFilterNodes = sourceEm.getSelectedNodes();
528 Node selectedFilterNode = selectedFilterNodes[0];
529 final Node parentNode = selectedFilterNode.getParentNode();
531 return new AbstractAction() {
533 public void actionPerformed(ActionEvent e) {
535 sourceEm.setSelectedNodes(
new Node[]{parentNode});
536 }
catch (PropertyVetoException ex) {
538 logger.log(Level.WARNING,
"Error: can't open the parent directory.", ex);
AbstractAction openChild(final AbstractNode dataModelNode)
AbstractAction defaultVisit(DisplayableItemNode c)
AbstractAction visit(EmailExtracted.RootNode eern)
AbstractAction visit(BlackboardArtifactNode ban)
AbstractAction visit(AccountNode eean)
static final String DOTDIR
AbstractAction visit(FileSizeNode fsn)
AbstractAction visit(InterestingHits.RootNode iarn)
DataResultFilterNode(Node node, ExplorerManager em)
AbstractAction visit(TypeNode atn)
Node.PropertySet[] getPropertySets()
AbstractAction visit(FolderNode eefn)
AbstractAction visit(Tags.BlackboardArtifactTagTypeNode node)
static final String DOTDOTDIR
final DisplayableItemNodeVisitor< List< Action > > getActionsDIV
AbstractAction visit(HashsetHits.RootNode hhrn)
static synchronized AddBlackboardArtifactTagAction getInstance()
Content getContentById(long id)
SleuthkitCase getSleuthkitCase()
abstract< T > T accept(DisplayableItemNodeVisitor< T > v)
AbstractAction visit(Reports.ReportNode reportNode)
AbstractAction visit(KeywordHits.RootNode khrn)
AbstractAction visit(VirtualDirectoryNode ldn)
AbstractAction visit(ImageNode in)
AbstractAction visit(FileTypeNode fsfn)
AbstractAction visit(LocalFileNode dfn)
static final String HIDE_PARENT
Action getPreferredAction()
AbstractAction openParent(AbstractNode node)
AbstractAction visit(InterestingHits.SetNameNode iasn)
AbstractAction visit(TermNode khmln)
AbstractAction visit(RecentFilesNode rfn)
final DisplayableItemNodeVisitor< AbstractAction > getPreferredActionsDIV
Action[] getActions(boolean popup)
AbstractAction visit(DeletedContentNode dcn)
AbstractAction visit(FileTypesNode sfn)
AbstractAction visit(Tags.ContentTagTypeNode node)
AbstractAction visit(HashsetNameNode hhsn)
List< BlackboardAttribute > getAttributes()
AbstractAction visit(RecentFilesFilterNode rffn)
AbstractAction visit(FileNode fn)
AbstractAction visit(FileSizeRootNode fsrn)
AbstractAction visit(Tags.TagNameNode node)
AbstractAction visit(DirectoryNode dn)
AbstractAction visit(DeletedContentsNode dcn)
AbstractAction visit(ListNode khsn)
AbstractAction visit(VolumeNode vn)
static Logger getLogger(String name)
static synchronized AddContentTagAction getInstance()
AbstractAction visit(ExtractedContent.RootNode ecn)