19 package org.sleuthkit.autopsy.modules.fileextmismatch;
28 @SuppressWarnings(
"PMD.SingularField")
29 final class FileExtMismatchModuleSettingsPanel extends IngestModuleIngestJobSettingsPanel {
31 private static final long serialVersionUID = 1L;
32 private final FileExtMismatchDetectorModuleSettings settings;
34 FileExtMismatchModuleSettingsPanel(FileExtMismatchDetectorModuleSettings settings) {
35 this.settings = settings;
37 customizeComponents();
40 private void customizeComponents() {
41 switch (settings.getCheckType()) {
43 checkAllRadioButton.setSelected(
true);
46 checkNoTextRadioButton.setSelected(
true);
48 case ONLY_MEDIA_AND_EXE:
49 checkMediaExeRadioButton.setSelected(
true);
52 checkMediaExeRadioButton.setSelected(
true);
55 skipNoExtCheckBox.setSelected(settings.skipFilesWithNoExtension());
56 skipKnownFiles.setSelected(settings.skipKnownFiles());
60 public IngestModuleIngestJobSettings getSettings() {
69 @SuppressWarnings(
"unchecked")
71 private
void initComponents() {
73 checkTypeButtonGroup =
new javax.swing.ButtonGroup();
74 skipNoExtCheckBox =
new javax.swing.JCheckBox();
75 skipKnownFiles =
new javax.swing.JCheckBox();
76 checkAllRadioButton =
new javax.swing.JRadioButton();
77 checkNoTextRadioButton =
new javax.swing.JRadioButton();
78 checkMediaExeRadioButton =
new javax.swing.JRadioButton();
80 skipNoExtCheckBox.setSelected(
true);
81 skipNoExtCheckBox.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.skipNoExtCheckBox.text"));
82 skipNoExtCheckBox.addActionListener(
new java.awt.event.ActionListener() {
83 public void actionPerformed(java.awt.event.ActionEvent evt) {
84 skipNoExtCheckBoxActionPerformed(evt);
88 skipKnownFiles.setSelected(
true);
89 skipKnownFiles.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.skipKnownFiles.text"));
90 skipKnownFiles.addActionListener(
new java.awt.event.ActionListener() {
91 public void actionPerformed(java.awt.event.ActionEvent evt) {
92 skipKnownFilesActionPerformed(evt);
96 checkTypeButtonGroup.add(checkAllRadioButton);
97 checkAllRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkAllRadioButton.text"));
98 checkAllRadioButton.addActionListener(
new java.awt.event.ActionListener() {
99 public void actionPerformed(java.awt.event.ActionEvent evt) {
100 checkAllRadioButtonActionPerformed(evt);
104 checkTypeButtonGroup.add(checkNoTextRadioButton);
105 checkNoTextRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkNoTextRadioButton.text"));
106 checkNoTextRadioButton.addActionListener(
new java.awt.event.ActionListener() {
107 public void actionPerformed(java.awt.event.ActionEvent evt) {
108 checkNoTextRadioButtonActionPerformed(evt);
112 checkTypeButtonGroup.add(checkMediaExeRadioButton);
113 checkMediaExeRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkMediaExeRadioButton.text"));
114 checkMediaExeRadioButton.addActionListener(
new java.awt.event.ActionListener() {
115 public void actionPerformed(java.awt.event.ActionEvent evt) {
116 checkMediaExeRadioButtonActionPerformed(evt);
120 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
121 this.setLayout(layout);
122 layout.setHorizontalGroup(
123 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
124 .addGroup(layout.createSequentialGroup()
126 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127 .addComponent(checkAllRadioButton)
128 .addComponent(checkNoTextRadioButton)
129 .addComponent(checkMediaExeRadioButton)
130 .addComponent(skipNoExtCheckBox)
131 .addComponent(skipKnownFiles))
132 .addGap(0, 0, Short.MAX_VALUE))
134 layout.setVerticalGroup(
135 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
136 .addGroup(layout.createSequentialGroup()
138 .addComponent(checkAllRadioButton)
139 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
140 .addComponent(checkNoTextRadioButton)
141 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
142 .addComponent(checkMediaExeRadioButton)
143 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
144 .addComponent(skipNoExtCheckBox)
145 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
146 .addComponent(skipKnownFiles)
147 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
151 private void skipNoExtCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
152 settings.setSkipFilesWithNoExtension(skipNoExtCheckBox.isSelected());
155 private void skipKnownFilesActionPerformed(java.awt.event.ActionEvent evt) {
156 settings.setSkipKnownFiles(skipKnownFiles.isSelected());
159 private void checkAllRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
160 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ALL);
163 private void checkNoTextRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
164 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.NO_TEXT_FILES);
167 private void checkMediaExeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
168 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ONLY_MEDIA_AND_EXE);
172 private javax.swing.JRadioButton checkAllRadioButton;
173 private javax.swing.JRadioButton checkMediaExeRadioButton;
174 private javax.swing.JRadioButton checkNoTextRadioButton;
175 private javax.swing.ButtonGroup checkTypeButtonGroup;
176 private javax.swing.JCheckBox skipKnownFiles;
177 private javax.swing.JCheckBox skipNoExtCheckBox;