5661 - Change order within groups to combo box, change labels

This commit is contained in:
William Schaefer 2019-12-04 19:58:38 -05:00
parent 5e132c0712
commit 54fef68d31
8 changed files with 171 additions and 197 deletions

View File

@ -15,18 +15,16 @@ FileSearchDialog.orderAttrRadioButton.text=Attribute
FileSearchDialog.orderSizeRadioButton.text=Group Size
FileSearchDialog.jLabel5.text=Order files by:
FileSearchDialog.parentCheckBox.text=Parent
FileSearchPanel.sortingPanel.border.title=Sorting
FileSearchPanel.sortingPanel.border.title=Grouping
FileSearchPanel.searchButton.text=Show
FileSearchPanel.addButton.text=Add
FileSearchPanel.substringRadioButton.text=Substring
FileSearchPanel.fullRadioButton.text=Full
FileSearchPanel.parentCheckbox.text=Parent:
FileSearchPanel.parentCheckbox.text=Parent Folder:
FileSearchPanel.keywordCheckbox.text=Keyword:
FileSearchPanel.crFrequencyCheckbox.text=Past Occurrences:
FileSearchPanel.dataSourceCheckbox.text=Data Source:
FileSearchPanel.groupSizeRadioButton.text=Group Size
FileSearchPanel.sizeCheckbox.text=File Size:
FileSearchPanel.attributeRadioButton.text=Group Name
FileSearchPanel.orderGroupsByLabel.text=Order Groups By:
FileSearchPanel.filtersScrollPane.border.title=Filters
FileSearchPanel.parentLabel.text=(All will be used)
@ -43,16 +41,16 @@ FileSearchDialog.notableCheckBox.text=Must have been tagged as notable
FileSearchDialog.scoreCheckBox.text=Has score
FileSearchPanel.cancelButton.text=Cancel
FileSearchPanel.hashSetCheckbox.text=Hash Set:
FileSearchPanel.tagsCheckbox.text=Tags:
FileSearchPanel.interestingItemsCheckbox.text=Interesting Items:
FileSearchPanel.tagsCheckbox.text=Tag:
FileSearchPanel.interestingItemsCheckbox.text=Interesting Item:
FileSearchPanel.scoreCheckbox.text=Has Score:
FileSearchPanel.exifCheckbox.text=Must contain EXIF data
FileSearchPanel.notableCheckbox.text=Must have been tagged as notable
FileSearchPanel.objectsCheckbox.text=Objects:
FileSearchPanel.objectsCheckbox.text=Object Detected:
ResultsPanel.currentPageLabel.text=Page: -
ResultsPanel.pageControlsLabel.text=Pages:
ResultsPanel.gotoPageLabel.text=Go to Page:
ResultsPanel.pageSizeLabel.text=Page size:
ResultsPanel.pageSizeLabel.text=Page Size:
ResultsPanel.instancesList.border.title=Instances
DiscoveryExtractAction.title.extractFiles.text=Extract File
FileSearchPanel.includeRadioButton.text=Include

View File

