mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Renamed file report info enumeration
This commit is contained in:
parent
f4a5a3b79a
commit
4ee4a1f272
@ -28,7 +28,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
*
|
*
|
||||||
* @author jwallace
|
* @author jwallace
|
||||||
*/
|
*/
|
||||||
public enum FILE_REPORT_INFO {
|
public enum FileReportInfo {
|
||||||
|
|
||||||
NAME("Name") {
|
NAME("Name") {
|
||||||
@Override
|
@Override
|
||||||
@ -99,7 +99,7 @@ public enum FILE_REPORT_INFO {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
FILE_REPORT_INFO(String name) {
|
FileReportInfo(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ public interface FileReportModule extends ReportModule {
|
|||||||
* Start the file list table.
|
* Start the file list table.
|
||||||
* @param headers The columns that should be included in the table.
|
* @param headers The columns that should be included in the table.
|
||||||
*/
|
*/
|
||||||
public void startTable(List<FILE_REPORT_INFO> headers);
|
public void startTable(List<FileReportInfo> headers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given AbstractFile as a row in the table.
|
* Add the given AbstractFile as a row in the table.
|
||||||
@ -51,7 +51,7 @@ public interface FileReportModule extends ReportModule {
|
|||||||
* @param toAdd the AbstractFile to be added.
|
* @param toAdd the AbstractFile to be added.
|
||||||
* @param columns the columns that should be included
|
* @param columns the columns that should be included
|
||||||
*/
|
*/
|
||||||
public void addRow(AbstractFile toAdd, List<FILE_REPORT_INFO> columns);
|
public void addRow(AbstractFile toAdd, List<FileReportInfo> columns);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the table.
|
* Close the table.
|
||||||
|
@ -81,9 +81,9 @@ public class FileReportText implements FileReportModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startTable(List<FILE_REPORT_INFO> headers) {
|
public void startTable(List<FileReportInfo> headers) {
|
||||||
List<String> titles = new ArrayList<>();
|
List<String> titles = new ArrayList<>();
|
||||||
for(FILE_REPORT_INFO col : headers) {
|
for(FileReportInfo col : headers) {
|
||||||
titles.add(col.getName());
|
titles.add(col.getName());
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -94,9 +94,9 @@ public class FileReportText implements FileReportModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addRow(AbstractFile toAdd, List<FILE_REPORT_INFO> columns) {
|
public void addRow(AbstractFile toAdd, List<FileReportInfo> columns) {
|
||||||
List<String> cells = new ArrayList<>();
|
List<String> cells = new ArrayList<>();
|
||||||
for(FILE_REPORT_INFO type : columns) {
|
for(FileReportInfo type : columns) {
|
||||||
cells.add(type.getValue(toAdd));
|
cells.add(type.getValue(toAdd));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -201,10 +201,10 @@ public class ReportGenerator {
|
|||||||
* @param enabledInfo the Information that should be included about each file
|
* @param enabledInfo the Information that should be included about each file
|
||||||
* in the report.
|
* in the report.
|
||||||
*/
|
*/
|
||||||
public void generateFileListReports(Map<FILE_REPORT_INFO, Boolean> enabledInfo) {
|
public void generateFileListReports(Map<FileReportInfo, Boolean> enabledInfo) {
|
||||||
if (!fileProgress.isEmpty() && null != enabledInfo) {
|
if (!fileProgress.isEmpty() && null != enabledInfo) {
|
||||||
List<FILE_REPORT_INFO> enabled = new ArrayList<>();
|
List<FileReportInfo> enabled = new ArrayList<>();
|
||||||
for (Entry<FILE_REPORT_INFO, Boolean> e : enabledInfo.entrySet()) {
|
for (Entry<FileReportInfo, Boolean> e : enabledInfo.entrySet()) {
|
||||||
if(e.getValue()) {
|
if(e.getValue()) {
|
||||||
enabled.add(e.getKey());
|
enabled.add(e.getKey());
|
||||||
}
|
}
|
||||||
@ -236,10 +236,10 @@ public class ReportGenerator {
|
|||||||
* SwingWorker to generate a FileReport.
|
* SwingWorker to generate a FileReport.
|
||||||
*/
|
*/
|
||||||
private class FileReportsWorker extends SwingWorker<Integer, Integer> {
|
private class FileReportsWorker extends SwingWorker<Integer, Integer> {
|
||||||
private List<FILE_REPORT_INFO> enabledInfo = Arrays.asList(FILE_REPORT_INFO.values());
|
private List<FileReportInfo> enabledInfo = Arrays.asList(FileReportInfo.values());
|
||||||
private List<FileReportModule> fileModules = new ArrayList<>();
|
private List<FileReportModule> fileModules = new ArrayList<>();
|
||||||
|
|
||||||
FileReportsWorker(List<FILE_REPORT_INFO> enabled) {
|
FileReportsWorker(List<FileReportInfo> enabled) {
|
||||||
enabledInfo = enabled;
|
enabledInfo = enabled;
|
||||||
for (Entry<FileReportModule, ReportProgressPanel> entry : fileProgress.entrySet()) {
|
for (Entry<FileReportModule, ReportProgressPanel> entry : fileProgress.entrySet()) {
|
||||||
fileModules.add(entry.getKey());
|
fileModules.add(entry.getKey());
|
||||||
|
@ -72,7 +72,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P
|
|||||||
(Map<GeneralReportModule, Boolean>)wiz.getProperty("generalModuleStates"),
|
(Map<GeneralReportModule, Boolean>)wiz.getProperty("generalModuleStates"),
|
||||||
(Map<FileReportModule, Boolean>)wiz.getProperty("fileListModuleStates"));
|
(Map<FileReportModule, Boolean>)wiz.getProperty("fileListModuleStates"));
|
||||||
generator.generateArtifactTableReports((Map<ARTIFACT_TYPE, Boolean>)wiz.getProperty("artifactStates"), (Map<String, Boolean>)wiz.getProperty("tagStates"));
|
generator.generateArtifactTableReports((Map<ARTIFACT_TYPE, Boolean>)wiz.getProperty("artifactStates"), (Map<String, Boolean>)wiz.getProperty("tagStates"));
|
||||||
generator.generateFileListReports((Map<FILE_REPORT_INFO, Boolean>)wiz.getProperty("fileReportOptions"));
|
generator.generateFileListReports((Map<FileReportInfo, Boolean>)wiz.getProperty("fileReportOptions"));
|
||||||
generator.generateGeneralReports();
|
generator.generateGeneralReports();
|
||||||
generator.displayProgressPanels();
|
generator.displayProgressPanels();
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ import javax.swing.event.ListDataListener;
|
|||||||
* @author jwallace
|
* @author jwallace
|
||||||
*/
|
*/
|
||||||
public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
||||||
private List<FILE_REPORT_INFO> options;
|
private List<FileReportInfo> options;
|
||||||
private Map<FILE_REPORT_INFO, Boolean> optionStates = new EnumMap<>(FILE_REPORT_INFO.class);
|
private Map<FileReportInfo, Boolean> optionStates = new EnumMap<>(FileReportInfo.class);
|
||||||
private ListModel model;
|
private ListModel model;
|
||||||
private ReportWizardFileOptionsPanel wizPanel;
|
private ReportWizardFileOptionsPanel wizPanel;
|
||||||
|
|
||||||
@ -59,8 +59,8 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
* Populate the list of File Report Information that can be selected.
|
* Populate the list of File Report Information that can be selected.
|
||||||
*/
|
*/
|
||||||
private void initOptionsList() {
|
private void initOptionsList() {
|
||||||
options = Arrays.asList(FILE_REPORT_INFO.values());
|
options = Arrays.asList(FileReportInfo.values());
|
||||||
for(FILE_REPORT_INFO col : options) {
|
for(FileReportInfo col : options) {
|
||||||
optionStates.put(col, Boolean.FALSE);
|
optionStates.put(col, Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
public void mousePressed(MouseEvent evt) {
|
public void mousePressed(MouseEvent evt) {
|
||||||
JList list = (JList) evt.getSource();
|
JList list = (JList) evt.getSource();
|
||||||
int index = list.locationToIndex(evt.getPoint());
|
int index = list.locationToIndex(evt.getPoint());
|
||||||
FILE_REPORT_INFO value = (FILE_REPORT_INFO) model.getElementAt(index);
|
FileReportInfo value = (FileReportInfo) model.getElementAt(index);
|
||||||
optionStates.put(value, !optionStates.get(value));
|
optionStates.put(value, !optionStates.get(value));
|
||||||
list.repaint();
|
list.repaint();
|
||||||
boolean anySelected = anySelected();
|
boolean anySelected = anySelected();
|
||||||
@ -119,7 +119,7 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
* Get the user-selected settings.
|
* Get the user-selected settings.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<FILE_REPORT_INFO, Boolean> getFileReportOptions() {
|
Map<FileReportInfo, Boolean> getFileReportOptions() {
|
||||||
return optionStates;
|
return optionStates;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -196,7 +196,7 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void selectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllButtonActionPerformed
|
private void selectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllButtonActionPerformed
|
||||||
for (FILE_REPORT_INFO option : options) {
|
for (FileReportInfo option : options) {
|
||||||
optionStates.put(option, Boolean.TRUE);
|
optionStates.put(option, Boolean.TRUE);
|
||||||
}
|
}
|
||||||
optionsList.repaint();
|
optionsList.repaint();
|
||||||
@ -206,7 +206,7 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
}//GEN-LAST:event_selectAllButtonActionPerformed
|
}//GEN-LAST:event_selectAllButtonActionPerformed
|
||||||
|
|
||||||
private void deselectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deselectAllButtonActionPerformed
|
private void deselectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deselectAllButtonActionPerformed
|
||||||
for (FILE_REPORT_INFO option : options) {
|
for (FileReportInfo option : options) {
|
||||||
optionStates.put(option, Boolean.FALSE);
|
optionStates.put(option, Boolean.FALSE);
|
||||||
}
|
}
|
||||||
optionsList.repaint();
|
optionsList.repaint();
|
||||||
@ -252,7 +252,7 @@ public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
|
|||||||
@Override
|
@Override
|
||||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
FILE_REPORT_INFO col = (FILE_REPORT_INFO) value;
|
FileReportInfo col = (FileReportInfo) value;
|
||||||
setEnabled(list.isEnabled());
|
setEnabled(list.isEnabled());
|
||||||
setSelected(optionStates.get(col));
|
setSelected(optionStates.get(col));
|
||||||
setFont(list.getFont());
|
setFont(list.getFont());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user