Search in sources :

Example 6 with IBeanModification

use of org.jowidgets.cap.common.api.bean.IBeanModification in project jo-client-platform by jo-source.

the class BeanProxyImpl method setModifications.

@Override
public void setModifications(final Collection<IBeanModification> modifications) {
    checkDisposed();
    Assert.paramNotNull(modifications, "modifications");
    for (final IBeanModification modification : modifications) {
        setValue(modification.getPropertyName(), modification.getNewValue());
    }
}
Also used : IBeanModification(org.jowidgets.cap.common.api.bean.IBeanModification)

Example 7 with IBeanModification

use of org.jowidgets.cap.common.api.bean.IBeanModification in project jo-client-platform by jo-source.

the class BeanLinkPanelImpl method doFilter.

private void doFilter(final IBeanProxy<LINKABLE_BEAN_TYPE> bean) {
    final IBeanTableModel<LINKABLE_BEAN_TYPE> tableModel = linkableTable.getModel();
    final IFilterToolkit filterToolkit = CapUiToolkit.filterToolkit();
    final IUiFilterFactory filterFactory = filterToolkit.filterFactory();
    final IUiBooleanFilterBuilder filterBuilder;
    filterBuilder = filterFactory.booleanFilterBuilder().setOperator(BooleanOperator.AND);
    if (bean != null) {
        for (final IBeanModification modification : bean.getModifications()) {
            final String propertyName = modification.getPropertyName();
            final IAttribute<Object> attribute = tableModel.getAttribute(propertyName);
            final IIncludingFilterFactory<Object> includingFilterFactory = getIncludingFilterFactory(attribute);
            if (includingFilterFactory != null) {
                final Object operand = getModifiedFilterOperand(modification.getNewValue());
                filterBuilder.addFilter(includingFilterFactory.getIncludingFilter(operand));
            }
        }
    }
    if (filterBuilder.hasEntries()) {
        tableModel.setFilter(BEAN_LINK_SEARCH_FILTER_ID, filterBuilder.build());
    } else {
        tableModel.setFilter(BEAN_LINK_SEARCH_FILTER_ID, null);
    }
    tableModel.loadScheduled(LOAD_DELAY);
}
Also used : IUiFilterFactory(org.jowidgets.cap.ui.api.filter.IUiFilterFactory) IFilterToolkit(org.jowidgets.cap.ui.api.filter.IFilterToolkit) IUiBooleanFilterBuilder(org.jowidgets.cap.ui.api.filter.IUiBooleanFilterBuilder) IBeanModification(org.jowidgets.cap.common.api.bean.IBeanModification)

Aggregations

IBeanModification (org.jowidgets.cap.common.api.bean.IBeanModification)7 LinkedList (java.util.LinkedList)4 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 List (java.util.List)2 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 IBeanProxy (org.jowidgets.cap.ui.api.bean.IBeanProxy)1 IExecutionTask (org.jowidgets.cap.ui.api.execution.IExecutionTask)1 IFilterToolkit (org.jowidgets.cap.ui.api.filter.IFilterToolkit)1 IUiBooleanFilterBuilder (org.jowidgets.cap.ui.api.filter.IUiBooleanFilterBuilder)1 IUiFilterFactory (org.jowidgets.cap.ui.api.filter.IUiFilterFactory)1