6639 fix comments

This commit is contained in:
William Schaefer 2020-08-17 10:58:40 -04:00
parent bd13fd36db
commit e859cc2b49
20 changed files with 120 additions and 299 deletions

View File

@ -29,7 +29,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
abstract class AbstractFilter {
/**
* Returns part of a query on the tsk_files table that can be AND-ed with
* Returns part of a query on the table that can be AND-ed with
* other pieces
*
* @return the SQL query or an empty string if there is no SQL query for
@ -48,15 +48,15 @@ abstract class AbstractFilter {
}
/**
* Run a secondary filter that does not operate on tsk_files.
* Run a secondary filter that does not operate on table.
*
* @param currentResults The current list of matching files; empty if no
* @param currentResults The current list of matching results; empty if no
* filters have yet been run.
* @param caseDb The case database
* @param centralRepoDb The central repo database. Can be null if the
* filter does not require it.
*
* @return The list of files that match this filter (and any that came
* @return The list of results that match this filter (and any that came
* before it)
*
* @throws FileSearchException

View File

@ -61,21 +61,26 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li
secondColumnPanel.setLayout(new GridBagLayout());
}
/**
* Get the broad ResultType, such as files or attributes.
*
* @return
*/
abstract SearchData.ResultType getResultType();
/**
* Get the type of results this filters panel is for.
* Get the file type of results this filters panel is for.
*
* @return The type of results this panel filters.
* @return The file type of results this panel filters.
*/
abstract FileSearchData.FileType getFileType();
/**
* Get the type of results this filters panel is for.
* Get the attribute type of results this filters panel is for.
*
* @return The type of results this panel filters.
* @return The attribute type of results this panel filters.
*/
abstract AttributeSearchData.ArtifactType getArtifactType();
abstract AttributeSearchData.AttributeType getArtifactType();
/**
* Add a DiscoveryFilterPanel to the specified column with the specified

View File

@ -30,12 +30,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="artifactTypeScrollPane" alignment="0" pref="229" max="32767" attributes="0"/>
<Component id="artifactTypeScrollPane" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="artifactTypeScrollPane" alignment="0" pref="38" max="32767" attributes="0"/>
<Component id="artifactTypeScrollPane" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

View File

@ -25,8 +25,7 @@ import javax.swing.JList;
import org.sleuthkit.datamodel.BlackboardArtifact;
/**
*
* @author wschaefer
* Filter for selection of a specific Arrtifact type to limit results to.
*/
class ArtifactTypeFilterPanel extends AbstractDiscoveryFilterPanel {
@ -48,7 +47,7 @@ class ArtifactTypeFilterPanel extends AbstractDiscoveryFilterPanel {
int count = 0;
DefaultListModel<ArtifactTypeItem> artifactTypeModel = (DefaultListModel<ArtifactTypeItem>) jList1.getModel();
artifactTypeModel.removeAllElements();
for (BlackboardArtifact.ARTIFACT_TYPE artifactType : AttributeSearchData.ArtifactType.DOMAIN.getBlackboardTypes()) {
for (BlackboardArtifact.ARTIFACT_TYPE artifactType : AttributeSearchData.AttributeType.DOMAIN.getBlackboardTypes()) {
artifactTypeModel.add(count, new ArtifactTypeItem(artifactType));
count++;
}

View File

@ -27,7 +27,7 @@ import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.BlackboardArtifact;
/**
* Utility enums for searches made for artifacts with Discovery.
* Utility enums for searches made for attributes with Discovery.
*/
public class AttributeSearchData extends SearchData {
@ -39,24 +39,21 @@ public class AttributeSearchData extends SearchData {
}
/**
* Enum representing the file type. We don't simply use
* FileTypeUtils.FileTypeCategory because: - Some file types categories
* overlap - It is convenient to have the "OTHER" option for files that
* don't match the given types
* Enum representing the attribute type.
*/
@NbBundle.Messages({
"ArtifactSearchData.ArtifactType.Domain.displayName=Domain",
"ArtifactSearchData.ArtifactType.Other.displayName=Other"})
enum ArtifactType {
"AttributeSearchData.AttributeType.Domain.displayName=Domain",
"AttributeSearchData.AttributeType.Other.displayName=Other"})
enum AttributeType {
DOMAIN(0, Bundle.ArtifactSearchData_ArtifactType_Domain_displayName(), DOMAIN_ARTIFACT_TYPES),
OTHER(1, Bundle.ArtifactSearchData_ArtifactType_Other_displayName(), new HashSet<>());
DOMAIN(0, Bundle.AttributeSearchData_AttributeType_Domain_displayName(), DOMAIN_ARTIFACT_TYPES),
OTHER(1, Bundle.AttributeSearchData_AttributeType_Other_displayName(), new HashSet<>());
private final int ranking; // For ordering in the UI
private final String displayName;
private final Set<BlackboardArtifact.ARTIFACT_TYPE> artifactTypes = new HashSet<>();
ArtifactType(int value, String displayName, Set<BlackboardArtifact.ARTIFACT_TYPE> types) {
AttributeType(int value, String displayName, Set<BlackboardArtifact.ARTIFACT_TYPE> types) {
this.ranking = value;
this.displayName = displayName;
this.artifactTypes.addAll(types);
@ -85,7 +82,7 @@ public class AttributeSearchData extends SearchData {
return ranking;
}
static ArtifactType fromBlackboardArtifact(final BlackboardArtifact.ARTIFACT_TYPE type) {
static AttributeType fromBlackboardArtifact(final BlackboardArtifact.ARTIFACT_TYPE type) {
switch (type) {
case TSK_WEB_BOOKMARK:
return DOMAIN;

View File

@ -1,4 +0,0 @@
DateFilterPanel.endCheckBox.text=\u7d42\u4e86:
DateFilterPanel.startCheckBox.text=\u958b\u59cb:

View File

@ -57,7 +57,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="daysLabel" pref="132" max="32767" attributes="0"/>
</Group>
<Component id="jRadioButton1" alignment="1" max="32767" attributes="0"/>
<Component id="rangeRadioButton" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@ -81,7 +81,7 @@
<Component id="daysLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jRadioButton1" min="-2" max="-2" attributes="0"/>
<Component id="rangeRadioButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="startCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
@ -127,9 +127,6 @@
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mostRecentButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="startCheckBox">
<Properties>
@ -175,7 +172,7 @@
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="endCheckBoxStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="jRadioButton1">
<Component class="javax.swing.JRadioButton" name="rangeRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>

View File

@ -26,8 +26,7 @@ import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.communications.Utils;
/**
*
* @author wschaefer
* Filter panel for allowing the user to filter on date.
*/
class DateFilterPanel extends AbstractDiscoveryFilterPanel {
@ -35,7 +34,7 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
private final SpinnerNumberModel numberModel;
/**
* Creates new form DateFilterPanel
* Creates new form DateFilterPanel.
*/
@NbBundle.Messages({"# {0} - timeZone",
"DateFilterPanel.dateRange.text=Date Range ({0}):"})
@ -43,7 +42,7 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
// numberModel is used in initComponents
numberModel = new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1);
initComponents();
jRadioButton1.setText(Bundle.DateFilterPanel_dateRange_text(Utils.getUserPreferredZoneId().toString()));
rangeRadioButton.setText(Bundle.DateFilterPanel_dateRange_text(Utils.getUserPreferredZoneId().toString()));
}
/**
@ -65,7 +64,7 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
startDatePicker = new com.github.lgooddatepicker.components.DatePicker();
endDatePicker = new com.github.lgooddatepicker.components.DatePicker();
endCheckBox = new javax.swing.JCheckBox();
jRadioButton1 = new javax.swing.JRadioButton();
rangeRadioButton = new javax.swing.JRadioButton();
org.openide.awt.Mnemonics.setLocalizedText(dateFilterCheckbox, org.openide.util.NbBundle.getMessage(DateFilterPanel.class, "DateFilterPanel.dateFilterCheckbox.text")); // NOI18N
@ -78,11 +77,6 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
buttonGroup1.add(mostRecentButton);
org.openide.awt.Mnemonics.setLocalizedText(mostRecentButton, org.openide.util.NbBundle.getMessage(DateFilterPanel.class, "DateFilterPanel.mostRecentButton.text")); // NOI18N
mostRecentButton.setEnabled(false);
mostRecentButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mostRecentButtonActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(startCheckBox, org.openide.util.NbBundle.getMessage(DateFilterPanel.class, "DateFilterPanel.startCheckBox.text")); // NOI18N
startCheckBox.setEnabled(false);
@ -108,8 +102,8 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
}
});
buttonGroup1.add(jRadioButton1);
jRadioButton1.setEnabled(false);
buttonGroup1.add(rangeRadioButton);
rangeRadioButton.setEnabled(false);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
@ -121,7 +115,7 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
.addComponent(daysSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(daysLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE))
.addComponent(jRadioButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(rangeRadioButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(30, 30, 30)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -140,7 +134,7 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
.addComponent(daysSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(daysLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jRadioButton1)
.addComponent(rangeRadioButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(startCheckBox)
@ -170,18 +164,14 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
);
}// </editor-fold>//GEN-END:initComponents
private void mostRecentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mostRecentButtonActionPerformed
}//GEN-LAST:event_mostRecentButtonActionPerformed
private void startCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_startCheckBoxStateChanged
startDatePicker.setEnabled(startCheckBox.isSelected());
// validateFilters();
// validateFilters(); //TODO JIRA-6714 when search will begin doing something
}//GEN-LAST:event_startCheckBoxStateChanged
private void endCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_endCheckBoxStateChanged
endDatePicker.setEnabled(endCheckBox.isSelected());
// validateFilters();
// validateFilters(); //TODO JIRA-6714 when search will begin doing something
}//GEN-LAST:event_endCheckBoxStateChanged
@Override
@ -223,8 +213,8 @@ class DateFilterPanel extends AbstractDiscoveryFilterPanel {
private javax.swing.JCheckBox endCheckBox;
private com.github.lgooddatepicker.components.DatePicker endDatePicker;
private javax.swing.JPanel jPanel1;
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton mostRecentButton;
private javax.swing.JRadioButton rangeRadioButton;
private javax.swing.JCheckBox startCheckBox;
private com.github.lgooddatepicker.components.DatePicker startDatePicker;
// End of variables declaration//GEN-END:variables

View File

@ -70,7 +70,7 @@ final class DiscoveryDialog extends javax.swing.JDialog {
private static volatile boolean shouldUpdate = false;
private SearchData.ResultType resultType = SearchData.ResultType.FILE;
private FileSearchData.FileType fileType = FileSearchData.FileType.IMAGE;
private AttributeSearchData.ArtifactType artifactType = null;
private AttributeSearchData.AttributeType artifactType = null;
private final PropertyChangeListener listener;
private final Set<BlackboardAttribute> objectsDetected = new HashSet<>();
private final Set<BlackboardAttribute> interestingItems = new HashSet<>();
@ -143,6 +143,9 @@ final class DiscoveryDialog extends javax.swing.JDialog {
repaint();
}
/**
* Set the type buttons to a default state where none are selected.
*/
private void unselectAllButtons() {
imagesButton.setSelected(false);
imagesButton.setEnabled(true);
@ -609,7 +612,7 @@ final class DiscoveryDialog extends javax.swing.JDialog {
domainsButton.setBackground(SELECTED_COLOR);
domainsButton.setForeground(Color.BLACK);
resultType = SearchData.ResultType.ATTRIBUTE;
artifactType = AttributeSearchData.ArtifactType.DOMAIN;
artifactType = AttributeSearchData.AttributeType.DOMAIN;
fileType = null;
documentFilterPanel.addPropertyChangeListener(listener);
validateDialog();

View File

@ -22,7 +22,7 @@ import com.google.common.eventbus.EventBus;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.sleuthkit.autopsy.discovery.AttributeSearchData.ArtifactType;
import org.sleuthkit.autopsy.discovery.AttributeSearchData.AttributeType;
import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey;
import org.sleuthkit.autopsy.discovery.FileSearchData.FileType;
import org.sleuthkit.autopsy.discovery.SearchData.ResultType;
@ -58,23 +58,23 @@ final class DiscoveryEventUtils {
private final ResultType resultType;
private final FileType fileType;
private final ArtifactType artifactType;
private final AttributeType attributeType;
/**
* Construct a new SearchStartedEvent
*
* @param type The type of file the search event is for.
*/
SearchStartedEvent(ResultType resultType, FileType fileType, ArtifactType artifactType) {
SearchStartedEvent(ResultType resultType, FileType fileType, AttributeType attributeType) {
this.resultType = resultType;
this.fileType = fileType;
this.artifactType = artifactType;
this.attributeType = attributeType;
}
/**
* Get the broad search type.
*
* @return The result type, either FILES, or ARTIFACTS.
* @return The result type, either FILES, or ATTRIBUTES.
*/
ResultType getResultType() {
return resultType;
@ -90,12 +90,12 @@ final class DiscoveryEventUtils {
}
/**
* Get the type of artifact the search is being performed for.
* Get the type of attribute the search is being performed for.
*
* @return The type of artifacts being searched for.
* @return The type of attribute being searched for.
*/
ArtifactType getArtifactType() {
return artifactType;
AttributeType getAttributeType() {
return attributeType;
}
}

View File

@ -288,7 +288,7 @@ public final class DiscoveryTopComponent extends TopComponent {
if (searchStartedEvent.getResultType() == ResultType.FILE) {
text = Bundle.DiscoveryTopComponent_searchInProgress_text(searchStartedEvent.getFileType().name());
} else if (searchStartedEvent.getResultType() == ResultType.ATTRIBUTE) {
text = Bundle.DiscoveryTopComponent_searchInProgress_text(searchStartedEvent.getArtifactType().name());
text = Bundle.DiscoveryTopComponent_searchInProgress_text(searchStartedEvent.getAttributeType().name());
}
progressMessageTextArea.setText(text);
}

View File

@ -104,7 +104,7 @@ final class DocumentFilterPanel extends AbstractFiltersPanel {
}
@Override
AttributeSearchData.ArtifactType getArtifactType() {
AttributeSearchData.AttributeType getArtifactType() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

View File

@ -21,16 +21,15 @@ package org.sleuthkit.autopsy.discovery;
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
/**
*
* @author wschaefer
* Filter panel for searching domain attributes with Discovery.
*/
public class DomainFilterPanel extends AbstractFiltersPanel {
private static final long serialVersionUID = 1L;
private static final AttributeSearchData.ArtifactType ARTIFACT_TYPE = AttributeSearchData.ArtifactType.DOMAIN;
private static final AttributeSearchData.AttributeType ARTIFACT_TYPE = AttributeSearchData.AttributeType.DOMAIN;
/**
* Creates new form DomainFilterPanel
* Creates new form DomainFilterPanel.
*/
public DomainFilterPanel() {
super();
@ -43,7 +42,6 @@ public class DomainFilterPanel extends AbstractFiltersPanel {
pastOccurrencesIndices = new int[]{2, 3, 4};
addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0);
}
addPanelsToScrollPane(domainFiltersSplitPane);
}
@ -100,7 +98,7 @@ public class DomainFilterPanel extends AbstractFiltersPanel {
}
@Override
AttributeSearchData.ArtifactType getArtifactType() {
AttributeSearchData.AttributeType getArtifactType() {
return ARTIFACT_TYPE;
}

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JCheckBox" name="domainUniquenessCheckbox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/discovery/Bundle.properties" key="DomainUniquenessFilterPanel.domainUniquenessCheckbox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</NonVisualComponents>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="domainUniqueScrollPane" alignment="0" pref="207" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="domainUniqueScrollPane" alignment="0" pref="48" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="domainUniqueScrollPane">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="jList1">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="2">
<StringItem index="0" value="Unique"/>
<StringItem index="1" value="Multiple instances"/>
</StringArray>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@ -1,111 +0,0 @@
/*
* Autopsy
*
* Copyright 2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.discovery;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JList;
/**
*
* @author wschaefer
*/
class DomainUniquenessFilterPanel extends AbstractDiscoveryFilterPanel {
private static final long serialVersionUID = 1L;
/**
* Creates new form DomainUniquenessFilterPanel
*/
DomainUniquenessFilterPanel() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
domainUniquenessCheckbox = new javax.swing.JCheckBox();
domainUniqueScrollPane = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList<>();
org.openide.awt.Mnemonics.setLocalizedText(domainUniquenessCheckbox, org.openide.util.NbBundle.getMessage(DomainUniquenessFilterPanel.class, "DomainUniquenessFilterPanel.domainUniquenessCheckbox.text")); // NOI18N
jList1.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Unique", "Multiple instances" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
jList1.setEnabled(false);
domainUniqueScrollPane.setViewportView(jList1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(domainUniqueScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(domainUniqueScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
@Override
void configurePanel(boolean selected, int[] indicesSelected) {
domainUniquenessCheckbox.setSelected(selected);
}
@Override
JCheckBox getCheckbox() {
return domainUniquenessCheckbox;
}
@Override
JList<?> getList() {
return null;
}
@Override
JLabel getAdditionalLabel() {
return null;
}
@Override
String checkForError() {
return "Domain search is not implemented.";
}
@Override
AbstractFilter getFilter() {
return null;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane domainUniqueScrollPane;
private javax.swing.JCheckBox domainUniquenessCheckbox;
private javax.swing.JList<String> jList1;
// End of variables declaration//GEN-END:variables
}

View File

@ -110,7 +110,7 @@ final class ImageFilterPanel extends AbstractFiltersPanel {
}
@Override
AttributeSearchData.ArtifactType getArtifactType() {
AttributeSearchData.AttributeType getArtifactType() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}

View File

@ -24,7 +24,6 @@ import javax.swing.JLabel;
import javax.swing.JList;
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency;
import org.sleuthkit.autopsy.discovery.SearchData.ResultType;
/**
* Panel to allow configuration of the Past Occurrences filter.

View File

@ -18,15 +18,22 @@
*/
package org.sleuthkit.autopsy.discovery;
/**
* Abstract class to contain data that is common to all result types.
*/
abstract class SearchData {
/**
* Enum of the broad result type categories.
*/
enum ResultType {
FILE,
ATTRIBUTE;
}
/**
* Get the broad result type.
*/
abstract ResultType getResultType();
}

View File

@ -156,18 +156,18 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.SizeFilter.desc=Size(s): {0}",
"FileSearchFiltering.SizeFilter.or=, "})
"SearchFiltering.SizeFilter.desc=Size(s): {0}",
"SearchFiltering.SizeFilter.or=, "})
@Override
String getDesc() {
String desc = ""; // NON-NLS
for (FileSize size : fileSizes) {
if (!desc.isEmpty()) {
desc += Bundle.FileSearchFiltering_SizeFilter_or();
desc += Bundle.SearchFiltering_SizeFilter_or();
}
desc += size.getSizeGroup();
}
desc = Bundle.FileSearchFiltering_SizeFilter_desc(desc);
desc = Bundle.SearchFiltering_SizeFilter_desc(desc);
return desc;
}
}
@ -220,22 +220,22 @@ class SearchFiltering {
}
@NbBundle.Messages({
"FileSearchFiltering.ParentSearchTerm.fullString= (exact)",
"FileSearchFiltering.ParentSearchTerm.subString= (substring)",
"FileSearchFiltering.ParentSearchTerm.includeString= (include)",
"FileSearchFiltering.ParentSearchTerm.excludeString= (exclude)",})
"SearchFiltering.ParentSearchTerm.fullString= (exact)",
"SearchFiltering.ParentSearchTerm.subString= (substring)",
"SearchFiltering.ParentSearchTerm.includeString= (include)",
"SearchFiltering.ParentSearchTerm.excludeString= (exclude)",})
@Override
public String toString() {
String returnString = getSearchStr();
if (isFullPath()) {
returnString += Bundle.FileSearchFiltering_ParentSearchTerm_fullString();
returnString += Bundle.SearchFiltering_ParentSearchTerm_fullString();
} else {
returnString += Bundle.FileSearchFiltering_ParentSearchTerm_subString();
returnString += Bundle.SearchFiltering_ParentSearchTerm_subString();
}
if (isIncluded()) {
returnString += Bundle.FileSearchFiltering_ParentSearchTerm_includeString();
returnString += Bundle.SearchFiltering_ParentSearchTerm_includeString();
} else {
returnString += Bundle.FileSearchFiltering_ParentSearchTerm_excludeString();
returnString += Bundle.SearchFiltering_ParentSearchTerm_excludeString();
}
return returnString;
}
@ -310,31 +310,31 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.ParentFilter.desc=Paths matching: {0}",
"FileSearchFiltering.ParentFilter.or=, ",
"FileSearchFiltering.ParentFilter.exact=(exact match)",
"FileSearchFiltering.ParentFilter.substring=(substring)",
"FileSearchFiltering.ParentFilter.included=(included)",
"FileSearchFiltering.ParentFilter.excluded=(excluded)"})
"SearchFiltering.ParentFilter.desc=Paths matching: {0}",
"SearchFiltering.ParentFilter.or=, ",
"SearchFiltering.ParentFilter.exact=(exact match)",
"SearchFiltering.ParentFilter.substring=(substring)",
"SearchFiltering.ParentFilter.included=(included)",
"SearchFiltering.ParentFilter.excluded=(excluded)"})
@Override
String getDesc() {
String desc = ""; // NON-NLS
for (ParentSearchTerm searchTerm : parentSearchTerms) {
if (!desc.isEmpty()) {
desc += Bundle.FileSearchFiltering_ParentFilter_or();
desc += Bundle.SearchFiltering_ParentFilter_or();
}
if (searchTerm.isFullPath()) {
desc += searchTerm.getSearchStr() + Bundle.FileSearchFiltering_ParentFilter_exact();
desc += searchTerm.getSearchStr() + Bundle.SearchFiltering_ParentFilter_exact();
} else {
desc += searchTerm.getSearchStr() + Bundle.FileSearchFiltering_ParentFilter_substring();
desc += searchTerm.getSearchStr() + Bundle.SearchFiltering_ParentFilter_substring();
}
if (searchTerm.isIncluded()) {
desc += Bundle.FileSearchFiltering_ParentFilter_included();
desc += Bundle.SearchFiltering_ParentFilter_included();
} else {
desc += Bundle.FileSearchFiltering_ParentFilter_excluded();
desc += Bundle.SearchFiltering_ParentFilter_excluded();
}
}
desc = Bundle.FileSearchFiltering_ParentFilter_desc(desc);
desc = Bundle.SearchFiltering_ParentFilter_desc(desc);
return desc;
}
}
@ -370,21 +370,21 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.DataSourceFilter.desc=Data source(s): {0}",
"FileSearchFiltering.DataSourceFilter.or=, ",
"SearchFiltering.DataSourceFilter.desc=Data source(s): {0}",
"SearchFiltering.DataSourceFilter.or=, ",
"# {0} - Data source name",
"# {1} - Data source ID",
"FileSearchFiltering.DataSourceFilter.datasource={0}({1})",})
"SearchFiltering.DataSourceFilter.datasource={0}({1})",})
@Override
String getDesc() {
String desc = ""; // NON-NLS
for (DataSource ds : dataSources) {
if (!desc.isEmpty()) {
desc += Bundle.FileSearchFiltering_DataSourceFilter_or();
desc += Bundle.SearchFiltering_DataSourceFilter_or();
}
desc += Bundle.FileSearchFiltering_DataSourceFilter_datasource(ds.getName(), ds.getId());
desc += Bundle.SearchFiltering_DataSourceFilter_datasource(ds.getName(), ds.getId());
}
desc = Bundle.FileSearchFiltering_DataSourceFilter_desc(desc);
desc = Bundle.SearchFiltering_DataSourceFilter_desc(desc);
return desc;
}
}
@ -419,10 +419,10 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.KeywordListFilter.desc=Keywords in list(s): {0}",})
"SearchFiltering.KeywordListFilter.desc=Keywords in list(s): {0}",})
@Override
String getDesc() {
return Bundle.FileSearchFiltering_KeywordListFilter_desc(concatenateSetNamesForDisplay(listNames));
return Bundle.SearchFiltering_KeywordListFilter_desc(concatenateSetNamesForDisplay(listNames));
}
}
@ -469,18 +469,18 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.FileTypeFilter.desc=Type: {0}",
"FileSearchFiltering.FileTypeFilter.or=, ",})
"SearchFiltering.FileTypeFilter.desc=Type: {0}",
"SearchFiltering.FileTypeFilter.or=, ",})
@Override
String getDesc() {
String desc = "";
for (FileType cat : categories) {
if (!desc.isEmpty()) {
desc += Bundle.FileSearchFiltering_FileTypeFilter_or();
desc += Bundle.SearchFiltering_FileTypeFilter_or();
}
desc += cat.toString();
}
desc = Bundle.FileSearchFiltering_FileTypeFilter_desc(desc);
desc = Bundle.SearchFiltering_FileTypeFilter_desc(desc);
return desc;
}
}
@ -539,18 +539,18 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.FrequencyFilter.desc=Past occurrences: {0}",
"FileSearchFiltering.FrequencyFilter.or=, ",})
"SearchFiltering.FrequencyFilter.desc=Past occurrences: {0}",
"SearchFiltering.FrequencyFilter.or=, ",})
@Override
String getDesc() {
String desc = ""; // NON-NLS
for (Frequency freq : frequencies) {
if (!desc.isEmpty()) {
desc += Bundle.FileSearchFiltering_FrequencyFilter_or();
desc += Bundle.SearchFiltering_FrequencyFilter_or();
}
desc += freq.toString();
}
return Bundle.FileSearchFiltering_FrequencyFilter_desc(desc);
return Bundle.SearchFiltering_FrequencyFilter_desc(desc);
}
}
@ -623,10 +623,10 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.InterestingItemSetFilter.desc=Interesting item hits in set(s): {0}",})
"SearchFiltering.InterestingItemSetFilter.desc=Interesting item hits in set(s): {0}",})
@Override
String getDesc() {
return Bundle.FileSearchFiltering_InterestingItemSetFilter_desc(concatenateSetNamesForDisplay(setNames));
return Bundle.SearchFiltering_InterestingItemSetFilter_desc(concatenateSetNamesForDisplay(setNames));
}
}
@ -661,10 +661,10 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.ObjectDetectionFilter.desc=Objects detected in set(s): {0}",})
"SearchFiltering.ObjectDetectionFilter.desc=Objects detected in set(s): {0}",})
@Override
String getDesc() {
return Bundle.FileSearchFiltering_ObjectDetectionFilter_desc(concatenateSetNamesForDisplay(typeNames));
return Bundle.SearchFiltering_ObjectDetectionFilter_desc(concatenateSetNamesForDisplay(typeNames));
}
}
@ -737,10 +737,10 @@ class SearchFiltering {
@NbBundle.Messages({
"# {0} - filters",
"FileSearchFiltering.ScoreFilter.desc=Score(s) of : {0}",})
"SearchFiltering.ScoreFilter.desc=Score(s) of : {0}",})
@Override
String getDesc() {
return Bundle.FileSearchFiltering_ScoreFilter_desc(
return Bundle.SearchFiltering_ScoreFilter_desc(
concatenateSetNamesForDisplay(scores.stream().map(p -> p.toString()).collect(Collectors.toList())));
}
}

View File

@ -111,7 +111,7 @@ final class VideoFilterPanel extends AbstractFiltersPanel {
}
@Override
AttributeSearchData.ArtifactType getArtifactType() {
AttributeSearchData.AttributeType getArtifactType() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}