Autopsy  4.16.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.ui;
20 
22 import java.awt.event.ActionListener;
23 import javax.swing.JCheckBox;
24 import javax.swing.JLabel;
25 import javax.swing.JList;
26 import javax.swing.event.ListSelectionListener;
27 
31 abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel {
32 
33  private static final long serialVersionUID = 1L;
34 
44  abstract void configurePanel(boolean selected, int[] indicesSelected);
45 
51  abstract JCheckBox getCheckbox();
52 
60  abstract JList<?> getList();
61 
68  abstract JLabel getAdditionalLabel();
69 
76  abstract String checkForError();
77 
85  void addListeners(ActionListener actionListener, ListSelectionListener listListener) {
86  if (getCheckbox() != null) {
87  getCheckbox().addActionListener(actionListener);
88  }
89  if (getList() != null) {
90  getList().addListSelectionListener(listListener);
91  }
92  }
93 
100  abstract AbstractFilter getFilter();
101 
105  void removeListeners() {
106  if (getCheckbox() != null) {
107  for (ActionListener listener : getCheckbox().getActionListeners()) {
108  getCheckbox().removeActionListener(listener);
109  }
110  }
111  if (getList() != null) {
112  for (ListSelectionListener listener : getList().getListSelectionListeners()) {
113  getList().removeListSelectionListener(listener);
114  }
115  }
116  }
117 
124  boolean hasPanel() {
125  return true;
126  }
127 
128 }

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