19 package org.sleuthkit.autopsy.modules.fileextmismatch;
28 final class FileExtMismatchModuleSettingsPanel
extends IngestModuleIngestJobSettingsPanel {
30 private static final long serialVersionUID = 1L;
31 private final FileExtMismatchDetectorModuleSettings settings;
33 FileExtMismatchModuleSettingsPanel(FileExtMismatchDetectorModuleSettings settings) {
34 this.settings = settings;
36 customizeComponents();
39 private void customizeComponents() {
40 switch (settings.getCheckType()) {
42 checkAllRadioButton.setSelected(
true);
45 checkNoTextRadioButton.setSelected(
true);
47 case ONLY_MEDIA_AND_EXE:
48 checkMediaExeRadioButton.setSelected(
true);
51 checkMediaExeRadioButton.setSelected(
true);
54 skipNoExtCheckBox.setSelected(settings.skipFilesWithNoExtension());
55 skipKnownFiles.setSelected(settings.skipKnownFiles());
59 public IngestModuleIngestJobSettings getSettings() {
68 @SuppressWarnings(
"unchecked")
70 private
void initComponents() {
72 checkTypeButtonGroup =
new javax.swing.ButtonGroup();
73 skipNoExtCheckBox =
new javax.swing.JCheckBox();
74 skipKnownFiles =
new javax.swing.JCheckBox();
75 checkAllRadioButton =
new javax.swing.JRadioButton();
76 checkNoTextRadioButton =
new javax.swing.JRadioButton();
77 checkMediaExeRadioButton =
new javax.swing.JRadioButton();
79 skipNoExtCheckBox.setSelected(
true);
80 skipNoExtCheckBox.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.skipNoExtCheckBox.text"));
81 skipNoExtCheckBox.addActionListener(
new java.awt.event.ActionListener() {
82 public void actionPerformed(java.awt.event.ActionEvent evt) {
83 skipNoExtCheckBoxActionPerformed(evt);
87 skipKnownFiles.setSelected(
true);
88 skipKnownFiles.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.skipKnownFiles.text"));
89 skipKnownFiles.addActionListener(
new java.awt.event.ActionListener() {
90 public void actionPerformed(java.awt.event.ActionEvent evt) {
91 skipKnownFilesActionPerformed(evt);
95 checkTypeButtonGroup.add(checkAllRadioButton);
96 checkAllRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkAllRadioButton.text"));
97 checkAllRadioButton.addActionListener(
new java.awt.event.ActionListener() {
98 public void actionPerformed(java.awt.event.ActionEvent evt) {
99 checkAllRadioButtonActionPerformed(evt);
103 checkTypeButtonGroup.add(checkNoTextRadioButton);
104 checkNoTextRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkNoTextRadioButton.text"));
105 checkNoTextRadioButton.addActionListener(
new java.awt.event.ActionListener() {
106 public void actionPerformed(java.awt.event.ActionEvent evt) {
107 checkNoTextRadioButtonActionPerformed(evt);
111 checkTypeButtonGroup.add(checkMediaExeRadioButton);
112 checkMediaExeRadioButton.setText(
org.openide.util.NbBundle.getMessage(FileExtMismatchModuleSettingsPanel.class,
"FileExtMismatchModuleSettingsPanel.checkMediaExeRadioButton.text"));
113 checkMediaExeRadioButton.addActionListener(
new java.awt.event.ActionListener() {
114 public void actionPerformed(java.awt.event.ActionEvent evt) {
115 checkMediaExeRadioButtonActionPerformed(evt);
119 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
120 this.setLayout(layout);
121 layout.setHorizontalGroup(
122 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
123 .addGroup(layout.createSequentialGroup()
125 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
126 .addComponent(checkAllRadioButton)
127 .addComponent(checkNoTextRadioButton)
128 .addComponent(checkMediaExeRadioButton)
129 .addComponent(skipNoExtCheckBox)
130 .addComponent(skipKnownFiles))
131 .addGap(0, 0, Short.MAX_VALUE))
133 layout.setVerticalGroup(
134 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
135 .addGroup(layout.createSequentialGroup()
137 .addComponent(checkAllRadioButton)
138 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
139 .addComponent(checkNoTextRadioButton)
140 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
141 .addComponent(checkMediaExeRadioButton)
142 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
143 .addComponent(skipNoExtCheckBox)
144 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
145 .addComponent(skipKnownFiles)
146 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
150 private void skipNoExtCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
151 settings.setSkipFilesWithNoExtension(skipNoExtCheckBox.isSelected());
154 private void skipKnownFilesActionPerformed(java.awt.event.ActionEvent evt) {
155 settings.setSkipKnownFiles(skipKnownFiles.isSelected());
158 private void checkAllRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
159 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ALL);
162 private void checkNoTextRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
163 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.NO_TEXT_FILES);
166 private void checkMediaExeRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
167 settings.setCheckType(FileExtMismatchDetectorModuleSettings.CHECK_TYPE.ONLY_MEDIA_AND_EXE);
171 private javax.swing.JRadioButton checkAllRadioButton;
172 private javax.swing.JRadioButton checkMediaExeRadioButton;
173 private javax.swing.JRadioButton checkNoTextRadioButton;
174 private javax.swing.ButtonGroup checkTypeButtonGroup;
175 private javax.swing.JCheckBox skipKnownFiles;
176 private javax.swing.JCheckBox skipNoExtCheckBox;