5661 Notify user that there were no results for their search

This commit is contained in:
William Schaefer 2019-12-05 19:03:21 -05:00
parent 01f9278aed
commit 5a1aba7710
2 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,12 @@
CTL_OpenFileDiscoveryAction=File Discovery
# {0} - dataSourceName
DataSourceModuleWrapper.exifModule.text=Exif Parser module was not run on data source: {0}\n
# {0} - dataSourceName
DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n
# {0} - dataSourceName
DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n
DiscoveryTopComponent.name=\ File Discovery
DiscoveryTopComponent.resultsIncomplete.text=Results may be incomplete
FileGroup.groupSortingAlgorithm.groupName.text=Group Name
FileGroup.groupSortingAlgorithm.groupSize.text=Group Size
# {0} - Data source name
@ -154,6 +161,8 @@ FileSorter.SortingMethod.filetype.displayName=File Type
FileSorter.SortingMethod.frequency.displayName=Central Repo Frequency
FileSorter.SortingMethod.fullPath.displayName=Full Path
FileSorter.SortingMethod.keywordlist.displayName=Keyword List Names
GroupsListPanel.noResults.message.text=No results were found for the selected filters.
GroupsListPanel.noResults.title.text=No results found
ImageThumbnailPanel.bytes.text=bytes
# {0} - numberOfInstances
ImageThumbnailPanel.countLabel.text=Number of Instances: {0}

View File

@ -24,6 +24,8 @@ import java.util.Map;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey;
import org.sleuthkit.autopsy.filequery.FileSearchData.FileType;
@ -59,11 +61,13 @@ class GroupListPanel extends javax.swing.JPanel {
groupKeyList.setListData(new GroupKey[0]);
}
@Messages({"GroupsListPanel.noResults.message.text=No results were found for the selected filters.",
"GroupsListPanel.noResults.title.text=No results found"})
/**
* Subscribe to and update list of groups in response to
* SearchCompleteEvents
*
* @param searchCompleteEvent the SearchCompleteEvent which was recieved
* @param searchCompleteEvent the SearchCompleteEvent which was received
*/
@Subscribe
void handleSearchCompleteEvent(DiscoveryEvents.SearchCompleteEvent searchCompleteEvent) {
@ -75,6 +79,11 @@ class GroupListPanel extends javax.swing.JPanel {
groupKeyList.setListData(groupMap.keySet().toArray(new GroupKey[groupMap.keySet().size()]));
if (groupKeyList.getModel().getSize() > 0) {
groupKeyList.setSelectedIndex(0);
} else {
JOptionPane.showMessageDialog(DiscoveryTopComponent.getTopComponent(),
Bundle.GroupsListPanel_noResults_message_text(),
Bundle.GroupsListPanel_noResults_title_text(),
JOptionPane.INFORMATION_MESSAGE);
}
}