Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
DirectoryNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 - 2013 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.datamodel;
20 
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.Action;
24 
25 import org.openide.util.NbBundle;
34 
39 public class DirectoryNode extends AbstractFsContentNode<AbstractFile> {
40 
41  public static final String DOTDOTDIR = NbBundle.getMessage(DirectoryNode.class, "DirectoryNode.parFolder.text");
42  public static final String DOTDIR = NbBundle.getMessage(DirectoryNode.class, "DirectoryNode.curFolder.text");
43 
44  public DirectoryNode(Directory dir) {
45  this(dir, true);
46 
47  setIcon(dir);
48  }
49 
51  super(dir, directoryBrowseMode);
52 
53  setIcon(dir);
54  }
55 
56  private void setIcon(AbstractFile dir) {
57  // set name, display name, and icon
59  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-deleted.png"); //NON-NLS
60  } else {
61  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS
62  }
63  }
64 
71  @Override
72  public Action[] getActions(boolean popup) {
73  List<Action> actions = new ArrayList<>();
74  if (!getDirectoryBrowseMode()) {
75  actions.add(new ViewContextAction(
76  NbBundle.getMessage(this.getClass(), "DirectoryNode.getActions.viewFileInDir.text"), this));
77  actions.add(null); // creates a menu separator
78  }
79  actions.add(new NewWindowViewAction(NbBundle.getMessage(this.getClass(), "DirectoryNode.viewInNewWin.text"), this));
80  actions.add(null); // creates a menu separator
81  actions.add(ExtractAction.getInstance());
82  actions.add(null); // creates a menu separator
83  actions.add(AddContentTagAction.getInstance());
84  actions.addAll(ContextMenuExtensionPoint.getActions());
85  return actions.toArray(new Action[0]);
86  }
87 
88  @Override
89  public <T> T accept(ContentNodeVisitor<T> v) {
90  return v.visit(this);
91  }
92 
93  @Override
94  public <T> T accept(DisplayableItemNodeVisitor<T> v) {
95  return v.visit(this);
96  }
97 
98  @Override
99  public boolean isLeafTypeNode() {
100  return false;
101  }
102 }
boolean isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM flag)
DirectoryNode(AbstractFile dir, boolean directoryBrowseMode)
static synchronized ExtractAction getInstance()
static synchronized AddContentTagAction getInstance()

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.