Package com.ponysdk.core.query

Examples of com.ponysdk.core.query.SortingType


    public static <T> List<T> sort(List<T> datas, List<Criterion> criteria) {
        if (criteria == null) return datas;

        for (final Criterion criterion : criteria) {
            final SortingType sortingType = criterion.getSortingType();
            if (sortingType != null && sortingType != SortingType.NONE) {
                final Comparator<T> comparator = new Comparator<T>() {

                    @Override
                    public int compare(T o1, T o2) {
View Full Code Here


    public static List<String> sortStringCollection(List<String> datas, List<Criterion> criteria) {
        if (criteria == null) return datas;

        for (final Criterion criterion : criteria) {
            final SortingType sortingType = criterion.getSortingType();
            if (sortingType != null && sortingType != SortingType.NONE) {
                final Comparator<String> comparator = new Comparator<String>() {

                    @Override
                    public int compare(String o1, String o2) {
View Full Code Here

        title.addStyleName(PonySDKTheme.COMPLEXLIST_HEADERCELLRENDERER_COMPLEX_SORTABLE);
        title.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final SortingType nextSortingType = HeaderSortingHelper.getNextSortingType(sortingType);
                sort(nextSortingType);
            }
        });
    }
View Full Code Here

import com.ponysdk.impl.theme.PonySDKTheme;

public class HeaderSortingHelper {

    public static SortingType getNextSortingType(final SortingType sortingType) {
        SortingType newSortingType;

        if (sortingType == SortingType.NONE) newSortingType = SortingType.ASCENDING;
        else if (sortingType == SortingType.DESCENDING) newSortingType = SortingType.ASCENDING;
        else if (sortingType == SortingType.ASCENDING) newSortingType = SortingType.DESCENDING;
        else newSortingType = SortingType.NONE;
View Full Code Here

        caption.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                caption.addStyleName(HeaderSortingHelper.getAssociatedStyleName(sortingType));
                final SortingType nextSortingType = HeaderSortingHelper.getNextSortingType(sortingType);
                sort(nextSortingType);
                caption.addStyleName(HeaderSortingHelper.getAssociatedStyleName(nextSortingType));

                for (final FilterListener filterListener : filterListeners) {
                    filterListener.onSort(ComplexHeaderCellRenderer.this);
View Full Code Here

TOP

Related Classes of com.ponysdk.core.query.SortingType

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.