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;
26 import java.util.logging.Level;
27 import javax.swing.Action;
28 import org.apache.commons.lang3.tuple.Pair;
29 import org.openide.nodes.Sheet;
30 import org.openide.util.NbBundle;
64 static String nameForVolume(Volume vol) {
65 return "vol" + Long.toString(vol.getAddr());
76 String volName = nameForVolume(vol);
78 long end = vol.getStart() + (vol.getLength() - 1);
79 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
80 this.setDisplayName(tempVolName);
82 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
98 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
99 String eventType = evt.getPropertyName();
107 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
110 Content newContent = (Content) moduleContentEvent.getSource();
113 Content parent = newContent.getParent();
114 if (parent != null) {
116 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
118 if (newContent.getDataSource().getId() ==
getContent().getDataSource().getId()) {
121 while ((parent = parent.getParent()) != null) {
130 }
catch (TskCoreException ex) {
133 logger.log(Level.WARNING, eventType, ex);
136 if (evt.getNewValue() == null) {
152 List<Action> actionsList =
new ArrayList<>();
154 for (Action a : super.getActions(
true)) {
159 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
162 return actionsList.toArray(
new Action[0]);
167 Sheet sheet = super.createSheet();
168 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
169 if (sheetSet == null) {
170 sheetSet = Sheet.createPropertiesSet();
174 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
175 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
176 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
177 this.getDisplayName()));
178 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
179 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
180 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
182 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
183 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
184 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
185 content.getStart()));
186 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
187 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
188 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
189 content.getLength()));
190 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
191 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
192 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
193 content.getDescription()));
194 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
195 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
196 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
197 content.getFlagsAsString()));
203 public <T> T accept(ContentNodeVisitor<T> visitor) {
204 return visitor.visit(
this);
214 return visitor.
visit(
this);
231 return new ArrayList<>();
void removeIngestModuleEventListener(final PropertyChangeListener listener)
Pair< Long, String > getCountPropertyAndDescription(CorrelationAttributeInstance.Type attributeType, String attributeValue, String defaultDescription)
static synchronized IngestManager getInstance()
Action[] getActions(boolean popup)
Pair< DataResultViewerTable.Score, String > getScorePropertyAndDescription(List< Tag > tags)
static List< Action > getActions(Content c)
static final Logger logger
DataResultViewerTable.HasCommentStatus getCommentProperty(List< Tag > tags, CorrelationAttributeInstance attribute)
T visit(DataSourcesNode in)
CorrelationAttributeInstance getCorrelationAttributeInstance()
List< Tag > getAllTagsFromDatabase()
final PropertyChangeListener pcl
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)
static final String NO_DESCR