Package com.mucommander.commons.file.util

Examples of com.mucommander.commons.file.util.FileComparator


        AndFileFilter treeFileFilter = new AndFileFilter(
            new AttributeFileFilter(FileAttribute.DIRECTORY),
            new ConfigurableFolderFilter()
        );

        FileComparator sort = new FileComparator(FileComparator.NAME_CRITERION, true, true);
        model = new FilesTreeModel(treeFileFilter, sort);
        tree = new JTree(model);
    tree.setFont(ThemeCache.tableFont);
        tree.setBackground(ThemeCache.backgroundColors[ThemeCache.INACTIVE][ThemeCache.NORMAL]);
View Full Code Here


        // complexity is reduced to O(log n) instead of O(n^2)
        int left = parent==null?0:1;
        int right = getRowCount()-1;
        int mid;
        AbstractFile midFile;
        FileComparator fc = getFileComparator(sortInfo);

        while(left<=right) {
            mid = (right-left)/2 + left;
            midFile = getCachedFileAtRow(mid);
            if(midFile.equals(file))
                return mid;
            if(fc.compare(file, midFile)<0)
                right = mid-1;
            else
                left = mid+1;
        }
   
View Full Code Here

    //////////////////
    // Sort methods //
    //////////////////

    private static FileComparator getFileComparator(SortInfo sortInfo) {
        return new FileComparator(sortInfo.getCriterion().getFileComparatorCriterion(), sortInfo.getAscendingOrder(), sortInfo.getFoldersFirst());
    }
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.util.FileComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.