19 package org.sleuthkit.autopsy.filesearch;
21 import javax.swing.JCheckBox;
26 @SuppressWarnings(
"PMD.SingularField")
27 class KnownStatusSearchPanel extends javax.swing.JPanel {
32 KnownStatusSearchPanel() {
34 setComponentsEnabled();
37 JCheckBox getKnownCheckBox() {
41 JCheckBox getKnownBadOptionCheckBox() {
42 return knownBadOptionCheckBox;
45 JCheckBox getKnownOptionCheckBox() {
46 return knownOptionCheckBox;
49 JCheckBox getUnknownOptionCheckBox() {
50 return unknownOptionCheckBox;
53 private void setComponentsEnabled() {
54 boolean enabled = this.knownCheckBox.isSelected();
55 this.unknownOptionCheckBox.setEnabled(enabled);
56 this.knownOptionCheckBox.setEnabled(enabled);
57 this.knownBadOptionCheckBox.setEnabled(enabled);
60 boolean isValidSearch() {
61 return this.unknownOptionCheckBox.isSelected() || this.knownBadOptionCheckBox.isSelected() || this.knownOptionCheckBox.isSelected();
69 @SuppressWarnings(
"unchecked")
71 private
void initComponents() {
73 knownCheckBox =
new javax.swing.JCheckBox();
74 unknownOptionCheckBox =
new javax.swing.JCheckBox();
75 knownOptionCheckBox =
new javax.swing.JCheckBox();
76 knownBadOptionCheckBox =
new javax.swing.JCheckBox();
78 knownCheckBox.setText(
org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class,
"KnownStatusSearchPanel.knownCheckBox.text"));
79 knownCheckBox.addActionListener(
new java.awt.event.ActionListener() {
80 public void actionPerformed(java.awt.event.ActionEvent evt) {
81 knownCheckBoxActionPerformed(evt);
85 unknownOptionCheckBox.setSelected(
true);
86 unknownOptionCheckBox.setText(
org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class,
"KnownStatusSearchPanel.unknownOptionCheckBox.text"));
87 unknownOptionCheckBox.addActionListener(
new java.awt.event.ActionListener() {
88 public void actionPerformed(java.awt.event.ActionEvent evt) {
89 unknownOptionCheckBoxActionPerformed(evt);
93 knownOptionCheckBox.setSelected(
true);
94 knownOptionCheckBox.setText(
org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class,
"KnownStatusSearchPanel.knownOptionCheckBox.text"));
95 knownOptionCheckBox.addActionListener(
new java.awt.event.ActionListener() {
96 public void actionPerformed(java.awt.event.ActionEvent evt) {
97 knownOptionCheckBoxActionPerformed(evt);
101 knownBadOptionCheckBox.setSelected(
true);
102 knownBadOptionCheckBox.setText(
org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class,
"KnownStatusSearchPanel.knownBadOptionCheckBox.text"));
103 knownBadOptionCheckBox.addActionListener(
new java.awt.event.ActionListener() {
104 public void actionPerformed(java.awt.event.ActionEvent evt) {
105 knownBadOptionCheckBoxActionPerformed(evt);
109 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
110 this.setLayout(layout);
111 layout.setHorizontalGroup(
112 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
113 .addGroup(layout.createSequentialGroup()
114 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115 .addComponent(knownCheckBox)
116 .addGroup(layout.createSequentialGroup()
118 .addComponent(unknownOptionCheckBox)
119 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
120 .addComponent(knownOptionCheckBox)
121 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
122 .addComponent(knownBadOptionCheckBox)))
123 .addContainerGap(28, Short.MAX_VALUE))
125 layout.setVerticalGroup(
126 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127 .addGroup(layout.createSequentialGroup()
128 .addComponent(knownCheckBox)
129 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
130 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
131 .addComponent(unknownOptionCheckBox)
132 .addComponent(knownOptionCheckBox)
133 .addComponent(knownBadOptionCheckBox)))
137 private void knownOptionCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
138 firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);
141 private void knownCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
142 setComponentsEnabled();
143 firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);
146 private void unknownOptionCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
147 firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);
150 private void knownBadOptionCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
151 firePropertyChange(FileSearchPanel.EVENT.CHECKED.toString(), null, null);
155 private javax.swing.JCheckBox knownBadOptionCheckBox;
156 private javax.swing.JCheckBox knownCheckBox;
157 private javax.swing.JCheckBox knownOptionCheckBox;
158 private javax.swing.JCheckBox unknownOptionCheckBox;