20 package org.sleuthkit.autopsy.commonfilesearch;
23 import java.util.Collections;
24 import java.util.HashMap;
26 import java.util.Map.Entry;
27 import java.util.Observable;
28 import java.util.Observer;
29 import javax.swing.ComboBoxModel;
40 static final long NO_DATA_SOURCE_SELECTED = -1;
50 this.dataSourceMap =
new HashMap<>();
52 fileTypeFilterObservable =
new Observable() {
54 public void notifyObservers() {
58 super.notifyObservers();
69 void addObserver(Observer observer) {
70 fileTypeFilterObservable.addObserver(observer);
79 Map<Long, String> getDataSourceMap() {
80 return Collections.unmodifiableMap(this.dataSourceMap);
89 Long getSelectedDataSourceId() {
91 for (Entry<Long, String> entry : this.dataSourceMap.entrySet()) {
93 return entry.getKey();
106 boolean fileCategoriesButtonIsSelected() {
117 boolean pictureVideoCheckboxIsSelected() {
128 boolean documentsCheckboxIsSelected() {
137 @SuppressWarnings(
"unchecked")
160 public void actionPerformed(java.awt.event.ActionEvent evt) {
169 public void actionPerformed(java.awt.event.ActionEvent evt) {
178 public void actionPerformed(java.awt.event.ActionEvent evt) {
188 public void actionPerformed(java.awt.event.ActionEvent evt) {
198 public void actionPerformed(java.awt.event.ActionEvent evt) {
203 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
204 this.setLayout(layout);
205 layout.setHorizontalGroup(
206 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
207 .addGroup(layout.createSequentialGroup()
208 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
209 .addGroup(layout.createSequentialGroup()
212 .addGroup(layout.createSequentialGroup()
213 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
215 .addGroup(layout.createSequentialGroup()
217 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
220 .addGroup(layout.createSequentialGroup()
222 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
225 .addGap(0, 0, Short.MAX_VALUE)))
229 layout.setVerticalGroup(
230 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
231 .addGroup(layout.createSequentialGroup()
233 .addComponent(
onlySpecificDataSourceCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
234 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
235 .addComponent(
selectDataSourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
236 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
238 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
240 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
242 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
244 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
255 fileTypeFilterObservable.notifyObservers();
264 fileTypeFilterObservable.notifyObservers();
277 fileTypeFilterObservable.notifyObservers();
282 fileTypeFilterObservable.notifyObservers();
303 this.dataSourcesList = dataSourceComboBoxModel;
304 this.selectDataSourceComboBox.setModel(dataSourcesList);
313 void setDataSourceMap(Map<Long, String> dataSourceMap) {
314 this.dataSourceMap.clear();
315 this.dataSourceMap.putAll(dataSourceMap);
void allFileCategoriesRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JCheckBox onlySpecificDataSourceCheckbox
javax.swing.JCheckBox pictureVideoCheckbox
javax.swing.JRadioButton selectedFileCategoriesButton
javax.swing.JComboBox< String > selectDataSourceComboBox
static final long serialVersionUID
void pictureVideoCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void documentsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.ButtonGroup buttonGroup
void onlySpecificDataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JCheckBox documentsCheckbox
final Observable fileTypeFilterObservable
ComboBoxModel< String > dataSourcesList
javax.swing.JRadioButton allFileCategoriesRadioButton
void selectedFileCategoriesButtonActionPerformed(java.awt.event.ActionEvent evt)
final Map< Long, String > dataSourceMap
javax.swing.JLabel categoriesLabel