use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class AttributeGroupFilterWidgets method getValue.
@Override
public Filter getValue() {
Filter filter = new Filter();
List<Integer> selectedIds = getSelectedIds();
if (selectedIds.size() > 0) {
filter.addRestriction(DIMENSION_TYPE, selectedIds);
}
return filter;
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class PartnerFilterPanel method setValue.
@Override
public void setValue(Filter value, boolean fireEvents) {
this.value = new Filter();
this.value.addRestriction(DimensionType.Partner, value.getRestrictions(DimensionType.Partner));
applyInternalValue();
if (fireEvents) {
ValueChangeEvent.fire(this, value);
}
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class PartnerFilterPanel method clearFilter.
protected void clearFilter() {
for (PartnerDTO partner : listView.getStore().getModels()) {
listView.setChecked(partner, false);
}
value = new Filter();
filterToolBar.setApplyFilterEnabled(false);
filterToolBar.setRemoveFilterEnabled(false);
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class AttributeFilterPanel method setValue.
@Override
public void setValue(Filter value, boolean fireEvents) {
this.value = new Filter();
this.value.addRestriction(DIMENSION_TYPE, value.getRestrictions(DIMENSION_TYPE));
widgets.setValue(this.value);
if (fireEvents) {
ValueChangeEvent.fire(this, value);
}
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class AttributeGroupFilterWidget method setSelection.
public void setSelection(Collection<Integer> selection) {
Filter newValue = new Filter();
if (CollectionUtil.isNotEmpty(selection)) {
// only add relevant ids to filter
List<Integer> attributeIds = group.getAttributeIds();
for (Integer selectedId : selection) {
if (attributeIds.contains(selectedId)) {
newValue.addRestriction(DimensionType.Attribute, selectedId);
}
}
}
setValue(newValue, false);
}
Aggregations