Autopsy  4.15.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
AbstractDiscoveryFilterPanel.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;
20 
21 import java.awt.event.ActionListener;
22 import javax.swing.JCheckBox;
23 import javax.swing.JLabel;
24 import javax.swing.JList;
25 import javax.swing.event.ListSelectionListener;
26 
30 abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel {
31 
32  private static final long serialVersionUID = 1L;
33 
43  abstract void configurePanel(boolean selected, int[] indicesSelected);
44 
50  abstract JCheckBox getCheckbox();
51 
59  abstract JList<?> getList();
60 
67  abstract JLabel getAdditionalLabel();
68 
74  abstract String checkForError();
75 
83  void addListeners(ActionListener actionListener, ListSelectionListener listListener) {
84  if (getCheckbox() != null) {
85  getCheckbox().addActionListener(actionListener);
86  }
87  if (getList() != null) {
88  getList().addListSelectionListener(listListener);
89  }
90  }
91 
98  abstract FileSearchFiltering.FileFilter getFilter();
99 
103  void removeListeners() {
104  if (getCheckbox() != null) {
105  for (ActionListener listener : getCheckbox().getActionListeners()) {
106  getCheckbox().removeActionListener(listener);
107  }
108  }
109  if (getList() != null) {
110  for (ListSelectionListener listener : getList().getListSelectionListeners()) {
111  getList().removeListSelectionListener(listener);
112  }
113  }
114  }
115 
122  boolean hasPanel() {
123  return true;
124  }
125 
126 }

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