diff --git a/res/runtime/dictionary.properties b/res/runtime/dictionary.properties index 689177a25..da35e2103 100644 --- a/res/runtime/dictionary.properties +++ b/res/runtime/dictionary.properties @@ -318,6 +318,7 @@ CustomizeCommandBar.label = Customize command bar ToggleStatusBar.show = Show status bar ToggleStatusBar.hide = Hide status bar ToggleShowFoldersFirst.label = Show folders first +ToggleFoldersAlwaysAlphabetical.label = Sort Folders always alphabetical ToggleTree.label = Show tree view ToggleSinglePanel.label = Toggle single panel PopupLeftDriveButton.label = Change left folder diff --git a/res/runtime/dictionary_de_DE.properties b/res/runtime/dictionary_de_DE.properties index 216efb3be..5a84d8878 100644 --- a/res/runtime/dictionary_de_DE.properties +++ b/res/runtime/dictionary_de_DE.properties @@ -280,6 +280,7 @@ CustomizeCommandBar.label = Kommandozeile anpassen ToggleStatusBar.show = Statusleiste anzeigen ToggleStatusBar.hide = Statusleiste verbergen ToggleShowFoldersFirst.label = Ordner zuerst anzeigen +ToggleFoldersAlwaysAlphabetical.label = Ordner immer alphabetisch ordnen ToggleTree.label = Zeige Baumansicht PopupLeftDriveButton.label = Linken Ordner ändern PopupRightDriveButton.label = Rechten Ordner ändern diff --git a/src/main/com/mucommander/commons/file/util/FileComparator.java b/src/main/com/mucommander/commons/file/util/FileComparator.java index 00d3c0f80..ae83ec730 100644 --- a/src/main/com/mucommander/commons/file/util/FileComparator.java +++ b/src/main/com/mucommander/commons/file/util/FileComparator.java @@ -34,6 +34,8 @@ public class FileComparator implements Comparator { private boolean ascending; /** Specifies whether directories should precede files or be handled as regular files */ private boolean directoriesFirst; + /** Specifies whether directories always alphabetical sorted */ + private boolean foldersAlwaysAlphabetical; /** Criterion for filename comparison. */ public final static int NAME_CRITERION = 0; @@ -63,16 +65,18 @@ public class FileComparator implements Comparator { * @param criterion comparison criterion, see constant fields * @param ascending if true, ascending order will be used, descending order otherwise * @param directoriesFirst specifies whether directories should precede files or be handled as regular files + * @param foldersAlwaysAlphabetical specifies wether directories are sorted always alphabetical if they stay first */ - public FileComparator(int criterion, boolean ascending, boolean directoriesFirst, QuickSearch quickSearch) { + public FileComparator(int criterion, boolean ascending, boolean directoriesFirst, boolean foldersAlwaysAlphabetical, QuickSearch quickSearch) { this.criterion = criterion; this.ascending = ascending; this.directoriesFirst = directoriesFirst; + this.foldersAlwaysAlphabetical = foldersAlwaysAlphabetical; this.quickSearch = quickSearch; } - public FileComparator(int criterion, boolean ascending, boolean directoriesFirst) { - this(criterion, ascending, directoriesFirst, null); + public FileComparator(int criterion, boolean ascending, boolean directoriesFirst, boolean foldersAlwaysAlphabetical) { + this(criterion, ascending, directoriesFirst, foldersAlwaysAlphabetical, null); } @@ -268,15 +272,26 @@ public int compare(AbstractFile f1, AbstractFile f2) { boolean is1Directory = f1.isDirectory(); boolean is2Directory = f2.isDirectory(); + long diff; + if (directoriesFirst) { if (is1Directory && !is2Directory) { return -1; // ascending has no effect on the result (a directory is always first) so let's return } else if (is2Directory && !is1Directory) { return 1; // ascending has no effect on the result (a directory is always first) so let's return } + if ((foldersAlwaysAlphabetical) && (is1Directory && is2Directory)) + { + + diff = compareStrings(f1.getName(), f2.getName(), true); + if (diff == 0) { + // Case-sensitive name comparison + diff = compareStrings(f1.getName(), f2.getName(), false); + } + return (int) diff; + } // At this point, either both files are directories or none of them are } - long diff; if (criterion == SIZE_CRITERION) { // Consider that directories have a size of 0 diff --git a/src/main/com/mucommander/conf/MuPreference.java b/src/main/com/mucommander/conf/MuPreference.java index fd5b579c1..46f702674 100644 --- a/src/main/com/mucommander/conf/MuPreference.java +++ b/src/main/com/mucommander/conf/MuPreference.java @@ -59,6 +59,7 @@ public enum MuPreference { AUTO_SIZE_COLUMNS(MuPreferences.AUTO_SIZE_COLUMNS), USE_SYSTEM_FILE_ICONS(MuPreferences.USE_SYSTEM_FILE_ICONS), SHOW_FOLDERS_FIRST(MuPreferences.SHOW_FOLDERS_FIRST), + FOLDERS_ALWAYS_ALPHABETICAL(MuPreferences.FOLDERS_ALWAYS_ALPHABETICAL), SHOW_QUICK_SEARCH_MATCHES_FIRST(MuPreferences.SHOW_QUICK_SEARCH_MATCHES_FIRST), QUICK_SEARCH_TIMEOUT(MuPreferences.QUICK_SEARCH_TIMEOUT), CD_FOLLOWS_SYMLINKS(MuPreferences.CD_FOLLOWS_SYMLINKS), diff --git a/src/main/com/mucommander/conf/MuPreferences.java b/src/main/com/mucommander/conf/MuPreferences.java index d7065110f..b3ca47861 100644 --- a/src/main/com/mucommander/conf/MuPreferences.java +++ b/src/main/com/mucommander/conf/MuPreferences.java @@ -242,8 +242,12 @@ public class MuPreferences implements MuPreferencesAPI { public static final String DEFAULT_USE_SYSTEM_FILE_ICONS = FileIcons.USE_SYSTEM_ICONS_APPLICATIONS; /** Controls whether folders are displayed first in the FileTable or mixed with regular files. */ public static final String SHOW_FOLDERS_FIRST = FILE_TABLE_SECTION + '.' + "show_folders_first"; + /** Controls whether folders are always sorted alphabetical, doesn't matter which sort is set for the files. */ + public static final String FOLDERS_ALWAYS_ALPHABETICAL = FILE_TABLE_SECTION + '.' + "folders_always_alphabetical"; /** Default value for 'Show folders first' option. */ public static final boolean DEFAULT_SHOW_FOLDERS_FIRST = true; + /** Default value for 'Folders always alphabetical' option. */ + public static final boolean DEFAULT_FOLDERS_ALWAYS_ALPHABETICAL = true; /** Controls whether symlinks should be followed when changing directory. */ public static final String CD_FOLLOWS_SYMLINKS = FILE_TABLE_SECTION + '.' + "cd_follows_symlinks"; /** Default value for 'Follow symlinks when changing directory' option. */ diff --git a/src/main/com/mucommander/ui/action/ActionManager.java b/src/main/com/mucommander/ui/action/ActionManager.java index 8cc3df1bd..14f587fe0 100644 --- a/src/main/com/mucommander/ui/action/ActionManager.java +++ b/src/main/com/mucommander/ui/action/ActionManager.java @@ -220,6 +220,7 @@ public static void registerActions() { registerAction(new ToggleOwnerColumnAction.Descriptor()); registerAction(new TogglePermissionsColumnAction.Descriptor()); registerAction(new ToggleShowFoldersFirstAction.Descriptor()); + registerAction(new ToggleFoldersAlwaysAlphabeticalAction.Descriptor()); registerAction(new ToggleSizeColumnAction.Descriptor()); registerAction(new ToggleStatusBarAction.Descriptor()); registerAction(new ToggleToolBarAction.Descriptor()); diff --git a/src/main/com/mucommander/ui/action/impl/ToggleFoldersAlwaysAlphabeticalAction.java b/src/main/com/mucommander/ui/action/impl/ToggleFoldersAlwaysAlphabeticalAction.java new file mode 100644 index 000000000..9120ff4ee --- /dev/null +++ b/src/main/com/mucommander/ui/action/impl/ToggleFoldersAlwaysAlphabeticalAction.java @@ -0,0 +1,74 @@ +/* + * This file is part of muCommander, http://www.mucommander.com + * Copyright (C) 2002-2012 Maxence Bernard + * + * muCommander is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * muCommander is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.mucommander.ui.action.impl; + +import com.mucommander.conf.MuConfigurations; +import com.mucommander.conf.MuPreference; +import com.mucommander.ui.action.AbstractActionDescriptor; +import com.mucommander.ui.action.ActionCategory; +import com.mucommander.ui.action.ActionDescriptor; +import com.mucommander.ui.action.MuAction; +import com.mucommander.ui.main.MainFrame; +import com.mucommander.ui.main.table.FileTable; + +import javax.swing.*; +import java.util.Map; + +/** + * This action toggles the 'Show folders first' option, which controls whether folders are displayed first in the + * FileTable or mixed with regular files. + * + * @author Maxence Bernard + */ +public class ToggleFoldersAlwaysAlphabeticalAction extends MuAction { + + ToggleFoldersAlwaysAlphabeticalAction(MainFrame mainFrame, Map properties) { + super(mainFrame, properties); + } + + @Override + public void performAction() { + FileTable activeTable = mainFrame.getActiveTable(); + boolean foldersAlwaysAlphabetical = !activeTable.getSortInfo().getFoldersAlwaysAlphabetical(); + activeTable.setFoldersAlwaysAlphabetical(foldersAlwaysAlphabetical); + MuConfigurations.getPreferences().setVariable(MuPreference.FOLDERS_ALWAYS_ALPHABETICAL, foldersAlwaysAlphabetical); + } + + @Override + public ActionDescriptor getDescriptor() { + return new Descriptor(); + } + + + public static final class Descriptor extends AbstractActionDescriptor { + public static final String ACTION_ID = "ToggleFoldersAlwaysAlphabetical"; + + public String getId() { return ACTION_ID; } + + public ActionCategory getCategory() { return ActionCategory.VIEW; } + + public KeyStroke getDefaultAltKeyStroke() { return null; } + + public KeyStroke getDefaultKeyStroke() { return null; } + + public MuAction createAction(MainFrame mainFrame, Map properties) { + return new ToggleFoldersAlwaysAlphabeticalAction(mainFrame, properties); + } + } +} diff --git a/src/main/com/mucommander/ui/main/menu/MainMenuBar.java b/src/main/com/mucommander/ui/main/menu/MainMenuBar.java index 0bebf8d97..481820b0d 100644 --- a/src/main/com/mucommander/ui/main/menu/MainMenuBar.java +++ b/src/main/com/mucommander/ui/main/menu/MainMenuBar.java @@ -87,6 +87,7 @@ public class MainMenuBar extends JMenuBar implements ActionListener, MenuListene private JCheckBoxMenuItem[] toggleColumnItems = new TCheckBoxMenuItem[Column.values().length]; private JCheckBoxMenuItem toggleToggleAutoSizeItem; private JCheckBoxMenuItem toggleShowFoldersFirstItem; + private JCheckBoxMenuItem toggleFoldersAlwaysAlphabeticalItem; private JCheckBoxMenuItem toggleShowHiddenFilesItem; private JCheckBoxMenuItem toggleTreeItem; private JCheckBoxMenuItem toggleSinglePanel; @@ -244,6 +245,7 @@ public MainMenuBar(MainFrame mainFrame) { viewMenu.add(new TMenuSeparator()); toggleShowFoldersFirstItem = MenuToolkit.addCheckBoxMenuItem(viewMenu, ActionManager.getActionInstance(ToggleShowFoldersFirstAction.Descriptor.ACTION_ID, mainFrame), menuItemMnemonicHelper); + toggleFoldersAlwaysAlphabeticalItem = MenuToolkit.addCheckBoxMenuItem(viewMenu, ActionManager.getActionInstance(ToggleFoldersAlwaysAlphabeticalAction.Descriptor.ACTION_ID, mainFrame), menuItemMnemonicHelper); toggleShowHiddenFilesItem = MenuToolkit.addCheckBoxMenuItem(viewMenu, ActionManager.getActionInstance(ToggleHiddenFilesAction.Descriptor.ACTION_ID, mainFrame), menuItemMnemonicHelper); toggleTreeItem = MenuToolkit.addCheckBoxMenuItem(viewMenu, ActionManager.getActionInstance(ToggleTreeAction.Descriptor.ACTION_ID, mainFrame), menuItemMnemonicHelper); toggleSinglePanel = MenuToolkit.addCheckBoxMenuItem(viewMenu, ActionManager.getActionInstance(ToggleSinglePanelAction.Descriptor.ACTION_ID, mainFrame), menuItemMnemonicHelper); @@ -464,7 +466,10 @@ public void menuSelected(MenuEvent e) { // Select the 'sort by' criterion currently in use in the active table sortByItems[activeTable.getSortInfo().getCriterion().ordinal()].setSelected(true); - toggleShowFoldersFirstItem.setSelected(activeTable.getSortInfo().getFoldersFirst()); + Boolean foldersFirst = activeTable.getSortInfo().getFoldersFirst(); + toggleShowFoldersFirstItem.setSelected(foldersFirst); + toggleFoldersAlwaysAlphabeticalItem.setEnabled(foldersFirst); + toggleFoldersAlwaysAlphabeticalItem.setSelected(foldersFirst && activeTable.getSortInfo().getFoldersAlwaysAlphabetical()); toggleShowHiddenFilesItem.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_HIDDEN_FILES, MuPreferences.DEFAULT_SHOW_HIDDEN_FILES)); toggleTreeItem.setSelected(activeTable.getFolderPanel().isTreeVisible()); toggleToggleAutoSizeItem.setSelected(mainFrame.isAutoSizeColumnsEnabled()); diff --git a/src/main/com/mucommander/ui/main/table/FileTable.java b/src/main/com/mucommander/ui/main/table/FileTable.java index 3095e9067..c03566aa1 100644 --- a/src/main/com/mucommander/ui/main/table/FileTable.java +++ b/src/main/com/mucommander/ui/main/table/FileTable.java @@ -692,12 +692,10 @@ public void setAutoSizeColumnsEnabled(boolean enabled) { } } - - /** * Controls whether folders are displayed first in this FileTable or mixed with regular files. * After calling this method, the table is refreshed to reflect the change. - * + * * @param enabled if true, folders are displayed before regular files. If false, files are mixed with directories. */ public void setFoldersFirst(boolean enabled) { @@ -707,6 +705,20 @@ public void setFoldersFirst(boolean enabled) { } } + /** + * Controls whether folders are sorted always alphabetical (if displayed first in this FileTable) + * After calling this method, the table is refreshed to reflect the change. + * + * @param enabled if true, folders are sorted alphabetical + */ + public void setFoldersAlwaysAlphabetical(boolean enabled) { + if (sortInfo.getFoldersAlwaysAlphabetical() != enabled) { + sortInfo.setFoldersAlwaysAlphabetical(enabled); + sortTable(); + } + } + + /** * Controls whether quick search matches are displayed first in this FileTable or mixed with other files. * @param enabled @@ -926,13 +938,18 @@ public int getPageRowIncrement() { * @param ascending true for ascending order, false for descending order * @param foldersFirst if true, folders are displayed before regular files. If false, files are mixed with directories. */ - private void sortBy(Column criterion, boolean ascending, boolean foldersFirst) { + private void sortBy(Column criterion, boolean ascending, boolean foldersFirst, boolean foldersAlwaysAlphabetical) { // If we're not changing the current sort values, abort. - if (criterion == sortInfo.getCriterion() && ascending == sortInfo.getAscendingOrder() && foldersFirst == sortInfo.getFoldersFirst()) { + if (criterion == sortInfo.getCriterion() + && ascending == sortInfo.getAscendingOrder() + && foldersFirst == sortInfo.getFoldersFirst() + && foldersAlwaysAlphabetical == sortInfo.getFoldersAlwaysAlphabetical() + ) { return; } sortInfo.setFoldersFirst(foldersFirst); + sortInfo.setFoldersAlwaysAlphabetical(foldersAlwaysAlphabetical); // Ignore the sort criterion and order if the corresponding column is not visible if (isColumnVisible(criterion)) { @@ -958,7 +975,7 @@ private void sortBy(Column criterion, boolean ascending, boolean foldersFirst) { * @param sortInfo the information to use to sort this table. */ public void sortBy(SortInfo sortInfo) { - sortBy(sortInfo.getCriterion(), sortInfo.getAscendingOrder(), sortInfo.getFoldersFirst()); + sortBy(sortInfo.getCriterion(), sortInfo.getAscendingOrder(), sortInfo.getFoldersFirst(), sortInfo.getFoldersAlwaysAlphabetical()); } @@ -970,7 +987,7 @@ public void sortBy(SortInfo sortInfo) { * @param ascending true for ascending order, false for descending order */ public void sortBy(Column criterion, boolean ascending) { - sortBy(criterion, ascending, sortInfo.getFoldersFirst()); + sortBy(criterion, ascending, sortInfo.getFoldersFirst(), sortInfo.getFoldersAlwaysAlphabetical()); } /** diff --git a/src/main/com/mucommander/ui/main/table/SortInfo.java b/src/main/com/mucommander/ui/main/table/SortInfo.java index d4485d0e2..fafd03566 100644 --- a/src/main/com/mucommander/ui/main/table/SortInfo.java +++ b/src/main/com/mucommander/ui/main/table/SortInfo.java @@ -42,6 +42,9 @@ public class SortInfo implements Cloneable { /** Should folders be displayed first, or mixed with regular files */ private boolean showFoldersFirst = MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_FOLDERS_FIRST, MuPreferences.DEFAULT_SHOW_FOLDERS_FIRST); + /** Should Folders also get sorted or alway alphabetical ... only possible if Folders First enabled */ + private boolean foldersAlwaysAlphabetical = MuConfigurations.getPreferences().getVariable(MuPreference.FOLDERS_ALWAYS_ALPHABETICAL, MuPreferences.DEFAULT_FOLDERS_ALWAYS_ALPHABETICAL); + private boolean showQuickSearchMatchesFirst = MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_QUICK_SEARCH_MATCHES_FIRST, MuPreferences.DEFAULT_SHOW_QUICK_SEARCH_MATCHES_FIRST); SortInfo() { @@ -93,6 +96,15 @@ public void setFoldersFirst(boolean showFoldersFirst) { this.showFoldersFirst = showFoldersFirst; } + /** + * Sets whether folders are currently sorted always alphabetical. + * + * @param foldersAlwaysAlphabetical true if folders are sorted always alphabetical + */ + public void setFoldersAlwaysAlphabetical(boolean foldersAlwaysAlphabetical) { + this.foldersAlwaysAlphabetical = foldersAlwaysAlphabetical; + } + /** * Returns true if folders are sorted and displayed before regular files, false if they * are mixed with regular files and sorted altogether. @@ -103,13 +115,22 @@ public boolean getFoldersFirst() { return showFoldersFirst; } + /** + * Returns true if folders are sorted always alphabetical + * + * @return true if folders are sorted always alphabetical + */ + public boolean getFoldersAlwaysAlphabetical() { + return foldersAlwaysAlphabetical; + } + /** * Sets whether matched files are currently sorted and displayed before other files or mixed with them on quick search. * - * @param showFoldersFirst true if matched are sorted and displayed before other files, false if they are mixed with regular files and sorted altogether + * @param quickSearchMatchesFirst true if matched are sorted and displayed before other files, false if they are mixed with regular files and sorted altogether */ - void setQuickSearchMatchesFirst(boolean showFoldersFirst) { - this.showQuickSearchMatchesFirst = showFoldersFirst; + void setQuickSearchMatchesFirst(boolean quickSearchMatchesFirst) { + this.showQuickSearchMatchesFirst = quickSearchMatchesFirst; } /** diff --git a/src/main/com/mucommander/ui/main/table/views/BaseFileTableModel.java b/src/main/com/mucommander/ui/main/table/views/BaseFileTableModel.java index 9af76f0ee..a0b9e6664 100644 --- a/src/main/com/mucommander/ui/main/table/views/BaseFileTableModel.java +++ b/src/main/com/mucommander/ui/main/table/views/BaseFileTableModel.java @@ -300,7 +300,7 @@ public synchronized void sortRows() { private FileComparator createFileComparator(SortInfo sortInfo) { QuickSearch qs = quickSearch != null && quickSearch.isActive() && sortInfo.getQuickSearchMatchesFirst() ? quickSearch : null; return new FileComparator(sortInfo.getCriterion().getFileComparatorCriterion(), sortInfo.getAscendingOrder(), - sortInfo.getFoldersFirst(), qs); + sortInfo.getFoldersFirst(), sortInfo.getFoldersAlwaysAlphabetical(), qs); } diff --git a/src/main/com/mucommander/ui/main/tree/FoldersTreePanel.java b/src/main/com/mucommander/ui/main/tree/FoldersTreePanel.java index 92ea749c1..be0f7626e 100644 --- a/src/main/com/mucommander/ui/main/tree/FoldersTreePanel.java +++ b/src/main/com/mucommander/ui/main/tree/FoldersTreePanel.java @@ -109,7 +109,7 @@ public FoldersTreePanel(FolderPanel folderPanel) { new ConfigurableFolderFilter() ); - FileComparator sort = new FileComparator(FileComparator.NAME_CRITERION, true, true); + FileComparator sort = new FileComparator(FileComparator.NAME_CRITERION, true, true, false); model = new FilesTreeModel(treeFileFilter, sort); tree = new JTree(model); tree.setFont(ThemeCache.tableFont); diff --git a/src/test/com/mucommander/commons/file/util/FileComparatorTest.java b/src/test/com/mucommander/commons/file/util/FileComparatorTest.java index bd10d106a..69e64f095 100644 --- a/src/test/com/mucommander/commons/file/util/FileComparatorTest.java +++ b/src/test/com/mucommander/commons/file/util/FileComparatorTest.java @@ -37,7 +37,7 @@ protected void setUp() throws Exception { @Test public void testCompareNameDir() { - Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, true, true)); + Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, true, false,true)); assert B.equals(files[0]); assert D.equals(files[1]); assert A.equals(files[2]); @@ -46,7 +46,7 @@ public void testCompareNameDir() { @Test public void testCompareNameDirDesc() { - Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, false, true)); + Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, false, false,true)); assert D.equals(files[0]); assert B.equals(files[1]); assert C.equals(files[2]); @@ -55,7 +55,7 @@ public void testCompareNameDirDesc() { @Test public void testCompareName() { - Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, true, false)); + Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, true, false,false)); assert A.equals(files[0]); assert B.equals(files[1]); assert C.equals(files[2]); @@ -64,7 +64,7 @@ public void testCompareName() { @Test public void testCompareNameDesc() { - Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, false, false)); + Arrays.sort(files, new FileComparator(FileComparator.NAME_CRITERION, false, false,false)); assert D.equals(files[0]); assert C.equals(files[1]); assert B.equals(files[2]); @@ -73,7 +73,7 @@ public void testCompareNameDesc() { @Test public void testCompareSizeDir() { - Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, true, true)); + Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, true, false,true)); assert B.equals(files[0]); assert D.equals(files[1]); assert C.equals(files[2]); @@ -82,7 +82,7 @@ public void testCompareSizeDir() { @Test public void testCompareSize() { - Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, true, false)); + Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, true, false,false)); assert B.equals(files[0]); assert D.equals(files[1]); assert C.equals(files[2]); @@ -91,7 +91,7 @@ public void testCompareSize() { @Test public void testCompareSizeDirDesc() { - Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, false, true)); + Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, false, false,true)); assert D.equals(files[0]); assert B.equals(files[1]); assert A.equals(files[2]); @@ -100,7 +100,7 @@ public void testCompareSizeDirDesc() { @Test public void testCompareSizeDesc() { - Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, false, false)); + Arrays.sort(files, new FileComparator(FileComparator.SIZE_CRITERION, false, false,false)); assert A.equals(files[0]); assert C.equals(files[1]); assert D.equals(files[2]); @@ -109,7 +109,7 @@ public void testCompareSizeDesc() { @Test public void testCompareDateDir() { - Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, true, true)); + Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, true, false,true)); assert B.equals(files[0]); assert D.equals(files[1]); assert A.equals(files[2]); @@ -118,7 +118,7 @@ public void testCompareDateDir() { @Test public void testCompareDate() { - Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, true, false)); + Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, true, false,false)); assert A.equals(files[0]); assert B.equals(files[1]); assert C.equals(files[2]); @@ -127,7 +127,7 @@ public void testCompareDate() { @Test public void testCompareDateDirDesc() { - Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, false, true)); + Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, false, false,true)); assert D.equals(files[0]); assert B.equals(files[1]); assert C.equals(files[2]); @@ -136,7 +136,7 @@ public void testCompareDateDirDesc() { @Test public void testCompareDateDesc() { - Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, false, false)); + Arrays.sort(files, new FileComparator(FileComparator.DATE_CRITERION, false, false,false)); assert D.equals(files[0]); assert C.equals(files[1]); assert B.equals(files[2]); @@ -145,7 +145,7 @@ public void testCompareDateDesc() { @Test public void testCompareExtDir() { - Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, true, true)); + Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, true, false,true)); assert B.equals(files[0]); assert D.equals(files[1]); assert A.equals(files[2]); @@ -154,7 +154,7 @@ public void testCompareExtDir() { @Test public void testCompareExt() { - Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, true, false)); + Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, true, false,false)); assert A.equals(files[0]); assert B.equals(files[1]); assert D.equals(files[2]); @@ -163,7 +163,7 @@ public void testCompareExt() { @Test public void testCompareExtDirDesc() { - Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, false, true)); + Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, false, false,true)); assert D.equals(files[0]); assert B.equals(files[1]); assert C.equals(files[2]); @@ -172,7 +172,7 @@ public void testCompareExtDirDesc() { @Test public void testCompareExtDesc() { - Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, false, false)); + Arrays.sort(files, new FileComparator(FileComparator.EXTENSION_CRITERION, false, false,false)); assert C.equals(files[0]); assert D.equals(files[1]); assert B.equals(files[2]);