Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
PreviouslyNotableFilterPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.discovery.ui;
20 
22 import java.util.List;
23 import javax.swing.JCheckBox;
24 import javax.swing.JLabel;
25 import javax.swing.event.ListSelectionListener;
29 
33 final class PreviouslyNotableFilterPanel extends AbstractDiscoveryFilterPanel {
34 
35  private static final long serialVersionUID = 1L;
36 
37  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
38  PreviouslyNotableFilterPanel() {
39  initComponents();
40  if (!CentralRepository.isEnabled()) {
41  previouslyNotableCheckbox.setEnabled(false);
42  }
43  }
44 
50  @SuppressWarnings("unchecked")
51  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
52  private void initComponents() {
53 
54  previouslyNotableCheckbox = new javax.swing.JCheckBox();
55 
56  org.openide.awt.Mnemonics.setLocalizedText(previouslyNotableCheckbox, org.openide.util.NbBundle.getMessage(PreviouslyNotableFilterPanel.class, "PreviouslyNotableFilterPanel.text_1")); // NOI18N
57  previouslyNotableCheckbox.setMaximumSize(new java.awt.Dimension(255, 25));
58  previouslyNotableCheckbox.setMinimumSize(new java.awt.Dimension(0, 25));
59  previouslyNotableCheckbox.setName(""); // NOI18N
60  previouslyNotableCheckbox.setOpaque(false);
61  previouslyNotableCheckbox.setPreferredSize(new java.awt.Dimension(255, 25));
62  previouslyNotableCheckbox.setRequestFocusEnabled(false);
63 
64  setMinimumSize(new java.awt.Dimension(0, 30));
65  setPreferredSize(new java.awt.Dimension(255, 30));
66  setVerifyInputWhenFocusTarget(false);
67 
68  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
69  this.setLayout(layout);
70  layout.setHorizontalGroup(
71  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
72  .addGap(0, 300, Short.MAX_VALUE)
73  );
74  layout.setVerticalGroup(
75  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
76  .addGap(0, 42, Short.MAX_VALUE)
77  );
78  }// </editor-fold>//GEN-END:initComponents
79 
80  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
81  @Override
82  void configurePanel(boolean selected, List<?> selectedItems) {
83  previouslyNotableCheckbox.setSelected(selected);
84  }
85 
86  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
87  @Override
88  JCheckBox getCheckbox() {
89  return previouslyNotableCheckbox;
90  }
91 
92  @Override
93  JLabel getAdditionalLabel() {
94  return null;
95  }
96 
97  @Override
98  String checkForError() {
99  //this filter currently has no errors it generates
100  return "";
101  }
102 
103  // Variables declaration - do not modify//GEN-BEGIN:variables
104  private javax.swing.JCheckBox previouslyNotableCheckbox;
105  // End of variables declaration//GEN-END:variables
106 
107  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
108  @Override
109  AbstractFilter getFilter() {
110  if (previouslyNotableCheckbox.isSelected()) {
111  return new SearchFiltering.PreviouslyNotableFilter();
112  }
113  return null;
114  }
115 
116  @Override
117  boolean hasPanel() {
118  return false;
119  }
120 
121  @Override
122  void addListSelectionListener(ListSelectionListener listener) {
123  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
124  }
125 
126  @Override
127  boolean isFilterSupported() {
128  return true;
129  }
130 
131 }

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.