use of org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder 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;
}
}
use of org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder 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;
}
}
use of org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder in project jo-client-platform by jo-source.
the class LinkDeleterServiceImpl method createLinkFilter.
private IFilter createLinkFilter(final IBeanKey sourceKey, final IBeanKey destinationKey) {
final IBooleanFilterBuilder builder = BooleanFilter.builder();
builder.setOperator(BooleanOperator.AND);
builder.addFilter(createKeyFilter(sourceKey, sourceProperties));
builder.addFilter(createKeyFilter(destinationKey, destinationProperties));
return builder.build();
}
use of org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder in project jo-client-platform by jo-source.
the class LinkDeleterServiceImpl method deleteStandardLinks.
private void deleteStandardLinks(final Collection<? extends ILinkDeletion> linksDeletions, final IExecutionCallback executionCallback) {
final List<IBeanKey> sourceKeys = new LinkedList<IBeanKey>();
final List<IBeanKey> destinationKeys = new LinkedList<IBeanKey>();
final IFilterFactory filterFactory = CapCommonToolkit.filterFactory();
final IBooleanFilterBuilder linkReaderFilterBuilder = filterFactory.booleanFilterBuilder();
linkReaderFilterBuilder.setOperator(BooleanOperator.OR);
for (final ILinkDeletion linkDeletion : linksDeletions) {
final IBeanKey sourceKey = linkDeletion.getSourceKey();
final IBeanKey destinationKey = linkDeletion.getDestinationKey();
if (linkDeletion.deleteSource()) {
sourceKeys.add(sourceKey);
}
if (linkDeletion.deleteDestination()) {
destinationKeys.add(destinationKey);
}
linkReaderFilterBuilder.addFilter(createLinkFilter(sourceKey, destinationKey));
if (symmetric) {
linkReaderFilterBuilder.addFilter(createLinkFilter(destinationKey, sourceKey));
}
}
if (!linkReaderFilterBuilder.isEmpty()) {
deleteLinks(linkReaderFilterBuilder.build(), linksDeletions.size() * 10, executionCallback);
}
deleteKeys(destinationKeys, linkedDeleterService, executionCallback);
deleteKeys(sourceKeys, sourceDeleterService, executionCallback);
}
use of org.jowidgets.cap.common.api.filter.IBooleanFilterBuilder in project jo-client-platform by jo-source.
the class BeanTabFolderModelImpl method getFilter.
private IFilter getFilter() {
if (filters.size() > 0) {
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));
}
return builder.build();
} else {
return null;
}
}
Aggregations