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<>();
134 for (Action a : super.getActions(
true)) {
139 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
142 return actionsList.toArray(
new Action[0]);
147 Sheet s = super.createSheet();
148 Sheet.Set ss = s.get(Sheet.PROPERTIES);
150 ss = Sheet.createPropertiesSet();
154 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
155 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
156 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
157 this.getDisplayName()));
158 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
159 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
160 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
162 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
163 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
164 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
165 content.getStart()));
166 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
167 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
168 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
169 content.getLength()));
170 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
171 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
172 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
173 content.getDescription()));
174 ss.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
175 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
176 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
177 content.getFlagsAsString()));
183 public <T> T accept(ContentNodeVisitor<T> v) {
184 return v.visit(
this);
194 return v.
visit(
this);
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
Action[] getActions(boolean popup)
static void removePropertyChangeListener(PropertyChangeListener listener)
static List< Action > getActions(Content c)
T visit(DataSourcesNode in)
static void addPropertyChangeListener(PropertyChangeListener listener)
final PropertyChangeListener pcl
void addIngestModuleEventListener(final PropertyChangeListener listener)