Package org.richfaces.model

Examples of org.richfaces.model.Ordering


   
    for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
      SortField2 field = iterator.next();
      Expression expression = field.getExpression();
      String prop = expression.getExpressionString();
      Ordering ordering = field.getOrdering();
      if (ordering != null) {
        Object p1 = w1.getProperty(prop);
        Object p2 = w2.getProperty(prop);
        if (p1 == p2 && p1 instanceof Comparator) {
          result = ((Comparator<Object>)p1).compare(w1.getWrappedObject(), w2.getWrappedObject());
        } else if (p1 instanceof String && p2 instanceof String) {
          if (stringComparator == null) {
            stringComparator = createStringComparator();
          }
          result = stringComparator.compare(((String)p1).trim(), ((String)p2).trim());
        } else if (p1 instanceof Comparable && p2 instanceof Comparable) {
          result = ((Comparable<Object>) p1).compareTo(p2);
        } else if (p1 == null && p2 != null) {
          result = 1;
        } else if (p2 == null && p1 != null) {
          result = -1;
        }
       
        if (ordering.equals(Ordering.DESCENDING)) {
          result = -result;
        }
      }
     
    }
View Full Code Here


  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

        } else if (!name.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
          valueExpression = expressionFactory.createValueExpression(
              eLContext, "#{" + var + "." + name + "}",
              Object.class);
        }
        Ordering ordering = Ordering.UNSORTED;
        Boolean ascending = sortField.getAscending();
        if (ascending != null) {
          if (ascending) {
            ordering = Ordering.ASCENDING;
          } else {
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

  }
 
  public Ordering getSortOrder(){
    ValueExpression ve = getValueExpression("sortOrder");
    if (ve != null) {
        Ordering value = null;
        try {
        value = (Ordering) ve.getValue(getFacesContext().getELContext());
        } catch (ELException e) {
        throw new FacesException(e);
        }
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

TOP

Related Classes of org.richfaces.model.Ordering

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.