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 javax.swing.Action;
27 import org.openide.nodes.Children;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.NbBundle;
55 static String nameForVolume(Volume vol) {
56 return "vol" + Long.toString(vol.getAddr());
67 String volName = nameForVolume(vol);
69 long end = vol.getStart() + (vol.getLength() - 1);
70 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
71 this.setDisplayName(tempVolName);
73 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
89 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
90 String eventType = evt.getPropertyName();
98 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
101 Content newContent = (Content) moduleContentEvent.getSource();
104 Content parent = newContent.getParent();
105 if (parent != null) {
107 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
109 if (parent.getParent().getId() ==
getContent().getId()) {
110 Children children = getChildren();
111 if (children != null) {
112 ((ContentChildren) children).refreshChildren();
113 children.getNodesCount();
118 }
catch (TskCoreException ex) {
122 if (evt.getNewValue() == null) {
138 List<Action> actionsList =
new ArrayList<>();
140 for (Action a : super.getActions(
true)) {
145 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
148 return actionsList.toArray(
new Action[0]);
153 Sheet sheet = super.createSheet();
154 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
155 if (sheetSet == null) {
156 sheetSet = Sheet.createPropertiesSet();
160 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
161 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
162 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
163 this.getDisplayName()));
164 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
165 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
166 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
168 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
169 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
170 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
171 content.getStart()));
172 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
173 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
174 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
175 content.getLength()));
176 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
177 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
178 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
179 content.getDescription()));
180 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
181 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
182 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
183 content.getFlagsAsString()));
189 public <T> T accept(ContentNodeVisitor<T> visitor) {
190 return visitor.visit(
this);
200 return visitor.
visit(
this);
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
Action[] getActions(boolean popup)
static List< Action > getActions(Content c)
T visit(DataSourcesNode in)
final PropertyChangeListener pcl
void addIngestModuleEventListener(final PropertyChangeListener listener)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)