Search in sources :

Example 1 with IUiFilter

use of org.jowidgets.cap.ui.api.filter.IUiFilter in project jo-client-platform by jo-source.

the class BeanRelationNodeModelImpl method getFilter.

private IFilter getFilter() {
    final IFilter addedDataFilter = getAddedDataFilter();
    if (filters.size() > 0 || addedDataFilter != null) {
        final IBooleanFilterBuilder builder = CapCommonToolkit.filterFactory().booleanFilterBuilder();
        builder.setOperator(BooleanOperator.AND);
        final IUiFilterFactory filterFactory = CapUiToolkit.filterToolkit().filterFactory();
        for (final IUiFilter uiFilter : filters.values()) {
            builder.addFilter(filterFactory.convert(uiFilter));
        }
        if (addedDataFilter != null) {
            builder.addFilter(addedDataFilter);
        }
        return builder.build();
    } else {
        return addedDataFilter;
    }
}
Also used : IBooleanFilterBuilder(org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder) IUiFilterFactory(org.jowidgets.cap.ui.api.filter.IUiFilterFactory) IFilter(org.jowidgets.cap.common.api.filter.IFilter) IUiFilter(org.jowidgets.cap.ui.api.filter.IUiFilter)

Example 2 with IUiFilter

use of org.jowidgets.cap.ui.api.filter.IUiFilter in project jo-client-platform by jo-source.

the class BeanRelationNodeModelImpl method removeFiltersForProperty.

@Override
public void removeFiltersForProperty(final String id, final String propertyName) {
    final IUiFilterTools filterTools = CapUiToolkit.filterToolkit().filterTools();
    final IUiFilter currentFilter = getFilter(id);
    if (currentFilter != null) {
        setFilter(id, filterTools.removeProperty(currentFilter, propertyName));
    }
}
Also used : IUiFilter(org.jowidgets.cap.ui.api.filter.IUiFilter) IUiFilterTools(org.jowidgets.cap.ui.api.filter.IUiFilterTools)

Example 3 with IUiFilter

use of org.jowidgets.cap.ui.api.filter.IUiFilter in project jo-client-platform by jo-source.

the class BeanTableModelImpl method addFilter.

@Override
public void addFilter(final String id, final IUiFilter addedFilter) {
    Assert.paramNotNull(id, "id");
    Assert.paramNotNull(addedFilter, "addedFilter");
    final IUiFilterTools filterTools = CapUiToolkit.filterToolkit().filterTools();
    final IUiFilter currentFilter = getFilter(id);
    setFilter(id, filterTools.addFilter(currentFilter, addedFilter));
}
Also used : IUiFilter(org.jowidgets.cap.ui.api.filter.IUiFilter) IUiFilterTools(org.jowidgets.cap.ui.api.filter.IUiFilterTools)

Example 4 with IUiFilter

use of org.jowidgets.cap.ui.api.filter.IUiFilter in project jo-client-platform by jo-source.

the class BeanTableModelImpl method removeFiltersForProperty.

@Override
public void removeFiltersForProperty(final String id, final String propertyName) {
    final IUiFilterTools filterTools = CapUiToolkit.filterToolkit().filterTools();
    final IUiFilter currentFilter = getFilter(id);
    if (currentFilter != null) {
        setFilter(id, filterTools.removeProperty(currentFilter, propertyName));
    }
}
Also used : IUiFilter(org.jowidgets.cap.ui.api.filter.IUiFilter) IUiFilterTools(org.jowidgets.cap.ui.api.filter.IUiFilterTools)

Example 5 with IUiFilter

use of org.jowidgets.cap.ui.api.filter.IUiFilter in project jo-client-platform by jo-source.

the class BeanTableModelImpl method getFilter.

private IFilter getFilter() {
    final IFilter addedDataFilter = getAddedDataFilter();
    if (filters.size() > 0 || addedDataFilter != null) {
        final IBooleanFilterBuilder builder = CapCommonToolkit.filterFactory().booleanFilterBuilder();
        builder.setOperator(BooleanOperator.AND);
        final IUiFilterFactory filterFactory = CapUiToolkit.filterToolkit().filterFactory();
        for (final IUiFilter uiFilter : filters.values()) {
            builder.addFilter(filterFactory.convert(uiFilter));
        }
        if (addedDataFilter != null) {
            builder.addFilter(addedDataFilter);
        }
        return builder.build();
    } else {
        return addedDataFilter;
    }
}
Also used : IBooleanFilterBuilder(org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder) IUiFilterFactory(org.jowidgets.cap.ui.api.filter.IUiFilterFactory) IFilter(org.jowidgets.cap.common.api.filter.IFilter) IUiFilter(org.jowidgets.cap.ui.api.filter.IUiFilter)

Aggregations

IUiFilter (org.jowidgets.cap.ui.api.filter.IUiFilter)17 IUiFilterTools (org.jowidgets.cap.ui.api.filter.IUiFilterTools)7 IUiArithmeticPropertyFilter (org.jowidgets.cap.ui.api.filter.IUiArithmeticPropertyFilter)4 IUiBooleanFilter (org.jowidgets.cap.ui.api.filter.IUiBooleanFilter)4 IUiFilterFactory (org.jowidgets.cap.ui.api.filter.IUiFilterFactory)4 IBooleanFilterBuilder (org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder)3 IFilter (org.jowidgets.cap.common.api.filter.IFilter)3 IUiArithmeticFilter (org.jowidgets.cap.ui.api.filter.IUiArithmeticFilter)3 IUiCustomFilter (org.jowidgets.cap.ui.api.filter.IUiCustomFilter)3 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 IArithmeticFilterBuilder (org.jowidgets.cap.common.api.filter.IArithmeticFilterBuilder)1 IArithmeticPropertyFilterBuilder (org.jowidgets.cap.common.api.filter.IArithmeticPropertyFilterBuilder)1 ICustomFilterBuilder (org.jowidgets.cap.common.api.filter.ICustomFilterBuilder)1 IAttributeConfig (org.jowidgets.cap.ui.api.attribute.IAttributeConfig)1 IUiBooleanFilterBuilder (org.jowidgets.cap.ui.api.filter.IUiBooleanFilterBuilder)1