Examples of SortStrategy


Examples of org.apache.beehive.netui.databinding.datagrid.api.sort.SortStrategy

     *         sort expression
     */
    public Map buildSortQueryParamsMap(String sortExpression) {

        SortModel sortModel = getDataGridState().getSortModel();
        SortStrategy sortStrategy = sortModel.getSortStrategy();

        List currSorts = sortModel.getSorts();
        ArrayList newSorts = new ArrayList();
        if(currSorts == null || currSorts.size() == 0) {
            Sort sort = new Sort();
            sort.setSortExpression(sortExpression);
            sort.setDirection(sortStrategy.getDefaultDirection());
            newSorts.add(sort);
        }
        else {
            boolean foundSort = false;
            for(int i = 0; i < currSorts.size(); i++) {
                Sort sort = (Sort)currSorts.get(i);
                if(!sort.getSortExpression().equals(sortExpression)) {
                    newSorts.add(sort);
                }
                else {
                    Sort newSort = new Sort();
                    newSort.setSortExpression(sortExpression);
                    newSort.setDirection(sortStrategy.nextDirection(sort.getDirection()));
                    newSorts.add(newSort);
                    foundSort = true;
                }
            }
            if(!foundSort) {
                Sort newSort = new Sort();
                newSort.setSortExpression(sortExpression);
                newSort.setDirection(sortStrategy.getDefaultDirection());
                newSorts.add(newSort);
            }
        }

        Map params = _codec.getExistingParams();
View Full Code Here

Examples of org.apache.beehive.netui.databinding.datagrid.api.sort.SortStrategy

     *         sort expression
     */
    public Map buildSortQueryParamsMap(String sortExpression) {

        SortModel sortModel = getDataGridState().getSortModel();
        SortStrategy sortStrategy = sortModel.getSortStrategy();

        List currSorts = sortModel.getSorts();
        ArrayList newSorts = new ArrayList();
        if(currSorts == null || currSorts.size() == 0) {
            Sort sort = new Sort();
            sort.setSortExpression(sortExpression);
            sort.setDirection(sortStrategy.getDefaultDirection());
            newSorts.add(sort);
        }
        else {
            boolean foundSort = false;
            for(int i = 0; i < currSorts.size(); i++) {
                Sort sort = (Sort)currSorts.get(i);
                if(!sort.getSortExpression().equals(sortExpression)) {
                    newSorts.add(sort);
                }
                else {
                    Sort newSort = new Sort();
                    newSort.setSortExpression(sortExpression);
                    newSort.setDirection(sortStrategy.nextDirection(sort.getDirection()));
                    newSorts.add(newSort);
                    foundSort = true;
                }
            }
            if(!foundSort) {
                Sort newSort = new Sort();
                newSort.setSortExpression(sortExpression);
                newSort.setDirection(sortStrategy.getDefaultDirection());
                newSorts.add(newSort);
            }
        }

        Map params = _codec.getExistingParams();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.