19 package org.sleuthkit.autopsy.filesearch;
21 import java.awt.event.ActionListener;
24 class DeletedFilesSearchPanel
extends javax.swing.JPanel {
26 private static final long serialVersionUID = 1L;
28 private final static String ALL_DELETED_CONTENT_QUERY =
"( "
29 +
"(dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue()
31 +
"meta_flags = " + TskData.TSK_FS_META_FLAG_ENUM.ORPHAN.getValue()
33 +
" AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType()
35 +
" OR type = " + TskData.TSK_DB_FILES_TYPE_ENUM.CARVED.getFileType()
36 +
" OR (dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue()
37 +
" AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.LAYOUT_FILE.getFileType() +
" )";
42 DeletedFilesSearchPanel() {
46 boolean isDeletedFileSelected() {
47 return deletedCheckbox.isSelected();
50 void setDeletedFileSelected(
boolean selected) {
51 deletedCheckbox.setSelected(selected);
59 @SuppressWarnings(
"unchecked")
61 private
void initComponents() {
62 java.awt.GridBagConstraints gridBagConstraints;
64 deletedCheckbox =
new javax.swing.JCheckBox();
66 setMinimumSize(
new java.awt.Dimension(337, 49));
67 setPreferredSize(
new java.awt.Dimension(337, 49));
68 setLayout(
new java.awt.GridBagLayout());
70 org.openide.awt.Mnemonics.setLocalizedText(deletedCheckbox,
org.openide.util.NbBundle.getMessage(DeletedFilesSearchPanel.class,
"DeletedFilesSearchPanel.deletedCheckbox.text"));
71 deletedCheckbox.setMinimumSize(
new java.awt.Dimension(0, 0));
72 gridBagConstraints =
new java.awt.GridBagConstraints();
73 gridBagConstraints.gridx = 0;
74 gridBagConstraints.gridy = 0;
75 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
76 gridBagConstraints.weightx = 1.0;
77 gridBagConstraints.weighty = 1.0;
78 add(deletedCheckbox, gridBagConstraints);
83 private javax.swing.JCheckBox deletedCheckbox;
85 static final class DeletedFileSearchFilter
extends AbstractFileSearchFilter<DeletedFilesSearchPanel> {
87 DeletedFileSearchFilter() {
88 super(
new DeletedFilesSearchPanel());
92 public boolean isEnabled() {
97 public boolean isValid() {
102 public String getPredicate() throws FilterValidationException {
103 if (getComponent().isDeletedFileSelected()) {
104 return ALL_DELETED_CONTENT_QUERY;
111 public void addActionListener(ActionListener l) {