Merge pull request #5373 from wschaeferB/5674-ExcludeFoldersFilter

5674 exclude folders filter
This commit is contained in:
Richard Cordovano 2019-11-14 09:54:00 -05:00 committed by GitHub
commit 6ceee42dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 532 additions and 339 deletions

View File

@ -58,3 +58,7 @@ ResultsPanel.gotoPageLabel.text=Go to Page:
ResultsPanel.pageSizeLabel.text=Page size: ResultsPanel.pageSizeLabel.text=Page size:
ResultsPanel.instancesList.border.title=Instances ResultsPanel.instancesList.border.title=Instances
DiscoveryExtractAction.title.extractFiles.text=Extract File DiscoveryExtractAction.title.extractFiles.text=Extract File
FileSearchPanel.includeRadioButton.text=Include
FileSearchPanel.excludeRadioButton.text=Exclude
FileSearchPanel.knownFilesCheckbox.toolTipText=
FileSearchPanel.knownFilesCheckbox.text=Hide known files

View File

@ -86,6 +86,7 @@ FileSearchFiltering.HashSetFilter.desc=Files with hash set hits in set(s): {0}
FileSearchFiltering.InterestingItemSetFilter.desc=Files with interesting item hits in set(s): {0} FileSearchFiltering.InterestingItemSetFilter.desc=Files with interesting item hits in set(s): {0}
# {0} - filters # {0} - filters
FileSearchFiltering.KeywordListFilter.desc=Files with keywords in list(s): {0} FileSearchFiltering.KeywordListFilter.desc=Files with keywords in list(s): {0}
FileSearchFiltering.KnownFilter.desc=Files which are not known
# {0} - filters # {0} - filters
FileSearchFiltering.ObjectDetectionFilter.desc=Files with objects detected in set(s): {0} FileSearchFiltering.ObjectDetectionFilter.desc=Files with objects detected in set(s): {0}
# {0} - filters # {0} - filters
@ -93,10 +94,10 @@ FileSearchFiltering.ParentFilter.desc=Files with paths matching: {0}
FileSearchFiltering.ParentFilter.exact=(exact match) FileSearchFiltering.ParentFilter.exact=(exact match)
FileSearchFiltering.ParentFilter.or=\ or FileSearchFiltering.ParentFilter.or=\ or
FileSearchFiltering.ParentFilter.substring=(substring) FileSearchFiltering.ParentFilter.substring=(substring)
# {0} - search term FileSearchFiltering.ParentSearchTerm.excludeString=\ (exclude)
FileSearchFiltering.ParentSearchTerm.fullString=\ {0} (exact) FileSearchFiltering.ParentSearchTerm.fullString=\ (exact)
# {0} - search term FileSearchFiltering.ParentSearchTerm.includeString=\ (include)
FileSearchFiltering.ParentSearchTerm.subString=\ {0} (substring) FileSearchFiltering.ParentSearchTerm.subString=\ (substring)
FileSearchFiltering.PreviouslyNotableFilter.desc=Files that were previously marked as notable FileSearchFiltering.PreviouslyNotableFilter.desc=Files that were previously marked as notable
# {0} - filters # {0} - filters
FileSearchFiltering.ScoreFilter.desc=Files with score(s) of : {0} FileSearchFiltering.ScoreFilter.desc=Files with score(s) of : {0}
@ -178,6 +179,10 @@ ResultsPanel.gotoPageLabel.text=Go to Page:
ResultsPanel.pageSizeLabel.text=Page size: ResultsPanel.pageSizeLabel.text=Page size:
ResultsPanel.instancesList.border.title=Instances ResultsPanel.instancesList.border.title=Instances
DiscoveryExtractAction.title.extractFiles.text=Extract File DiscoveryExtractAction.title.extractFiles.text=Extract File
FileSearchPanel.includeRadioButton.text=Include
FileSearchPanel.excludeRadioButton.text=Exclude
FileSearchPanel.knownFilesCheckbox.toolTipText=
FileSearchPanel.knownFilesCheckbox.text=Hide known files
ResultsPanel.viewFileInDir.name=View File in Directory ResultsPanel.viewFileInDir.name=View File in Directory
SearchNode.getName.text=Search Result SearchNode.getName.text=Search Result
# {0} - numberOfInstances # {0} - numberOfInstances

View File

