Package org.apache.myfaces.trinidad.model

Examples of org.apache.myfaces.trinidad.model.SortCriterion


         String[] tokens = COMMA.split(sql.trim());
         List<SortCriterion> criteria = new ArrayList<SortCriterion>(tokens.length);
         for (int i = 0; i != tokens.length; i++)
         {
            String[] terms = SPACE.split(tokens[i].trim());
            SortCriterion sortCriterion = new SortCriterion(terms[0], terms.length == 1 ? false : "ASC".equalsIgnoreCase(terms[1]));
            criteria.add(i, sortCriterion);
         }
         return criteria;
      }
      return new ArrayList<SortCriterion>();
View Full Code Here


                assert artists instanceof CollectionModel;
                CollectionModel collectionModel = (CollectionModel) artists;
               
                // Reorder the list              
                List<SortCriterion> criteria = new ArrayList<SortCriterion>();
                criteria.add(new SortCriterion("artist.name", true));
                collectionModel.setSortCriteria(criteria);
               
                // Check for correct ordering
                assertArtist(collectionModel, 5, ARTIST5_NAME);
                assertArtist(collectionModel, 4, ARTIST6_NAME);
View Full Code Here

    Map<String, String> parameters)
  {
    String property = parameters.get(XhtmlConstants.VALUE_PARAM);
    Object state = parameters.get(XhtmlConstants.STATE_PARAM);
    boolean sortOrder = !XhtmlConstants.SORTABLE_ASCENDING.equals(state);
    SortCriterion criterion = new SortCriterion(property, sortOrder);

    SortEvent event =
      new SortEvent(table, Collections.singletonList(criterion));
    event.queue();
  }
View Full Code Here

    UIXCollection table = (UIXCollection) tContext.getTable();
    List<SortCriterion> criteria = table.getSortCriteria();
    // We currently only show anything for the primary sort criterion
    if (criteria.size() > 0)
    {
      SortCriterion criterion = criteria.get(0);
      if (property.equals(criterion.getProperty()))
      {
        return criterion.isAscending() ? SORT_ASCENDING : SORT_DESCENDING;
      }
    }

    return table.isSortable(property) ? SORT_SORTABLE : SORT_NO;
  }
View Full Code Here

    UIXCollection table = (UIXCollection) tContext.getTable();
    List<SortCriterion> criteria = table.getSortCriteria();
    // We currently only show anything for the primary sort criterion
    if (criteria.size() > 0)
    {
      SortCriterion criterion = criteria.get(0);
      if (property.equals(criterion.getProperty()))
      {
        return criterion.isAscending() ? SORT_ASCENDING : SORT_DESCENDING;
      }
    }

    return table.isSortable(property) ? SORT_SORTABLE : SORT_NO;
  }
View Full Code Here

    Map<String, String> parameters)
  {
    String property = parameters.get(XhtmlConstants.VALUE_PARAM);
    Object state = parameters.get(XhtmlConstants.STATE_PARAM);
    boolean sortOrder = !XhtmlConstants.SORTABLE_ASCENDING.equals(state);
    SortCriterion criterion = new SortCriterion(property, sortOrder);

    SortEvent event =
      new SortEvent(table, Collections.singletonList(criterion));
    event.queue();
  }
View Full Code Here

    UIXCollection table = (UIXCollection) tContext.getTable();
    List<SortCriterion> criteria = table.getSortCriteria();
    // We currently only show anything for the primary sort criterion
    if (criteria.size() > 0)
    {
      SortCriterion criterion = criteria.get(0);
      if (property.equals(criterion.getProperty()))
      {
        return criterion.isAscending() ? SORT_ASCENDING : SORT_DESCENDING;
      }
    }

    return table.isSortable(property) ? SORT_SORTABLE : SORT_NO;
  }
View Full Code Here

    Map<String, String> parameters)
  {
    String property = parameters.get(TrinidadRenderingConstants.VALUE_PARAM);
    Object state = parameters.get(TrinidadRenderingConstants.STATE_PARAM);
    boolean sortOrder = !TrinidadRenderingConstants.SORTABLE_ASCENDING.equals(state);
    SortCriterion criterion = new SortCriterion(property, sortOrder);

    SortEvent event =
      new SortEvent(table, Collections.singletonList(criterion));
    event.queue();
  }
View Full Code Here

    Map<String, String> parameters)
  {
    String property = parameters.get(XhtmlConstants.VALUE_PARAM);
    Object state = parameters.get(XhtmlConstants.STATE_PARAM);
    boolean sortOrder = !XhtmlConstants.SORTABLE_ASCENDING.equals(state);
    SortCriterion criterion = new SortCriterion(property, sortOrder);

    SortEvent event =
      new SortEvent(table, Collections.singletonList(criterion));
    event.queue();
  }
View Full Code Here

  {
    String property = parameters.get(XhtmlConstants.VALUE_PARAM);
    Object state = parameters.get(XhtmlConstants.STATE_PARAM);
    boolean sortOrder = !XhtmlConstants.SORTABLE_ASCENDING.equals(state);
    SortStrength sortStrength = TableUtils.findSortStrength(table, property);
    SortCriterion criterion = new SortCriterion(property, sortOrder, sortStrength);

    SortEvent event =
      new SortEvent(table, Collections.singletonList(criterion));
    event.queue();
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.model.SortCriterion

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.