19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.EnumSet;
25 import java.util.List;
27 import java.util.logging.Level;
28 import javax.swing.Action;
29 import org.openide.nodes.Sheet;
30 import org.openide.util.NbBundle;
63 static String nameForVolume(Volume vol) {
64 return "vol" + Long.toString(vol.getAddr());
75 String volName = nameForVolume(vol);
76 long end = vol.getStart() + (vol.getLength() - 1);
77 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
81 if (vol.getParent() != null
82 && vol.getParent().getParent() instanceof Pool) {
84 tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
")";
86 }
catch (TskCoreException ex) {
87 logger.log(Level.WARNING,
"Error looking up parent(s) of volume with obj ID = " + vol.getId(), ex);
89 this.setDisplayName(tempVolName);
91 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
107 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
108 String eventType = evt.getPropertyName();
116 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
119 Content newContent = (Content) moduleContentEvent.getSource();
122 Content parent = newContent.getParent();
123 if (parent != null) {
125 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
127 if (newContent.getDataSource().getId() ==
getContent().getDataSource().getId()) {
130 while ((parent = parent.getParent()) != null) {
139 }
catch (TskCoreException ex) {
142 logger.log(Level.WARNING, eventType, ex);
145 if (evt.getNewValue() == null) {
161 List<Action> actionsList =
new ArrayList<>();
163 for (Action a : super.getActions(
true)) {
168 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
171 return actionsList.toArray(
new Action[actionsList.size()]);
176 Sheet sheet = super.createSheet();
177 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
178 if (sheetSet == null) {
179 sheetSet = Sheet.createPropertiesSet();
183 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
184 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
185 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
186 this.getDisplayName()));
187 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
188 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
189 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
191 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
192 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
193 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
195 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
196 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
197 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
199 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
200 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
201 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
203 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
204 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
205 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
212 public <T> T accept(ContentNodeVisitor<T> visitor) {
213 return visitor.visit(
this);
223 return visitor.
visit(
this);
240 return new ArrayList<>();
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
Action[] getActions(boolean popup)
static final Set< IngestManager.IngestModuleEvent > INGEST_MODULE_EVENTS_OF_INTEREST
static List< Action > getActions(Content c)
static final Logger logger
List< Tag > getAllTagsFromDatabase()
final PropertyChangeListener pcl
T visit(DataSourceFilesNode in)
static void post(String nodeName, Object event)
void addIngestModuleEventListener(final PropertyChangeListener listener)
synchronized static Logger getLogger(String name)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)