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.Arrays;
25 import java.util.EnumSet;
26 import java.util.List;
28 import java.util.logging.Level;
29 import javax.swing.Action;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
64 static String nameForVolume(Volume vol) {
65 return "vol" + Long.toString(vol.getAddr());
76 String volName = nameForVolume(vol);
77 long end = vol.getStart() + (vol.getLength() - 1);
78 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
82 if (vol.getParent() != null
83 && vol.getParent().getParent() instanceof Pool) {
85 tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
")";
87 }
catch (TskCoreException ex) {
88 logger.log(Level.WARNING,
"Error looking up parent(s) of volume with obj ID = " + vol.getId(), ex);
90 this.setDisplayName(tempVolName);
92 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
108 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
109 String eventType = evt.getPropertyName();
117 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
120 Content newContent = (Content) moduleContentEvent.getSource();
123 Content parent = newContent.getParent();
124 if (parent != null) {
126 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
128 if (newContent.getDataSource().getId() ==
getContent().getDataSource().getId()) {
131 while ((parent = parent.getParent()) != null) {
140 }
catch (TskCoreException ex) {
143 logger.log(Level.WARNING, eventType, ex);
146 if (evt.getNewValue() == null) {
162 List<Action> actionsList =
new ArrayList<>();
165 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
167 actionsList.add(null);
168 actionsList.addAll(Arrays.asList(super.getActions(
true)));
170 return actionsList.toArray(
new Action[actionsList.size()]);
175 Sheet sheet = super.createSheet();
176 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
177 if (sheetSet == null) {
178 sheetSet = Sheet.createPropertiesSet();
182 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
183 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
184 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
185 this.getDisplayName()));
186 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
187 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
188 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
190 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
191 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
192 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
194 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
195 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
196 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
198 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
199 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
200 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
202 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
203 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
204 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
211 public <T> T accept(ContentNodeVisitor<T> visitor) {
212 return visitor.visit(
this);
222 return visitor.
visit(
this);
239 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)