Package org.openfaces.component.filter

Examples of org.openfaces.component.filter.FilterCriterion


    private void setFilteringCriteriaToRequestVariable() {
        List<FilterCriterion> criteria = new ArrayList<FilterCriterion>();
        AndFilterCriterion andCriterion = new AndFilterCriterion(criteria);
        if (filters != null)
            for (Filter filter : filters) {
                FilterCriterion filterCriterion = (FilterCriterion) filter.getValue();
                if (filterCriterion == null || filterCriterion.acceptsAll())
                    continue;

                criteria.add(filterCriterion);
            }
        Components.setRequestVariable(VAR_FILTER_CRITERIA, andCriterion);
View Full Code Here


                ? ((RowInfo) rowObj).getRowData() // RowInfo for DataTable (for storing original row indexes)
                : rowObj; // row data object for TreeTable (for there's no notion of index in TreeTable)
        boolean rowAccepted = true;
        for (int filterIndex = 0, filterCount = filters.size(); filterIndex < filterCount; filterIndex++) {
            Filter filter = filters.get(filterIndex);
            FilterCriterion filterValue = (FilterCriterion) filter.getValue();

            Predicate predicate = filterValue != null ? PredicateBuilder.build(filterValue) : null;
            boolean filterAcceptsData = predicate == null || predicate.evaluate(data);
            if (!filterAcceptsData)
                rowAccepted = false;
View Full Code Here

        return result;
    }

    public List<User> getFilteredUsersForStoredCriterion() throws JSONException {
        String jsonCriteria = getJsonCriteria();
        FilterCriterion storedCriteria = JSONBuilder.getInstance().parse(new JSONObject(jsonCriteria));
        Predicate predicate = PredicateBuilder.build(storedCriteria);
        ArrayList<User> result = new ArrayList<User>(users);
        CollectionUtils.filter(result, predicate);
        return result;
    }
View Full Code Here

    }

    private String getFilterCriteriaQueryText(CompositeFilterCriterion filterCriteria) {
        StringBuffer buf = new StringBuffer();
        for (Iterator<FilterCriterion> it = filterCriteria.getCriteria().iterator(); it.hasNext();) {
            FilterCriterion c = it.next();
            ExpressionFilterCriterion criterion = (ExpressionFilterCriterion) c;
            String filterId = criterion.getExpressionStr();

            String text = criterion.getArg1().toString();
            String criterionText = filterId + " CONTAINS \"" + text + "\"";
View Full Code Here

TOP

Related Classes of org.openfaces.component.filter.FilterCriterion

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.