use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class AttributeGroupFilterWidget method clear.
public void clear() {
setValue(new Filter(), false);
updateView();
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class FilterPanelSet method ensureHandlers.
private HandlerManager ensureHandlers() {
if (manager == null) {
manager = new HandlerManager(this);
myRegistrations = new ArrayList<HandlerRegistration>();
for (FilterPanel panel : panels) {
HandlerRegistration registration = panel.addValueChangeHandler(new ValueChangeHandler<Filter>() {
@Override
public void onValueChange(ValueChangeEvent<Filter> event) {
// or indicator (reports) is selected
if (event.getSource() instanceof ActivityFilterPanel || event.getSource() instanceof IndicatorFilterPanel) {
clearAttributeAndPartnerFilters();
}
Filter value = composeFilter(new Filter(), null);
ValueChangeEvent.fire(FilterPanelSet.this, value);
}
});
myRegistrations.add(registration);
}
}
return manager;
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class IndicatorFilterPanel method getValue.
@Override
public Filter getValue() {
Filter filter = new Filter();
filter.addRestriction(DimensionType.Indicator, getSelectedIds());
return filter;
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class DataEntryPage method addFilterPane.
private void addFilterPane() {
filterPane = new FilterPane(dispatcher);
BorderLayoutData filterLayout = new BorderLayoutData(LayoutRegion.WEST);
filterLayout.setCollapsible(true);
filterLayout.setMargins(new Margins(0, 5, 0, 0));
filterLayout.setSplit(true);
add(filterPane, filterLayout);
filterPane.getSet().addValueChangeHandler(new ValueChangeHandler<Filter>() {
@Override
public void onValueChange(ValueChangeEvent<Filter> event) {
eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, currentPlace.copy().setFilter(event.getValue())));
}
});
}
use of org.activityinfo.shared.command.Filter in project activityinfo by bedatadriven.
the class EmbedDialog method show.
public void show(final DataEntryPlace place) {
final String url = "http://www.activityinfo.org/embed.html?sites=" + FilterUrlSerializer.toUrlFragment(place.getFilter());
dispatcher.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(SchemaDTO result) {
Filter filter = place.getFilter();
if (filter.isDimensionRestrictedToSingleCategory(DimensionType.Activity)) {
ActivityDTO singleActivity = result.getActivityById(filter.getRestrictedCategory(DimensionType.Activity));
showPublished(singleActivity, url);
} else if (filter.isDimensionRestrictedToSingleCategory(DimensionType.Database)) {
MessageBox.alert("foo", "not impl", null);
}
}
});
}
Aggregations