Package org.richfaces.model

Examples of org.richfaces.model.SortField2


  @SuppressWarnings("unchecked")
  private int compare(JavaBeanWrapper w1, JavaBeanWrapper w2) {
    int result = 0;
   
    for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
      SortField2 field = iterator.next();
      Expression expression = field.getExpression();
      Ordering ordering = field.getOrdering();
      if (ordering != null) {
        Object p1 = w1.getProperty(expression);
        Object p2 = w2.getProperty(expression);
        if (p1 == p2 && p1 instanceof Comparator) {
          result = ((Comparator<Object>)p1).compare(w1.getWrappedObject(), w2.getWrappedObject());
View Full Code Here


        UIColumn column = (UIColumn) component;
        FilterField filterField = column.getFilterField();
        if (filterField != null) {
          filterFields.add(filterField);
        }
        SortField2 sortField = column.getSortField();
        if (sortField != null) {
          sortFieldsMap.put(component.getId(), sortField);
        }
      }

    }
    List<SortField2> sortFields = new LinkedList<SortField2>();
   
    if (sortPriority != null) {
      for (Object object : sortPriority) {
        if (object instanceof String) {
          String id = (String) object;
          SortField2 sortField = sortFieldsMap.get(id);
          if (sortField != null) {
            sortFields.add(sortField);
            sortFieldsMap.remove(id);
          }
        }
View Full Code Here

            ordering = Ordering.DESCENDING;
          }
        }
        if (valueExpression != null
            && !Ordering.UNSORTED.equals(ordering)) {
          sortFields2.add(new SortField2(valueExpression, ordering));
        }
      }
    }
    return sortFields2;
 
View Full Code Here

        if(column.isRendered()){
          FilterField filterField = column.getFilterField();
          if (filterField != null) {
            filterFields.add(filterField);
          }
          SortField2 sortField = column.getSortField();
          if (sortField != null) {
            sortFieldsMap.put(component.getId(), sortField);
          }
        }
      }
    }
    List<SortField2> sortFields = new LinkedList<SortField2>();
    Collection<Object> sortPriority = getSortPriority();
    if (sortPriority != null) {
      for (Object object : sortPriority) {
        if (object instanceof String) {
          String id = (String) object;
          SortField2 sortField = sortFieldsMap.get(id);
          if (sortField != null) {
            sortFields.add(sortField);
            sortFieldsMap.remove(id);
          }
        }
View Full Code Here

    }
    return filterField;
  }

  public SortField2 getSortField(){
    SortField2 sortField2 = null;
    if (!Ordering.UNSORTED.equals(getSortOrder())) {
      ValueExpression comparator = getValueExpression("comparator");
      ValueExpression sortBy = getValueExpression("sortBy");
      if (comparator != null) {
        sortField2 = new SortField2(comparator, getSortOrder());
      } else if (sortBy != null) {
        sortField2 = new SortField2(sortBy, getSortOrder());
      }
    }
    return sortField2;
  }
View Full Code Here

        org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
        FilterField filterField = column.getFilterField();
        if (filterField != null) {
          filterFields.add(filterField);
        }
        SortField2 sortField = column.getSortField();
        if (sortField != null) {
          sortFieldsMap.put(component.getId(), sortField);
        }
      }
     
    }
    List<SortField2> sortFields = new LinkedList<SortField2>();
    Collection<Object> sortPriority = getSortPriority();
    if (sortPriority != null) {
      for (Object object : sortPriority) {
        if (object instanceof String) {
          String id = (String) object;
          SortField2 sortField = sortFieldsMap.get(id);
          if (sortField != null) {
            sortFields.add(sortField);
            sortFieldsMap.remove(id);
          }
        }
View Full Code Here

    }
    return filterField;
  }

  public SortField2 getSortField(){
    SortField2 sortField2 = null;
    if (!Ordering.UNSORTED.equals(getSortOrder())) {
      ValueExpression comparator = getValueExpression("comparator");
      ValueExpression sortBy = getValueExpression("sortBy");
      if (comparator != null) {
        sortField2 = new SortField2(comparator, getSortOrder());
      } else if (sortBy != null) {
        sortField2 = new SortField2(sortBy, getSortOrder());
      }
    }
    return sortField2;
  }
View Full Code Here

TOP

Related Classes of org.richfaces.model.SortField2

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.