Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
UserCreatedFilterPanel.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;
28 
32 final class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel {
33 
34  private static final long serialVersionUID = 1L;
35 
39  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
40  UserCreatedFilterPanel() {
41  initComponents();
42  }
43 
49  @SuppressWarnings("unchecked")
50  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
51  private void initComponents() {
52 
53  userCreatedCheckbox = new javax.swing.JCheckBox();
54 
55  org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(UserCreatedFilterPanel.class, "UserCreatedFilterPanel.userCreatedCheckbox.text_1")); // NOI18N
56  userCreatedCheckbox.setMaximumSize(new java.awt.Dimension(150, 25));
57  userCreatedCheckbox.setMinimumSize(new java.awt.Dimension(150, 25));
58  userCreatedCheckbox.setPreferredSize(new java.awt.Dimension(150, 25));
59 
60  setMinimumSize(new java.awt.Dimension(250, 30));
61  setPreferredSize(new java.awt.Dimension(250, 30));
62 
63  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
64  this.setLayout(layout);
65  layout.setHorizontalGroup(
66  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
67  .addGap(0, 300, Short.MAX_VALUE)
68  );
69  layout.setVerticalGroup(
70  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
71  .addGap(0, 42, Short.MAX_VALUE)
72  );
73  }// </editor-fold>//GEN-END:initComponents
74 
75  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
76  @Override
77  void configurePanel(boolean selected, List<?> selectedItems) {
78  userCreatedCheckbox.setSelected(selected);
79  }
80 
81  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
82  @Override
83  JCheckBox getCheckbox() {
84  return userCreatedCheckbox;
85  }
86 
87  @Override
88  JLabel getAdditionalLabel() {
89  return null;
90  }
91 
92  @Override
93  String checkForError() {
94  //this filter currently has no errors it generates
95  return "";
96  }
97 
98  // Variables declaration - do not modify//GEN-BEGIN:variables
99  private javax.swing.JCheckBox userCreatedCheckbox;
100  // End of variables declaration//GEN-END:variables
101 
102  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
103  @Override
104  AbstractFilter getFilter() {
105  if (userCreatedCheckbox.isSelected()) {
106  return new SearchFiltering.UserCreatedFilter();
107  }
108  return null;
109  }
110 
111  @Override
112  boolean hasPanel() {
113  return false;
114  }
115 
116  @Override
117  void addListSelectionListener(ListSelectionListener listener) {
118  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
119  }
120 
121  @Override
122  boolean isFilterSupported() {
123  return true;
124  }
125 
126 }

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.