@ -1,5 +1,7 @@
CTL_OpenFileDiscoveryAction=File discovery
DiscoveryTopComponent.name=\ File Discovery
FileGroup.groupSortingAlgorithm.groupName.text=Group name
FileGroup.groupSortingAlgorithm.groupSize.text=Group size
# {0} - Data source name
# {1} - Data source ID
FileSearch.DataSourceGroupKey.datasourceAndID={0}(ID: {1})
@ -112,7 +114,7 @@ FileSearchFiltering.SizeFilter.range=({0} to {1})
FileSearchFiltering.TagsFilter.desc=Files that have been tagged {0}
FileSearchFiltering.TagsFilter.or=\ or
FileSearchPanel.dialogTitle.text=Test file search
FileSearchPanel.sortingPanel.border.title=Sorting
FileSearchPanel.sortingPanel.border.title=Grouping
FileSearchPanel.searchButton.text=Show
FileSearchPanel.addButton.text=Add
FileSearchPanel.substringRadioButton.text=Substring
@ -121,9 +123,7 @@ FileSearchPanel.parentCheckbox.text=Parent:
FileSearchPanel.keywordCheckbox.text=Keyword:
FileSearchPanel.crFrequencyCheckbox.text=Past Occurrences:
FileSearchPanel.dataSourceCheckbox.text=Data Source:
FileSearchPanel.groupSizeRadioButton.text=Group Size
FileSearchPanel.sizeCheckbox.text=File Size:
FileSearchPanel.attributeRadioButton.text=Group Name
FileSearchPanel.orderGroupsByLabel.text=Order Groups By:
FileSearchPanel.filtersScrollPane.border.title=Filters
FileSearchPanel.parentLabel.text=(All will be used)
@ -173,7 +173,7 @@ ResultsPanel.invalidPageNumber.title=Invalid Page Number
ResultsPanel.openInExternalViewer.name=Open in External Viewer
ResultsPanel.pageControlsLabel.text=Pages:
ResultsPanel.gotoPageLabel.text=Go to Page:
ResultsPanel.pageSizeLabel.text=Page size:
ResultsPanel.pageSizeLabel.text=Page Size:
ResultsPanel.instancesList.border.title=Instances
DiscoveryExtractAction.title.extractFiles.text=Extract File
FileSearchPanel.includeRadioButton.text=Include

View File

