/**
 * Created on Jul 24, 2005
 * $id:  $
 */
package org.jvnet.lookout.ui.core.tree.sort.item;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.jvnet.lookout.ui.core.tree.SearchResultItem;
import org.jvnet.lookout.ui.core.tree.sort.SearchResultItemSorter;

/**
 * <code>AlphabeticalSorter</code> sorts SearchResultItem 
 * instances alphabetically. It makes no use of categories.
 * 
 * <p>
 * @author Cleo Barretto
 *
 */
public class AlphabeticalSorter extends ViewerSorter implements SearchResultItemSorter {

    /**
     * Returns SearchResultItem in alphabetical order as defined in the ViewerSorter description.
     *  
     * @see org.jvnet.lookout.ui.core.tree.sort.SearchResultItemSorter#compare(org.eclipse.jface.viewers.Viewer, org.jvnet.lookout.ui.core.tree.SearchResultItem, org.jvnet.lookout.ui.core.tree.SearchResultItem)
     */
    public int compare(Viewer viewer, SearchResultItem item1, SearchResultItem item2) {
        return super.compare(viewer, item1, item2);
    }

    /**
     * Makes no use of categories. So all items use the same unique category.
     * 
     * @see org.jvnet.lookout.ui.core.tree.sort.SearchResultItemSorter#category(org.jvnet.lookout.ui.core.tree.SearchResultItem)
     */
    public int category(SearchResultItem item) {
        return 0;
    }
}
