Search in sources :

Example 1 with Filter

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;
}
Also used : Filter(org.activityinfo.shared.command.Filter)

Example 2 with 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);
    }
}
Also used : Filter(org.activityinfo.shared.command.Filter)

Example 3 with Filter

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);
}
Also used : PartnerDTO(org.activityinfo.shared.dto.PartnerDTO) Filter(org.activityinfo.shared.command.Filter)

Example 4 with Filter

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);
    }
}
Also used : Filter(org.activityinfo.shared.command.Filter)

Example 5 with Filter

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);
}
Also used : Filter(org.activityinfo.shared.command.Filter)

Aggregations

Filter (org.activityinfo.shared.command.Filter)59 GetSites (org.activityinfo.shared.command.GetSites)8 Test (org.junit.Test)8 GetSchema (org.activityinfo.shared.command.GetSchema)5 SchemaDTO (org.activityinfo.shared.dto.SchemaDTO)5 DimensionType (org.activityinfo.shared.report.model.DimensionType)5 ArrayList (java.util.ArrayList)4 SiteDTO (org.activityinfo.shared.dto.SiteDTO)4 DateRange (org.activityinfo.shared.report.model.DateRange)4 StringWriter (java.io.StringWriter)3 Indicator (org.activityinfo.server.database.hibernate.entity.Indicator)3 SiteResult (org.activityinfo.shared.command.result.SiteResult)3 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)3 UserDatabaseDTO (org.activityinfo.shared.dto.UserDatabaseDTO)3 Margins (com.extjs.gxt.ui.client.util.Margins)2 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)2 JsonElement (com.google.gson.JsonElement)2 Date (java.util.Date)2 HashSet (java.util.HashSet)2 List (java.util.List)2