3166 Priority column in AID 2.0 will now be sorted Descending order

This commit is contained in:
William Schaefer 2017-10-27 13:56:36 -04:00
commit 5b92bcc81d
4 changed files with 10 additions and 12 deletions

View File

@ -37,9 +37,10 @@ class AutoIngestRowSorter<M extends DefaultTableModel> extends TableRowSorter<M>
@Override @Override
public void toggleSortOrder(int column) { public void toggleSortOrder(int column) {
if (!this.getModel().getColumnClass(column).equals(Date.class)) { if (!this.getModel().getColumnClass(column).equals(Date.class) && !this.getModel().getColumnClass(column).equals(Integer.class)) {
super.toggleSortOrder(column); //if it isn't a date perform the regular sorting //currently the only Integer column this sorter is being applied to is the Priority column
} else { super.toggleSortOrder(column); //if it isn't a date or Integer column perform the regular sorting
} else {
ArrayList<RowSorter.SortKey> sortKeys = new ArrayList<>(getSortKeys()); ArrayList<RowSorter.SortKey> sortKeys = new ArrayList<>(getSortKeys());
if (sortKeys.isEmpty() || sortKeys.get(0).getColumn() != column) { //sort descending if (sortKeys.isEmpty() || sortKeys.get(0).getColumn() != column) { //sort descending
sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING)); sortKeys.add(0, new RowSorter.SortKey(column, SortOrder.DESCENDING));

View File

@ -122,7 +122,7 @@ public class GroupManager {
/* /*
* --- current grouping/sorting attributes --- * --- current grouping/sorting attributes ---
*/ */
private volatile GroupSortBy sortBy = GroupSortBy.NONE; private volatile GroupSortBy sortBy = GroupSortBy.PRIORITY;
private volatile DrawableAttribute<?> groupBy = DrawableAttribute.PATH; private volatile DrawableAttribute<?> groupBy = DrawableAttribute.PATH;
private volatile SortOrder sortOrder = SortOrder.ASCENDING; private volatile SortOrder sortOrder = SortOrder.ASCENDING;
@ -466,7 +466,7 @@ public class GroupManager {
} }
} }
public Comparator<DrawableGroup> getSortBy() { public GroupSortBy getSortBy() {
return sortBy; return sortBy;
} }

View File

@ -189,7 +189,7 @@ public class Toolbar extends ToolBar {
}); });
sortChooser.sortOrderProperty().addListener(queryInvalidationListener); sortChooser.sortOrderProperty().addListener(queryInvalidationListener);
sortChooser.setComparator(GroupSortBy.PRIORITY); sortChooser.setComparator(controller.getGroupManager().getSortBy());
getItems().add(1, sortChooser); getItems().add(1, sortChooser);
sortHelpImageView.setCursor(Cursor.HAND); sortHelpImageView.setCursor(Cursor.HAND);

View File

@ -29,9 +29,9 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
final class KeywordSearchGlobalSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel { final class KeywordSearchGlobalSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private GlobalListSettingsPanel listsPanel; private final GlobalListSettingsPanel listsPanel = new GlobalListSettingsPanel();
private KeywordSearchGlobalLanguageSettingsPanel languagesPanel; private final KeywordSearchGlobalLanguageSettingsPanel languagesPanel = new KeywordSearchGlobalLanguageSettingsPanel();
private KeywordSearchGlobalSearchSettingsPanel generalPanel; private final KeywordSearchGlobalSearchSettingsPanel generalPanel = new KeywordSearchGlobalSearchSettingsPanel();
KeywordSearchGlobalSettingsPanel() { KeywordSearchGlobalSettingsPanel() {
initComponents(); initComponents();
@ -41,9 +41,6 @@ final class KeywordSearchGlobalSettingsPanel extends IngestModuleGlobalSettingsP
@NbBundle.Messages({"KeywordSearchGlobalSettingsPanel.Title=Global Keyword Search Settings"}) @NbBundle.Messages({"KeywordSearchGlobalSettingsPanel.Title=Global Keyword Search Settings"})
private void customizeComponents() { private void customizeComponents() {
setName(Bundle.KeywordSearchGlobalSettingsPanel_Title()); setName(Bundle.KeywordSearchGlobalSettingsPanel_Title());
listsPanel = new GlobalListSettingsPanel();
languagesPanel = new KeywordSearchGlobalLanguageSettingsPanel();
generalPanel = new KeywordSearchGlobalSearchSettingsPanel();
tabbedPane.insertTab(NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.listTabTitle"), null, tabbedPane.insertTab(NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.listTabTitle"), null,
listsPanel, NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.listLabToolTip"), 0); listsPanel, NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.listLabToolTip"), 0);
tabbedPane.insertTab(NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.stringExtTitle"), null, tabbedPane.insertTab(NbBundle.getMessage(this.getClass(), "KeywordSearchConfigurationPanel.customizeComponents.stringExtTitle"), null,