20 package org.sleuthkit.autopsy.commonfilesearch;
22 import java.util.Collections;
23 import java.util.HashMap;
25 import java.util.Map.Entry;
26 import java.util.Observable;
27 import java.util.Observer;
28 import javax.swing.ComboBoxModel;
39 static final long NO_DATA_SOURCE_SELECTED = -1;
49 this.dataSourceMap =
new HashMap<>();
51 fileTypeFilterObservable =
new Observable() {
53 public void notifyObservers() {
57 super.notifyObservers();
68 void addObserver(Observer observer) {
69 fileTypeFilterObservable.addObserver(observer);
78 Map<Long, String> getDataSourceMap() {
79 return Collections.unmodifiableMap(this.dataSourceMap);
88 Long getSelectedDataSourceId() {
90 for (Entry<Long, String> entry : this.dataSourceMap.entrySet()) {
92 return entry.getKey();
105 boolean fileCategoriesButtonIsSelected() {
116 boolean pictureVideoCheckboxIsSelected() {
127 boolean documentsCheckboxIsSelected() {
136 @SuppressWarnings(
"unchecked")
159 public void actionPerformed(java.awt.event.ActionEvent evt) {
168 public void actionPerformed(java.awt.event.ActionEvent evt) {
177 public void actionPerformed(java.awt.event.ActionEvent evt) {
187 public void actionPerformed(java.awt.event.ActionEvent evt) {
197 public void actionPerformed(java.awt.event.ActionEvent evt) {
202 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
203 this.setLayout(layout);
204 layout.setHorizontalGroup(
205 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
206 .addGroup(layout.createSequentialGroup()
207 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
208 .addGroup(layout.createSequentialGroup()
211 .addGroup(layout.createSequentialGroup()
212 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
214 .addGroup(layout.createSequentialGroup()
216 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
219 .addGroup(layout.createSequentialGroup()
221 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
224 .addGap(0, 0, Short.MAX_VALUE)))
228 layout.setVerticalGroup(
229 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
230 .addGroup(layout.createSequentialGroup()
232 .addComponent(
onlySpecificDataSourceCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
233 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
234 .addComponent(
selectDataSourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
235 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
237 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
239 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
241 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
243 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
254 fileTypeFilterObservable.notifyObservers();
263 fileTypeFilterObservable.notifyObservers();
276 fileTypeFilterObservable.notifyObservers();
281 fileTypeFilterObservable.notifyObservers();
302 this.dataSourcesList = dataSourceComboBoxModel;
303 this.selectDataSourceComboBox.setModel(dataSourcesList);
312 void setDataSourceMap(Map<Long, String> dataSourceMap) {
313 this.dataSourceMap.clear();
314 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