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.Collections;
25 import java.util.EnumSet;
26 import java.util.List;
28 import java.util.logging.Level;
29 import javax.swing.Action;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
32 import org.openide.util.NbBundle.Messages;
67 static String nameForImage(Image i) {
78 String imgName = nameForImage(img);
79 this.setDisplayName(imgName);
80 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/hard-drive-icon.jpg");
101 @Messages({
"ImageNode.action.runIngestMods.text=Run Ingest Modules",
102 "ImageNode.getActions.openFileSearchByAttr.text=Open File Search by Attributes"})
105 List<Action> actionsList =
new ArrayList<>();
106 for (Action a : super.getActions(
true)) {
110 actionsList.add(
new FileSearchAction(Bundle.ImageNode_getActions_openFileSearchByAttr_text(),
content.getId()));
113 actionsList.add(
new NewWindowViewAction(NbBundle.getMessage(
this.getClass(),
"ImageNode.getActions.viewInNewWin.text"),
this));
115 return actionsList.toArray(
new Action[0]);
119 @Messages({
"ImageNode.createSheet.size.name=Size (Bytes)",
120 "ImageNode.createSheet.size.displayName=Size (Bytes)",
121 "ImageNode.createSheet.size.desc=Size of the data source in bytes.",
122 "ImageNode.createSheet.type.name=Type",
123 "ImageNode.createSheet.type.displayName=Type",
124 "ImageNode.createSheet.type.desc=Type of the image.",
125 "ImageNode.createSheet.type.text=Image",
126 "ImageNode.createSheet.sectorSize.name=Sector Size (Bytes)",
127 "ImageNode.createSheet.sectorSize.displayName=Sector Size (Bytes)",
128 "ImageNode.createSheet.sectorSize.desc=Sector size of the image in bytes.",
129 "ImageNode.createSheet.timezone.name=Timezone",
130 "ImageNode.createSheet.timezone.displayName=Timezone",
131 "ImageNode.createSheet.timezone.desc=Timezone of the image",
132 "ImageNode.createSheet.deviceId.name=Device ID",
133 "ImageNode.createSheet.deviceId.displayName=Device ID",
134 "ImageNode.createSheet.deviceId.desc=Device ID of the image"})
136 Sheet sheet = super.createSheet();
137 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
138 if (sheetSet == null) {
139 sheetSet = Sheet.createPropertiesSet();
143 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"ImageNode.createSheet.name.name"),
144 NbBundle.getMessage(
this.getClass(),
"ImageNode.createSheet.name.displayName"),
145 NbBundle.getMessage(
this.getClass(),
"ImageNode.createSheet.name.desc"),
148 sheetSet.put(
new NodeProperty<>(Bundle.ImageNode_createSheet_type_name(),
149 Bundle.ImageNode_createSheet_type_displayName(),
150 Bundle.ImageNode_createSheet_type_desc(),
151 Bundle.ImageNode_createSheet_type_text()));
153 sheetSet.put(
new NodeProperty<>(Bundle.ImageNode_createSheet_size_name(),
154 Bundle.ImageNode_createSheet_size_displayName(),
155 Bundle.ImageNode_createSheet_size_desc(),
157 sheetSet.put(
new NodeProperty<>(Bundle.ImageNode_createSheet_sectorSize_name(),
158 Bundle.ImageNode_createSheet_sectorSize_displayName(),
159 Bundle.ImageNode_createSheet_sectorSize_desc(),
162 sheetSet.put(
new NodeProperty<>(Bundle.ImageNode_createSheet_timezone_name(),
163 Bundle.ImageNode_createSheet_timezone_displayName(),
164 Bundle.ImageNode_createSheet_timezone_desc(),
167 sheetSet.put(
new NodeProperty<>(Bundle.ImageNode_createSheet_deviceId_name(),
168 Bundle.ImageNode_createSheet_deviceId_displayName(),
169 Bundle.ImageNode_createSheet_deviceId_desc(),
176 public <T> T accept(ContentNodeVisitor<T> visitor) {
177 return visitor.visit(
this);
187 return visitor.
visit(
this);
192 return getClass().getName();
200 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
201 String eventType = evt.getPropertyName();
209 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
212 Content newContent = (Content) moduleContentEvent.getSource();
215 Content parent = newContent.getParent();
216 if (parent != null) {
218 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
220 if (newContent.getDataSource().getId() ==
getContent().getDataSource().getId()) {
223 while ((parent = parent.getParent()) != null) {
232 }
catch (TskCoreException ex) {
235 logger.log(Level.WARNING,
"Failed to post key refresh event.", ex);
238 if (evt.getNewValue() == null) {
254 return new ArrayList<>();
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
static List< Action > getActions(Content c)
Action[] getActions(boolean context)
final PropertyChangeListener pcl
T visit(DataSourceFilesNode in)
static void post(String nodeName, Object event)
static final Logger logger
void addIngestModuleEventListener(final PropertyChangeListener listener)
synchronized static Logger getLogger(String name)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
List< Tag > getAllTagsFromDatabase()
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static final Set< IngestManager.IngestModuleEvent > INGEST_MODULE_EVENTS_OF_INTEREST