Package org.richfaces.model.impl.expressive

Examples of org.richfaces.model.impl.expressive.ObjectWrapperFactory


  protected List<Object> filter(List<FilterField> filterFields) {
    if (filterFields != null && !filterFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      List <Object> filteredCollection = new ArrayList<Object>();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(context, var, filterFields);
     
      WrappedBeanFilter wrappedBeanFilter = new WrappedBeanFilter(filterFields, locale);
      wrapperFactory.wrapList(rowKeys);
      for (Object object : rowKeys) {
        if(wrappedBeanFilter.accept((JavaBeanWrapper)object)) {
          filteredCollection.add(object);
        }
      }
      rowKeys = filteredCollection;
      wrapperFactory.unwrapList(rowKeys);
    }
    return rowKeys;
  }
View Full Code Here


  }

  protected void sort(List<SortField2> sortFields) {
    if (sortFields != null && !sortFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(
          context, var, sortFields);
     
      WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
        sortFields, locale);
      wrapperFactory.wrapList(rowKeys);
      Collections.sort(rowKeys, wrappedBeanComparator);
      wrapperFactory.unwrapList(rowKeys);
    }
  }
View Full Code Here

        // get group field which is actually the first from sort fields
        List<SortField2> groupFields = new ArrayList<SortField2>();
        if (!sortFields.isEmpty())
            groupFields.add(sortFields.get(0));
        // create wrapper factory
        ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(context,
                table.getVar(), groupFields);
        // create wrapper for last data
        JavaBeanWrapper wrappedLstD = wrapperFactory.wrapObject(holder
                .getLastData());
        // create wrapper for current data
        JavaBeanWrapper wrappedActD = wrapperFactory.wrapObject(table
                .getRowData());
        // create comparator
        WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
                (groupFields));
        // compare last and current data
View Full Code Here

   * @param sortOrder
   * @return
   */
  protected List prepareCollection(FacesContext context, List collection, SortOrder sortOrder) {
   
    ObjectWrapperFactory factory = new ObjectWrapperFactory(context, var, sortOrder);
    final SortField [] fields = sortOrder.getFields();

   
    factory.wrapList(collection);

    Collections.sort(collection, new WrappedBeanComparator(fields));
   
    factory.unwrapList(collection);
   
   
    return collection;
  }
View Full Code Here

        // get group field which is actually the first from sort fields
        List<SortField2> groupFields = new ArrayList<SortField2>();
        if (!sortFields.isEmpty())
            groupFields.add(sortFields.get(0));
        // create wrapper factory
        ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(context,
                table.getVar(), groupFields);
        // create wrapper for last data
        JavaBeanWrapper wrappedLstD = wrapperFactory.wrapObject(holder
                .getLastData());
        // create wrapper for current data
        JavaBeanWrapper wrappedActD = wrapperFactory.wrapObject(table
                .getRowData());
        // create comparator
        WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
                (groupFields));
        // compare last and current data
View Full Code Here

  protected List<Object> filter(List<FilterField> filterFields) {
    if (filterFields != null && !filterFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      List <Object> filteredCollection = new ArrayList<Object>();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(context, var, filterFields);

      WrappedBeanFilter wrappedBeanFilter = new WrappedBeanFilter(filterFields, locale);
      wrapperFactory.wrapList(rowKeys);
      for (Object object : rowKeys) {
        if(wrappedBeanFilter.accept((JavaBeanWrapper)object)) {
          filteredCollection.add(object);
        }
      }
      rowKeys = filteredCollection;
      wrapperFactory.unwrapList(rowKeys);
    }
    return rowKeys;
  }
View Full Code Here

  }

  protected void sort(List<SortField2> sortFields) {
    if (sortFields != null && !sortFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(
          context, var, sortFields);

      WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
        sortFields, locale);
      wrapperFactory.wrapList(rowKeys);
      Collections.sort(rowKeys, wrappedBeanComparator);
      wrapperFactory.unwrapList(rowKeys);
    }
  }
View Full Code Here

        // get group field which is actually the first from sort fields
        List<SortField2> groupFields = new ArrayList<SortField2>();
        if (!sortFields.isEmpty())
            groupFields.add(sortFields.get(0));
        // create wrapper factory
        ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(context,
                table.getVar(), groupFields);
        // create wrapper for last data
        JavaBeanWrapper wrappedLstD = wrapperFactory.wrapObject(holder
                .getLastData());
        // create wrapper for current data
        JavaBeanWrapper wrappedActD = wrapperFactory.wrapObject(table
                .getRowData());
        // create comparator
        WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
                (groupFields));
        // compare last and current data
View Full Code Here

  private List<Object> filter(List<FilterField> filterFields) {
    if (filterFields != null && !filterFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      List <Object> filteredCollection = new ArrayList<Object>();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(context, var, filterFields);
      WrappedBeanFilter wrappedBeanFilter = new WrappedBeanFilter(filterFields);
      wrapperFactory.wrapList(rowKeys);
      for (Object object : rowKeys) {
        if(wrappedBeanFilter.accept((JavaBeanWrapper)object)) {
          filteredCollection.add(object);
        }
      }
      rowKeys = filteredCollection;
      wrapperFactory.unwrapList(rowKeys);
    }
    return rowKeys;
  }
View Full Code Here

  }

  private void sort(List<SortField2> sortFields) {
    if (sortFields != null && !sortFields.isEmpty()) {
      FacesContext context = FacesContext.getCurrentInstance();
      ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(
          context, var, sortFields);
      WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
          sortFields);
      wrapperFactory.wrapList(rowKeys);
      Collections.sort(rowKeys, wrappedBeanComparator);
      wrapperFactory.unwrapList(rowKeys);
    }
  }
View Full Code Here

TOP

Related Classes of org.richfaces.model.impl.expressive.ObjectWrapperFactory

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.