19 package org.sleuthkit.autopsy.modules.dataSourceIntegrity;
27 @SuppressWarnings(
"PMD.SingularField")
28 final class DataSourceIntegrityIngestSettingsPanel extends IngestModuleIngestJobSettingsPanel {
33 DataSourceIntegrityIngestSettingsPanel(DataSourceIntegrityIngestSettings settings) {
35 customizeComponents(settings);
43 private void customizeComponents(DataSourceIntegrityIngestSettings settings) {
44 computeHashesCheckbox.setSelected(settings.shouldComputeHashes());
45 verifyHashesCheckbox.setSelected(settings.shouldVerifyHashes());
49 public IngestModuleIngestJobSettings getSettings() {
50 return new DataSourceIntegrityIngestSettings(computeHashesCheckbox.isSelected(), verifyHashesCheckbox.isSelected());
58 @SuppressWarnings(
"unchecked")
60 private
void initComponents() {
61 java.awt.GridBagConstraints gridBagConstraints;
63 verifyHashesCheckbox =
new javax.swing.JCheckBox();
64 ingestSettingsLabel =
new javax.swing.JLabel();
65 noteLabel =
new javax.swing.JLabel();
66 computeHashesPanel =
new javax.swing.JPanel();
67 computeHashesCheckbox =
new javax.swing.JCheckBox();
68 computeHashesTextArea =
new javax.swing.JTextArea();
70 setPreferredSize(
new java.awt.Dimension(300, 155));
72 org.openide.awt.Mnemonics.setLocalizedText(verifyHashesCheckbox,
org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class,
"DataSourceIntegrityIngestSettingsPanel.verifyHashesCheckbox.text"));
73 verifyHashesCheckbox.setFocusable(
false);
75 ingestSettingsLabel.setFont(ingestSettingsLabel.getFont().deriveFont(ingestSettingsLabel.getFont().getStyle() | java.awt.Font.BOLD));
76 org.openide.awt.Mnemonics.setLocalizedText(ingestSettingsLabel,
org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class,
"DataSourceIntegrityIngestSettingsPanel.ingestSettingsLabel.text"));
78 org.openide.awt.Mnemonics.setLocalizedText(noteLabel,
org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class,
"DataSourceIntegrityIngestSettingsPanel.noteLabel.text"));
80 computeHashesPanel.setLayout(
new java.awt.GridBagLayout());
81 gridBagConstraints =
new java.awt.GridBagConstraints();
82 gridBagConstraints.gridx = 0;
83 gridBagConstraints.gridy = 0;
84 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
85 computeHashesPanel.add(computeHashesCheckbox, gridBagConstraints);
87 computeHashesTextArea.setEditable(
false);
88 computeHashesTextArea.setBackground(
new java.awt.Color(240, 240, 240));
89 computeHashesTextArea.setColumns(20);
90 computeHashesTextArea.setLineWrap(
true);
91 computeHashesTextArea.setRows(2);
92 computeHashesTextArea.setText(
org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class,
"DataSourceIntegrityIngestSettingsPanel.computeHashesCheckbox.text"));
93 computeHashesTextArea.setWrapStyleWord(
true);
94 computeHashesTextArea.setBorder(null);
95 computeHashesTextArea.setFocusable(
false);
96 computeHashesTextArea.setOpaque(
false);
97 computeHashesTextArea.setRequestFocusEnabled(
false);
98 computeHashesTextArea.addMouseListener(
new java.awt.event.MouseAdapter() {
99 public void mouseClicked(java.awt.event.MouseEvent evt) {
100 computeHashesTextAreaMouseClicked(evt);
103 gridBagConstraints =
new java.awt.GridBagConstraints();
104 gridBagConstraints.gridx = 1;
105 gridBagConstraints.gridy = 0;
106 gridBagConstraints.gridwidth = 3;
107 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
108 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
109 gridBagConstraints.weightx = 1.0;
110 gridBagConstraints.insets =
new java.awt.Insets(3, 0, 0, 0);
111 computeHashesPanel.add(computeHashesTextArea, gridBagConstraints);
113 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
114 this.setLayout(layout);
115 layout.setHorizontalGroup(
116 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
117 .addGroup(layout.createSequentialGroup()
119 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
120 .addComponent(noteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
121 .addComponent(verifyHashesCheckbox)
122 .addComponent(ingestSettingsLabel)
123 .addComponent(computeHashesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
124 .addContainerGap(13, Short.MAX_VALUE))
126 layout.setVerticalGroup(
127 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
128 .addGroup(layout.createSequentialGroup()
130 .addComponent(ingestSettingsLabel)
131 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
132 .addComponent(computeHashesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
133 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
134 .addComponent(verifyHashesCheckbox)
136 .addComponent(noteLabel)
137 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
141 private void computeHashesTextAreaMouseClicked(java.awt.event.MouseEvent evt) {
142 computeHashesCheckbox.doClick();
146 private javax.swing.JCheckBox computeHashesCheckbox;
147 private javax.swing.JPanel computeHashesPanel;
148 private javax.swing.JTextArea computeHashesTextArea;
149 private javax.swing.JLabel ingestSettingsLabel;
150 private javax.swing.JLabel noteLabel;
151 private javax.swing.JCheckBox verifyHashesCheckbox;