@ -1092,9 +1092,9 @@ public class FileSearchDialog extends javax.swing.JDialog implements ActionListe
if ( ! parentTextField.getText().isEmpty()) { if ( ! parentTextField.getText().isEmpty()) {
ParentSearchTerm searchTerm; ParentSearchTerm searchTerm;
if (parentFullRadioButton.isSelected()) { if (parentFullRadioButton.isSelected()) {
searchTerm = new ParentSearchTerm(parentTextField.getText(), true); searchTerm = new ParentSearchTerm(parentTextField.getText(), true, true);
} else { } else {
searchTerm = new ParentSearchTerm(parentTextField.getText(), false); searchTerm = new ParentSearchTerm(parentTextField.getText(), false, true);
} }
parentListModel.add(parentListModel.size(), searchTerm); parentListModel.add(parentListModel.size(), searchTerm);
} }

View File

@ -2,10 +2,16 @@
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents> <NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="parentButtonGroup"> <Component class="javax.swing.ButtonGroup" name="parentPathButtonGroup">
</Component> </Component>
<Component class="javax.swing.ButtonGroup" name="orderGroupsByButtonGroup"> <Component class="javax.swing.ButtonGroup" name="orderGroupsByButtonGroup">
</Component> </Component>
<Component class="javax.swing.ButtonGroup" name="parentIncludeButtonGroup">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
</NonVisualComponents> </NonVisualComponents>
<Properties> <Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@ -170,7 +176,7 @@
</Events> </Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="11" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="0" gridY="12" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -203,7 +209,7 @@
<Component class="javax.swing.JRadioButton" name="fullRadioButton"> <Component class="javax.swing.JRadioButton" name="fullRadioButton">
<Properties> <Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="parentButtonGroup"/> <ComponentRef name="parentPathButtonGroup"/>
</Property> </Property>
<Property name="selected" type="boolean" value="true"/> <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -213,14 +219,14 @@
</Properties> </Properties>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="13" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="1" gridY="14" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="substringRadioButton"> <Component class="javax.swing.JRadioButton" name="substringRadioButton">
<Properties> <Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="parentButtonGroup"/> <ComponentRef name="parentPathButtonGroup"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.substringRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.substringRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
@ -229,7 +235,7 @@
</Properties> </Properties>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="13" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.5" weightY="0.0"/> <GridBagConstraints gridX="2" gridY="14" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.5" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -239,7 +245,7 @@
</Properties> </Properties>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="14" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="6" insetsRight="0" anchor="23" weightX="0.5" weightY="0.0"/> <GridBagConstraints gridX="1" gridY="16" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="6" insetsRight="0" anchor="23" weightX="0.5" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -264,7 +270,7 @@
</Events> </Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="3" gridY="14" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="6" insetsRight="6" anchor="24" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="3" gridY="16" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="6" insetsRight="6" anchor="24" weightX="0.0" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -289,7 +295,7 @@
</Events> </Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="3" gridY="13" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="4" insetsRight="6" anchor="24" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="3" gridY="15" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="4" insetsRight="6" anchor="24" weightX="0.0" weightY="0.0"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -379,7 +385,7 @@
</Properties> </Properties>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="12" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.1"/> <GridBagConstraints gridX="0" gridY="13" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.1"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
</Component> </Component>
@ -389,7 +395,7 @@
</AuxValues> </AuxValues>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="11" gridWidth="3" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="6" anchor="23" weightX="0.5" weightY="0.1"/> <GridBagConstraints gridX="1" gridY="12" gridWidth="3" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="6" anchor="23" weightX="0.5" weightY="0.1"/>
</Constraint> </Constraint>
</Constraints> </Constraints>
@ -641,6 +647,54 @@
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="javax.swing.JRadioButton" name="includeRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="parentIncludeButtonGroup"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.includeRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="15" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JRadioButton" name="excludeRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="parentIncludeButtonGroup"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.excludeRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="15" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="23" weightX="0.5" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="knownFilesCheckbox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.knownFilesCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.knownFilesCheckbox.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="11" gridWidth="4" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="4" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
</SubComponents> </SubComponents>

View File