@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.filequery;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey;
/**
@ -100,7 +101,7 @@ class FileGroup implements Comparable<FileGroup> {
switch (groupSortingType) {
case BY_GROUP_SIZE:
return compareGroupsBySize(this, otherGroup);
case BY_GROUP_KEY:
case BY_GROUP_NAME:
default:
return compareGroupsByGroupKey(this, otherGroup);
}
@ -131,7 +132,7 @@ class FileGroup implements Comparable<FileGroup> {
if (group1.getFiles().size() != group2.getFiles().size()) {
return -1 * Long.compare(group1.getFiles().size(), group2.getFiles().size()); // High to low
} else {
// If the groups have the same size, fall through to the BY_GROUP_KEY sorting
// If the groups have the same size, fall through to the BY_GROUP_NAME sorting
return compareGroupsByGroupKey(group1, group2);
}
}
@ -139,9 +140,28 @@ class FileGroup implements Comparable<FileGroup> {
/**
* Enum to specify how to sort the group.
*/
@Messages({"FileGroup.groupSortingAlgorithm.groupSize.text=Group Size",
"FileGroup.groupSortingAlgorithm.groupName.text=Group Name"})
enum GroupSortingAlgorithm {
BY_GROUP_SIZE, // Sort from largest to smallest group
BY_GROUP_KEY // Sort using the group key (for example, if grouping by size sort from largest to smallest value)
BY_GROUP_NAME(Bundle.FileGroup_groupSortingAlgorithm_groupName_text()), // Sort using the group key (for example, if grouping by size sort from largest to smallest value)
BY_GROUP_SIZE(Bundle.FileGroup_groupSortingAlgorithm_groupSize_text()); // Sort from largest to smallest group
private final String displayName;
/**
* Construct a GroupSortingAlgorithm enum value.
*
* @param name The name to display to the user for the enum value.
*/
GroupSortingAlgorithm(String name) {
displayName = name;
}
@Override
public String toString() {
return displayName;
}
}
/**

View File

@ -1806,16 +1806,16 @@ class FileSearch {
* Enum for the attribute types that can be used for grouping.
*/
@NbBundle.Messages({
"FileSearch.GroupingAttributeType.fileType.displayName=File type",
"FileSearch.GroupingAttributeType.frequency.displayName=Past occurrences",
"FileSearch.GroupingAttributeType.keywordList.displayName=Keyword list names",
"FileSearch.GroupingAttributeType.fileType.displayName=File Type",
"FileSearch.GroupingAttributeType.frequency.displayName=Past Occurrences",
"FileSearch.GroupingAttributeType.keywordList.displayName=Keyword",
"FileSearch.GroupingAttributeType.size.displayName=File Size",
"FileSearch.GroupingAttributeType.datasource.displayName=Data source",
"FileSearch.GroupingAttributeType.parent.displayName=Parent folder",
"FileSearch.GroupingAttributeType.hash.displayName=Hash set",
"FileSearch.GroupingAttributeType.interestingItem.displayName=Interesting item set",
"FileSearch.GroupingAttributeType.tag.displayName=File tag",
"FileSearch.GroupingAttributeType.object.displayName=Object detected",
"FileSearch.GroupingAttributeType.datasource.displayName=Data Source",
"FileSearch.GroupingAttributeType.parent.displayName=Parent Folder",
"FileSearch.GroupingAttributeType.hash.displayName=Hash Set",
"FileSearch.GroupingAttributeType.interestingItem.displayName=Interesting Item",
"FileSearch.GroupingAttributeType.tag.displayName=Tag",
"FileSearch.GroupingAttributeType.object.displayName=Object Detected",
"FileSearch.GroupingAttributeType.none.displayName=None"})
enum GroupingAttributeType {
FILE_SIZE(new FileSizeAttribute(), Bundle.FileSearch_GroupingAttributeType_size_displayName()),

View File

@ -8,8 +8,6 @@
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.ButtonGroup" name="orderGroupsByButtonGroup">
</Component>
<Component class="javax.swing.ButtonGroup" name="parentIncludeButtonGroup">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
@ -67,7 +65,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Component id="filtersScrollPane" pref="331" max="32767" attributes="0"/>
<Component id="filtersScrollPane" pref="360" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="sortingPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@ -712,7 +710,7 @@
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Sorting">
<TitledBorder title="Grouping">
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/filequery/Bundle.properties" key="FileSearchPanel.sortingPanel.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</TitledBorder>
</Border>
@ -725,33 +723,25 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="groupByCombobox" linkSize="3" min="-2" pref="253" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="groupByLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="groupByCombobox" linkSize="4" min="-2" pref="253" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Component id="attributeRadioButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="groupByLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="orderGroupsByLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Component id="groupSizeRadioButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="orderByLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="orderByCombobox" linkSize="3" min="-2" pref="253" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="orderByLabel" max="32767" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="groupSortingComboBox" linkSize="4" alignment="1" pref="253" max="32767" attributes="0"/>
<Component id="orderByCombobox" linkSize="4" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -760,17 +750,16 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="groupByCombobox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="groupByLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="orderGroupsByLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="attributeRadioButton" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="groupSizeRadioButton" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="groupSortingComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="orderGroupsByLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="orderByCombobox" alignment="3" min="-2" max="-2" attributes="0"/>
@ -809,27 +798,6 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="attributeRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="orderGroupsByButtonGroup"/>
</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.attributeRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="groupSizeRadioButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="orderGroupsByButtonGroup"/>
</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.groupSizeRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="orderByLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -844,6 +812,11 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="groupSortingComboBox">
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;GroupSortingAlgorithm&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="errorLabel">

View File

@ -39,6 +39,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.filequery.FileGroup.GroupSortingAlgorithm;
import org.sleuthkit.autopsy.filequery.FileSearch.GroupingAttributeType;
import org.sleuthkit.autopsy.filequery.FileSearchData.FileType;
import org.sleuthkit.autopsy.filequery.FileSearchData.FileSize;
@ -58,7 +59,7 @@ import org.sleuthkit.datamodel.TagName;
final class FileSearchPanel extends javax.swing.JPanel implements ActionListener {
private static final long serialVersionUID = 1L;
private static final String[] DEFAULT_IGNORED_PATHS = {"Windows", "Program Files"};
private static final String[] DEFAULT_IGNORED_PATHS = {"/Windows/", "/Program Files/"}; //NON-NLS
private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName());
private FileType fileType = FileType.IMAGE;
private DefaultListModel<FileSearchFiltering.ParentSearchTerm> parentListModel;
@ -70,6 +71,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
@NbBundle.Messages({"FileSearchPanel.dialogTitle.text=Test file search"})
FileSearchPanel() {
initComponents();
for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) {
groupSortingComboBox.addItem(groupSortAlgorithm);
}
parentListModel = (DefaultListModel<FileSearchFiltering.ParentSearchTerm>) parentList.getModel();
for (String ignorePath : DEFAULT_IGNORED_PATHS) {
parentListModel.add(parentListModel.size(), new ParentSearchTerm(ignorePath, false, false));
@ -556,6 +560,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
orderByCombobox.addItem(method);
}
}
groupSortingComboBox.setSelectedIndex(0);
setSelectedType(FileType.IMAGE);
validateFields();
}
@ -921,8 +927,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* @return the grouping attribute
*/
FileSearch.AttributeType getGroupingAttribute() {
FileSearch.GroupingAttributeType groupingAttrType = (FileSearch.GroupingAttributeType) groupByCombobox.getSelectedItem();
return groupingAttrType.getAttributeType();
return groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType();
}
/**
@ -931,10 +936,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
* @return the selected sorting method
*/
FileGroup.GroupSortingAlgorithm getGroupSortingMethod() {
if (attributeRadioButton.isSelected()) {
return FileGroup.GroupSortingAlgorithm.BY_GROUP_KEY;
}
return FileGroup.GroupSortingAlgorithm.BY_GROUP_SIZE;
return groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex());
}
/**
@ -1064,7 +1067,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
java.awt.GridBagConstraints gridBagConstraints;
javax.swing.ButtonGroup parentPathButtonGroup = new javax.swing.ButtonGroup();
orderGroupsByButtonGroup = new javax.swing.ButtonGroup();
javax.swing.ButtonGroup parentIncludeButtonGroup = new javax.swing.ButtonGroup();
filtersScrollPane = new javax.swing.JScrollPane();
filtersPanel = new javax.swing.JPanel();
@ -1114,10 +1116,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
groupByCombobox = new javax.swing.JComboBox<>();
orderByCombobox = new javax.swing.JComboBox<>();
orderGroupsByLabel = new javax.swing.JLabel();
attributeRadioButton = new javax.swing.JRadioButton();
groupSizeRadioButton = new javax.swing.JRadioButton();
orderByLabel = new javax.swing.JLabel();
groupByLabel = new javax.swing.JLabel();
groupSortingComboBox = new javax.swing.JComboBox<>();
errorLabel = new javax.swing.JLabel();
cancelButton = new javax.swing.JButton();
@ -1561,13 +1562,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.orderGroupsByLabel.text")); // NOI18N
orderGroupsByButtonGroup.add(attributeRadioButton);
attributeRadioButton.setSelected(true);
org.openide.awt.Mnemonics.setLocalizedText(attributeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.attributeRadioButton.text")); // NOI18N
orderGroupsByButtonGroup.add(groupSizeRadioButton);
org.openide.awt.Mnemonics.setLocalizedText(groupSizeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.groupSizeRadioButton.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(orderByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.orderByLabel.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(groupByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.groupByLabel.text")); // NOI18N
@ -1579,44 +1573,36 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
.addGroup(sortingPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sortingPanelLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(sortingPanelLayout.createSequentialGroup()
.addComponent(groupByLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(sortingPanelLayout.createSequentialGroup()
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sortingPanelLayout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(attributeRadioButton))
.addComponent(groupByLabel)
.addGroup(sortingPanelLayout.createSequentialGroup()
.addGap(17, 17, 17)
.addComponent(orderGroupsByLabel))
.addGroup(sortingPanelLayout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(groupSizeRadioButton))
.addGroup(sortingPanelLayout.createSequentialGroup()
.addComponent(orderByLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)))
.addComponent(orderGroupsByLabel)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(orderByLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(groupSortingComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, 253, Short.MAX_VALUE)
.addComponent(orderByCombobox, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap())
);
sortingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {groupByCombobox, orderByCombobox});
sortingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {groupByCombobox, groupSortingComboBox, orderByCombobox});
sortingPanelLayout.setVerticalGroup(
sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sortingPanelLayout.createSequentialGroup()
.addGap(8, 8, 8)
.addGap(20, 20, 20)
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(groupByLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(orderGroupsByLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(attributeRadioButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(groupSizeRadioButton)
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(orderGroupsByLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -1662,7 +1648,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE)
.addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@ -1722,8 +1708,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
cancelButton.setEnabled(!enabled);
orderByCombobox.setEnabled(enabled);
groupByCombobox.setEnabled(enabled);
attributeRadioButton.setEnabled(enabled);
groupSizeRadioButton.setEnabled(enabled);
groupSortingComboBox.setEnabled(enabled);
}
/**
@ -1832,7 +1817,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addButton;
private javax.swing.JRadioButton attributeRadioButton;
private javax.swing.JButton cancelButton;
private javax.swing.JCheckBox crFrequencyCheckbox;
private javax.swing.JList<Frequency> crFrequencyList;
@ -1849,7 +1833,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JRadioButton fullRadioButton;
private javax.swing.JComboBox<GroupingAttributeType> groupByCombobox;
private javax.swing.JLabel groupByLabel;
private javax.swing.JRadioButton groupSizeRadioButton;
private javax.swing.JComboBox<GroupSortingAlgorithm> groupSortingComboBox;
private javax.swing.JCheckBox hashSetCheckbox;
private javax.swing.JList<String> hashSetList;
private javax.swing.JScrollPane hashSetScrollPane;
@ -1867,7 +1851,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener
private javax.swing.JScrollPane objectsScrollPane;
private javax.swing.JComboBox<SortingMethod> orderByCombobox;
private javax.swing.JLabel orderByLabel;
private javax.swing.ButtonGroup orderGroupsByButtonGroup;
private javax.swing.JLabel orderGroupsByLabel;
private javax.swing.JCheckBox parentCheckbox;
private javax.swing.JLabel parentLabel;

View File

@ -240,13 +240,13 @@ class FileSorter implements Comparator<ResultFile> {
* Enum for selecting the primary method for sorting result files.
*/
@NbBundle.Messages({
"FileSorter.SortingMethod.datasource.displayName=Data source",
"FileSorter.SortingMethod.filename.displayName=File name",
"FileSorter.SortingMethod.filesize.displayName=File size",
"FileSorter.SortingMethod.filetype.displayName=File type",
"FileSorter.SortingMethod.frequency.displayName=Central repo frequency",
"FileSorter.SortingMethod.keywordlist.displayName=Keyword list names",
"FileSorter.SortingMethod.fullPath.displayName=Full path"})
"FileSorter.SortingMethod.datasource.displayName=Data Source",
"FileSorter.SortingMethod.filename.displayName=File Name",
"FileSorter.SortingMethod.filesize.displayName=File Size",
"FileSorter.SortingMethod.filetype.displayName=File Type",
"FileSorter.SortingMethod.frequency.displayName=Central Repo Frequency",
"FileSorter.SortingMethod.keywordlist.displayName=Keyword List Names",
"FileSorter.SortingMethod.fullPath.displayName=Full Path"})
enum SortingMethod {
BY_FILE_NAME(new ArrayList<>(),
Bundle.FileSorter_SortingMethod_filename_displayName()), // Sort alphabetically by file name

View File

@ -59,7 +59,7 @@ class SearchResults {
* Create an dummy SearchResults object that can be used in the UI before the search is finished.
*/
SearchResults() {
this.groupSortingType = FileGroup.GroupSortingAlgorithm.BY_GROUP_KEY;
this.groupSortingType = FileGroup.GroupSortingAlgorithm.BY_GROUP_NAME;
this.attrType = new FileSearch.FileSizeAttribute();
this.fileSorter = new FileSorter(FileSorter.SortingMethod.BY_FILE_NAME);
}