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.List;
25 import javax.swing.Action;
26 import org.openide.nodes.Children;
27 import org.openide.nodes.Sheet;
28 import org.openide.util.NbBundle;
53 static String nameForVolume(Volume vol) {
54 return "vol" + Long.toString(vol.getAddr());
65 String volName = nameForVolume(vol);
67 long end = vol.getStart() + (vol.getLength() - 1);
68 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
69 this.setDisplayName(tempVolName);
71 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
83 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
84 String eventType = evt.getPropertyName();
92 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
95 Content newContent = (Content) moduleContentEvent.getSource();
98 Content parent = newContent.getParent();
101 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
103 if (parent.getParent().getId() ==
getContent().getId()) {
104 Children children = getChildren();
105 if (children != null) {
106 ((ContentChildren) children).refreshChildren();
107 children.getNodesCount();
112 }
catch (TskCoreException ex) {
116 if (evt.getNewValue() == null) {
132 List<Action> actionsList =
new ArrayList<>();
135 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
138 return actionsList.toArray(
new Action[0]);
143 Sheet s = super.createSheet();
144 Sheet.Set ss = s.get(Sheet.PROPERTIES);
146 ss = Sheet.createPropertiesSet();
150 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
151 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
152 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
153 this.getDisplayName()));
154 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
155 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
156 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
158 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
159 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
160 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
161 content.getStart()));
162 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
163 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
164 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
165 content.getLength()));
166 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
167 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
168 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
169 content.getDescription()));
170 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
171 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
172 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
173 content.getFlagsAsString()));
179 public <T> T accept(ContentNodeVisitor<T> v) {
180 return v.visit(
this);
190 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
static synchronized void removePropertyChangeListener(PropertyChangeListener listener)
void addIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized void addPropertyChangeListener(PropertyChangeListener listener)