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;
54 static String nameForVolume(Volume vol) {
55 return "vol" + Long.toString(vol.getAddr());
66 String volName = nameForVolume(vol);
68 long end = vol.getStart() + (vol.getLength() - 1);
69 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
70 this.setDisplayName(tempVolName);
72 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
88 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
89 String eventType = evt.getPropertyName();
97 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
100 Content newContent = (Content) moduleContentEvent.getSource();
103 Content parent = newContent.getParent();
104 if (parent != null) {
106 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
108 if (parent.getParent().getId() ==
getContent().getId()) {
109 Children children = getChildren();
110 if (children != null) {
111 ((ContentChildren) children).refreshChildren();
112 children.getNodesCount();
117 }
catch (TskCoreException ex) {
121 if (evt.getNewValue() == null) {
137 List<Action> actionsList =
new ArrayList<>();
139 for (Action a : super.getActions(
true)) {
144 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
147 return actionsList.toArray(
new Action[0]);
152 Sheet s = super.createSheet();
153 Sheet.Set ss = s.get(Sheet.PROPERTIES);
155 ss = Sheet.createPropertiesSet();
159 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
160 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
161 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
162 this.getDisplayName()));
163 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
164 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
165 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
167 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
168 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
169 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
170 content.getStart()));
171 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
172 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
173 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
174 content.getLength()));
175 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
176 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
177 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
178 content.getDescription()));
179 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
180 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
181 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
182 content.getFlagsAsString()));
188 public <T> T accept(ContentNodeVisitor<T> v) {
189 return v.visit(
this);
199 return v.
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)