@ -58,10 +58,10 @@ import org.sleuthkit.datamodel.TagName;
* Dialog to allow the user to choose filtering and grouping options. * Dialog to allow the user to choose filtering and grouping options.
*/ */
final class FileSearchPanel extends javax.swing.JPanel implements ActionListener { final class FileSearchPanel extends javax.swing.JPanel implements ActionListener {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName()); private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName());
private DefaultListModel<FileSearchFiltering.ParentSearchTerm> parentListModel; private DefaultListModel<FileSearchFiltering.ParentSearchTerm> parentListModel;
private final SleuthkitCase caseDb; private final SleuthkitCase caseDb;
private final EamDb centralRepoDb; private final EamDb centralRepoDb;
@ -82,7 +82,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* Set up all the UI components * Set up all the UI components
*/ */
private void customizeComponents() { private void customizeComponents() {
searchButton.setEnabled(false); searchButton.setEnabled(false);
// Set up the filters // Set up the filters
@ -204,7 +204,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
int count = 0; int count = 0;
try { try {
DefaultListModel<String> kwListModel = (DefaultListModel<String>) keywordList.getModel(); DefaultListModel<String> kwListModel = (DefaultListModel<String>) keywordList.getModel();
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT, List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT,
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
for (String name : setNames) { for (String name : setNames) {
@ -225,7 +225,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
int count = 0; int count = 0;
try { try {
DefaultListModel<String> hashListModel = (DefaultListModel<String>) hashSetList.getModel(); DefaultListModel<String> hashListModel = (DefaultListModel<String>) hashSetList.getModel();
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT, List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT,
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
for (String name : setNames) { for (String name : setNames) {
@ -247,7 +247,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
int count = 0; int count = 0;
try { try {
DefaultListModel<String> intListModel = (DefaultListModel<String>) interestingItemsList.getModel(); DefaultListModel<String> intListModel = (DefaultListModel<String>) interestingItemsList.getModel();
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT,
BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME);
for (String name : setNames) { for (String name : setNames) {
@ -269,7 +269,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
int count = 0; int count = 0;
try { try {
DefaultListModel<TagName> tagsListModel = (DefaultListModel<TagName>) tagsList.getModel(); DefaultListModel<TagName> tagsListModel = (DefaultListModel<TagName>) tagsList.getModel();
List<TagName> tagNames = caseDb.getTagNamesInUse(); List<TagName> tagNames = caseDb.getTagNamesInUse();
for (TagName name : tagNames) { for (TagName name : tagNames) {
tagsListModel.add(count, name); tagsListModel.add(count, name);
@ -288,9 +288,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* TagsListCellRenderer * TagsListCellRenderer
*/ */
private class TagsListCellRenderer extends DefaultListCellRenderer { private class TagsListCellRenderer extends DefaultListCellRenderer {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override @Override
public java.awt.Component getListCellRendererComponent( public java.awt.Component getListCellRendererComponent(
JList<?> list, JList<?> list,
@ -314,7 +314,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
int count = 0; int count = 0;
try { try {
DefaultListModel<String> objListModel = (DefaultListModel<String>) objectsList.getModel(); DefaultListModel<String> objListModel = (DefaultListModel<String>) objectsList.getModel();
List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION); List<String> setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION);
for (String name : setNames) { for (String name : setNames) {
objListModel.add(count, name); objListModel.add(count, name);
@ -332,7 +332,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* Initialize the score filter * Initialize the score filter
*/ */
private void setUpScoreFilter() { private void setUpScoreFilter() {
int count = 0; int count = 0;
DefaultListModel<Score> scoreListModel = (DefaultListModel<Score>) scoreList.getModel(); DefaultListModel<Score> scoreListModel = (DefaultListModel<Score>) scoreList.getModel();
for (Score score : Score.getOptionsForFiltering()) { for (Score score : Score.getOptionsForFiltering()) {
@ -374,9 +374,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* Initialize the parent path filter * Initialize the parent path filter
*/ */
private void setUpParentPathFilter() { private void setUpParentPathFilter() {
parentButtonGroup.add(fullRadioButton); parentPathButtonGroup.add(fullRadioButton);
parentButtonGroup.add(substringRadioButton); parentPathButtonGroup.add(substringRadioButton);
fullRadioButton.setSelected(true); fullRadioButton.setSelected(true);
includeRadioButton.setSelected(true);
parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel(); parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
addListeners(parentCheckbox, parentList); addListeners(parentCheckbox, parentList);
} }
@ -391,57 +392,62 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
// There will always be a file type selected // There will always be a file type selected
filters.add(new FileSearchFiltering.FileTypeFilter(fileTypeComboBox.getItemAt(fileTypeComboBox.getSelectedIndex()))); filters.add(new FileSearchFiltering.FileTypeFilter(fileTypeComboBox.getItemAt(fileTypeComboBox.getSelectedIndex())));
if (parentCheckbox.isSelected()) { if (parentCheckbox.isSelected()) {
// For the parent paths, everything in the box is used (not just the selected entries) // For the parent paths, everything in the box is used (not just the selected entries)
filters.add(new FileSearchFiltering.ParentFilter(getParentPaths())); filters.add(new FileSearchFiltering.ParentFilter(getParentPaths()));
} }
if (dataSourceCheckbox.isSelected()) { if (dataSourceCheckbox.isSelected()) {
List<DataSource> dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList()); List<DataSource> dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList());
filters.add(new FileSearchFiltering.DataSourceFilter(dataSources)); filters.add(new FileSearchFiltering.DataSourceFilter(dataSources));
} }
if (crFrequencyCheckbox.isSelected()) { if (crFrequencyCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList())); filters.add(new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList()));
} }
if (sizeCheckbox.isSelected()) { if (sizeCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList())); filters.add(new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList()));
} }
if (keywordCheckbox.isSelected()) { if (keywordCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.KeywordListFilter(keywordList.getSelectedValuesList())); filters.add(new FileSearchFiltering.KeywordListFilter(keywordList.getSelectedValuesList()));
} }
if (hashSetCheckbox.isSelected()) { if (hashSetCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList())); filters.add(new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList()));
} }
if (interestingItemsCheckbox.isSelected()) { if (interestingItemsCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList())); filters.add(new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList()));
} }
if (objectsCheckbox.isSelected()) { if (objectsCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList())); filters.add(new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList()));
} }
if (tagsCheckbox.isSelected()) { if (tagsCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList())); filters.add(new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList()));
} }
if (exifCheckbox.isSelected()) { if (exifCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.ExifFilter()); filters.add(new FileSearchFiltering.ExifFilter());
} }
if (notableCheckbox.isSelected()) { if (notableCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.NotableFilter()); filters.add(new FileSearchFiltering.NotableFilter());
} }
if (knownFilesCheckbox.isSelected()){
filters.add(new FileSearchFiltering.KnownFilter());
}
if (scoreCheckbox.isSelected()) { if (scoreCheckbox.isSelected()) {
filters.add(new FileSearchFiltering.ScoreFilter(scoreList.getSelectedValuesList())); filters.add(new FileSearchFiltering.ScoreFilter(scoreList.getSelectedValuesList()));
} }
return filters; return filters;
} }
@ -488,7 +494,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
FileSorter.SortingMethod getFileSortingMethod() { FileSorter.SortingMethod getFileSortingMethod() {
return (FileSorter.SortingMethod) orderByCombobox.getSelectedItem(); return (FileSorter.SortingMethod) orderByCombobox.getSelectedItem();
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
validateFields(); validateFields();
@ -499,17 +505,17 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* name * name
*/ */
private class DataSourceItem { private class DataSourceItem {
private final DataSource ds; private final DataSource ds;
DataSourceItem(DataSource ds) { DataSourceItem(DataSource ds) {
this.ds = ds; this.ds = ds;
} }
DataSource getDataSource() { DataSource getDataSource() {
return ds; return ds;
} }
@Override @Override
public String toString() { public String toString() {
return ds.getName() + " (ID: " + ds.getId() + ")"; return ds.getName() + " (ID: " + ds.getId() + ")";
@ -549,27 +555,27 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
setInvalid("At least one parent path must be entered"); setInvalid("At least one parent path must be entered");
return; return;
} }
if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) { if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) {
setInvalid("At least one hash set name must be selected"); setInvalid("At least one hash set name must be selected");
return; return;
} }
if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) { if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) {
setInvalid("At least one interesting file set name must be selected"); setInvalid("At least one interesting file set name must be selected");
return; return;
} }
if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) { if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) {
setInvalid("At least one object type name must be selected"); setInvalid("At least one object type name must be selected");
return; return;
} }
if (tagsCheckbox.isSelected() && tagsList.getSelectedValuesList().isEmpty()) { if (tagsCheckbox.isSelected() && tagsList.getSelectedValuesList().isEmpty()) {
setInvalid("At least one tag name must be selected"); setInvalid("At least one tag name must be selected");
return; return;
} }
if (scoreCheckbox.isSelected() && scoreList.getSelectedValuesList().isEmpty()) { if (scoreCheckbox.isSelected() && scoreList.getSelectedValuesList().isEmpty()) {
setInvalid("At least one score must be selected"); setInvalid("At least one score must be selected");
return; return;
@ -606,8 +612,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private void initComponents() { private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints; java.awt.GridBagConstraints gridBagConstraints;
parentButtonGroup = new javax.swing.ButtonGroup(); parentPathButtonGroup = new javax.swing.ButtonGroup();
orderGroupsByButtonGroup = new javax.swing.ButtonGroup(); orderGroupsByButtonGroup = new javax.swing.ButtonGroup();
javax.swing.ButtonGroup parentIncludeButtonGroup = new javax.swing.ButtonGroup();
filtersScrollPane = new javax.swing.JScrollPane(); filtersScrollPane = new javax.swing.JScrollPane();
filtersPanel = new javax.swing.JPanel(); filtersPanel = new javax.swing.JPanel();
sizeCheckbox = new javax.swing.JCheckBox(); sizeCheckbox = new javax.swing.JCheckBox();
@ -648,6 +655,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
interestingItemsList = new javax.swing.JList<>(); interestingItemsList = new javax.swing.JList<>();
scoreScrollPane = new javax.swing.JScrollPane(); scoreScrollPane = new javax.swing.JScrollPane();
scoreList = new javax.swing.JList<>(); scoreList = new javax.swing.JList<>();
includeRadioButton = new javax.swing.JRadioButton();
excludeRadioButton = new javax.swing.JRadioButton();
knownFilesCheckbox = new javax.swing.JCheckBox();
fileTypeLabel = new javax.swing.JLabel(); fileTypeLabel = new javax.swing.JLabel();
searchButton = new javax.swing.JButton(); searchButton = new javax.swing.JButton();
sortingPanel = new javax.swing.JPanel(); sortingPanel = new javax.swing.JPanel();
@ -730,7 +740,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 11; gridBagConstraints.gridy = 12;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
filtersPanel.add(parentCheckbox, gridBagConstraints); filtersPanel.add(parentCheckbox, gridBagConstraints);
@ -751,23 +761,23 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6);
filtersPanel.add(dataSourceScrollPane, gridBagConstraints); filtersPanel.add(dataSourceScrollPane, gridBagConstraints);
parentButtonGroup.add(fullRadioButton); parentPathButtonGroup.add(fullRadioButton);
fullRadioButton.setSelected(true); fullRadioButton.setSelected(true);
org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.fullRadioButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.fullRadioButton.text")); // NOI18N
fullRadioButton.setEnabled(false); fullRadioButton.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 13; gridBagConstraints.gridy = 14;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0); gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
filtersPanel.add(fullRadioButton, gridBagConstraints); filtersPanel.add(fullRadioButton, gridBagConstraints);
parentButtonGroup.add(substringRadioButton); parentPathButtonGroup.add(substringRadioButton);
org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.substringRadioButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.substringRadioButton.text")); // NOI18N
substringRadioButton.setEnabled(false); substringRadioButton.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2; gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 13; gridBagConstraints.gridy = 14;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weightx = 0.5; gridBagConstraints.weightx = 0.5;
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0); gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
@ -776,7 +786,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
parentTextField.setEnabled(false); parentTextField.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 14; gridBagConstraints.gridy = 16;
gridBagConstraints.gridwidth = 2; gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
@ -796,7 +806,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 3; gridBagConstraints.gridx = 3;
gridBagConstraints.gridy = 14; gridBagConstraints.gridy = 16;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 6, 6); gridBagConstraints.insets = new java.awt.Insets(0, 10, 6, 6);
filtersPanel.add(addButton, gridBagConstraints); filtersPanel.add(addButton, gridBagConstraints);
@ -813,7 +823,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
}); });
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 3; gridBagConstraints.gridx = 3;
gridBagConstraints.gridy = 13; gridBagConstraints.gridy = 15;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 4, 6); gridBagConstraints.insets = new java.awt.Insets(0, 10, 4, 6);
filtersPanel.add(deleteButton, gridBagConstraints); filtersPanel.add(deleteButton, gridBagConstraints);
@ -867,7 +877,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.parentLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.parentLabel.text")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0; gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 12; gridBagConstraints.gridy = 13;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 0.1; gridBagConstraints.weighty = 0.1;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
@ -885,7 +895,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 11; gridBagConstraints.gridy = 12;
gridBagConstraints.gridwidth = 3; gridBagConstraints.gridwidth = 3;
gridBagConstraints.gridheight = 2; gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
@ -1057,6 +1067,38 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6);
filtersPanel.add(scoreScrollPane, gridBagConstraints); filtersPanel.add(scoreScrollPane, gridBagConstraints);
parentIncludeButtonGroup.add(includeRadioButton);
includeRadioButton.setSelected(true);
org.openide.awt.Mnemonics.setLocalizedText(includeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.includeRadioButton.text")); // NOI18N
includeRadioButton.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 15;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
filtersPanel.add(includeRadioButton, gridBagConstraints);
parentIncludeButtonGroup.add(excludeRadioButton);
org.openide.awt.Mnemonics.setLocalizedText(excludeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.excludeRadioButton.text")); // NOI18N
excludeRadioButton.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 15;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weightx = 0.5;
gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
filtersPanel.add(excludeRadioButton, gridBagConstraints);
org.openide.awt.Mnemonics.setLocalizedText(knownFilesCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.knownFilesCheckbox.text")); // NOI18N
knownFilesCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.knownFilesCheckbox.toolTipText")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 11;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6);
filtersPanel.add(knownFilesCheckbox, gridBagConstraints);
filtersScrollPane.setViewportView(filtersPanel); filtersScrollPane.setViewportView(filtersPanel);
org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.fileTypeLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(fileTypeLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.fileTypeLabel.text")); // NOI18N
@ -1195,7 +1237,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
enableSearch(false); enableSearch(false);
FileType searchType = fileTypeComboBox.getItemAt(fileTypeComboBox.getSelectedIndex()); FileType searchType = fileTypeComboBox.getItemAt(fileTypeComboBox.getSelectedIndex());
DiscoveryEvents.getDiscoveryEventBus().post(new DiscoveryEvents.SearchStartedEvent(searchType)); DiscoveryEvents.getDiscoveryEventBus().post(new DiscoveryEvents.SearchStartedEvent(searchType));
// For testing, allow the user to run different searches in loop // For testing, allow the user to run different searches in loop
@ -1262,6 +1304,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
scoreList.setEnabled(enabled && scoreCheckbox.isSelected()); scoreList.setEnabled(enabled && scoreCheckbox.isSelected());
exifCheckbox.setEnabled(enabled); exifCheckbox.setEnabled(enabled);
notableCheckbox.setEnabled(enabled); notableCheckbox.setEnabled(enabled);
knownFilesCheckbox.setEnabled(enabled);
parentCheckbox.setEnabled(enabled); parentCheckbox.setEnabled(enabled);
parentScrollPane.setEnabled(enabled && parentCheckbox.isSelected()); parentScrollPane.setEnabled(enabled && parentCheckbox.isSelected());
parentList.setEnabled(enabled && parentCheckbox.isSelected()); parentList.setEnabled(enabled && parentCheckbox.isSelected());
@ -1270,6 +1313,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
deleteButton.setEnabled(enabled && parentCheckbox.isSelected() && !parentListModel.isEmpty()); deleteButton.setEnabled(enabled && parentCheckbox.isSelected() && !parentListModel.isEmpty());
fullRadioButton.setEnabled(enabled && parentCheckbox.isSelected()); fullRadioButton.setEnabled(enabled && parentCheckbox.isSelected());
substringRadioButton.setEnabled(enabled && parentCheckbox.isSelected()); substringRadioButton.setEnabled(enabled && parentCheckbox.isSelected());
includeRadioButton.setEnabled(enabled && parentCheckbox.isSelected());
excludeRadioButton.setEnabled(enabled && parentCheckbox.isSelected());
} }
/** /**
@ -1300,6 +1345,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
parentList.setEnabled(parentCheckbox.isSelected()); parentList.setEnabled(parentCheckbox.isSelected());
fullRadioButton.setEnabled(parentCheckbox.isSelected()); fullRadioButton.setEnabled(parentCheckbox.isSelected());
substringRadioButton.setEnabled(parentCheckbox.isSelected()); substringRadioButton.setEnabled(parentCheckbox.isSelected());
includeRadioButton.setEnabled(parentCheckbox.isSelected());
excludeRadioButton.setEnabled(parentCheckbox.isSelected());
parentTextField.setEnabled(parentCheckbox.isSelected()); parentTextField.setEnabled(parentCheckbox.isSelected());
addButton.setEnabled(parentCheckbox.isSelected()); addButton.setEnabled(parentCheckbox.isSelected());
deleteButton.setEnabled(parentCheckbox.isSelected() && !parentListModel.isEmpty()); deleteButton.setEnabled(parentCheckbox.isSelected() && !parentListModel.isEmpty());
@ -1320,13 +1367,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
if (!parentTextField.getText().isEmpty()) { if (!parentTextField.getText().isEmpty()) {
ParentSearchTerm searchTerm; ParentSearchTerm searchTerm;
if (fullRadioButton.isSelected()) { searchTerm = new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected());
searchTerm = new ParentSearchTerm(parentTextField.getText(), true);
} else {
searchTerm = new ParentSearchTerm(parentTextField.getText(), false);
}
parentListModel.add(parentListModel.size(), searchTerm); parentListModel.add(parentListModel.size(), searchTerm);
validateFields(); validateFields();
parentTextField.setText("");
} }
}//GEN-LAST:event_addButtonActionPerformed }//GEN-LAST:event_addButtonActionPerformed
@ -1396,6 +1440,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JScrollPane dataSourceScrollPane; private javax.swing.JScrollPane dataSourceScrollPane;
private javax.swing.JButton deleteButton; private javax.swing.JButton deleteButton;
private javax.swing.JLabel errorLabel; private javax.swing.JLabel errorLabel;
private javax.swing.JRadioButton excludeRadioButton;
private javax.swing.JCheckBox exifCheckbox; private javax.swing.JCheckBox exifCheckbox;
private javax.swing.JComboBox<FileType> fileTypeComboBox; private javax.swing.JComboBox<FileType> fileTypeComboBox;
private javax.swing.JLabel fileTypeLabel; private javax.swing.JLabel fileTypeLabel;
@ -1408,12 +1453,14 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JCheckBox hashSetCheckbox; private javax.swing.JCheckBox hashSetCheckbox;
private javax.swing.JList<String> hashSetList; private javax.swing.JList<String> hashSetList;
private javax.swing.JScrollPane hashSetScrollPane; private javax.swing.JScrollPane hashSetScrollPane;
private javax.swing.JRadioButton includeRadioButton;
private javax.swing.JCheckBox interestingItemsCheckbox; private javax.swing.JCheckBox interestingItemsCheckbox;
private javax.swing.JList<String> interestingItemsList; private javax.swing.JList<String> interestingItemsList;
private javax.swing.JScrollPane interestingItemsScrollPane; private javax.swing.JScrollPane interestingItemsScrollPane;
private javax.swing.JCheckBox keywordCheckbox; private javax.swing.JCheckBox keywordCheckbox;
private javax.swing.JList<String> keywordList; private javax.swing.JList<String> keywordList;
private javax.swing.JScrollPane keywordScrollPane; private javax.swing.JScrollPane keywordScrollPane;
private javax.swing.JCheckBox knownFilesCheckbox;
private javax.swing.JCheckBox notableCheckbox; private javax.swing.JCheckBox notableCheckbox;
private javax.swing.JCheckBox objectsCheckbox; private javax.swing.JCheckBox objectsCheckbox;
private javax.swing.JList<String> objectsList; private javax.swing.JList<String> objectsList;
@ -1422,10 +1469,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JLabel orderByLabel; private javax.swing.JLabel orderByLabel;
private javax.swing.ButtonGroup orderGroupsByButtonGroup; private javax.swing.ButtonGroup orderGroupsByButtonGroup;
private javax.swing.JLabel orderGroupsByLabel; private javax.swing.JLabel orderGroupsByLabel;
private javax.swing.ButtonGroup parentButtonGroup;
private javax.swing.JCheckBox parentCheckbox; private javax.swing.JCheckBox parentCheckbox;
private javax.swing.JLabel parentLabel; private javax.swing.JLabel parentLabel;
private javax.swing.JList<ParentSearchTerm> parentList; private javax.swing.JList<ParentSearchTerm> parentList;
private javax.swing.ButtonGroup parentPathButtonGroup;
private javax.swing.JScrollPane parentScrollPane; private javax.swing.JScrollPane parentScrollPane;
private javax.swing.JTextField parentTextField; private javax.swing.JTextField parentTextField;
private javax.swing.JCheckBox scoreCheckbox; private javax.swing.JCheckBox scoreCheckbox;