use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.
the class AdminFilterPanel method removeFilter.
private void removeFilter() {
for (AdminEntityDTO entity : tree.getCheckedSelection()) {
tree.setChecked(entity, false);
}
value = new Filter();
ValueChangeEvent.fire(this, value);
filterToolBar.setRemoveFilterEnabled(false);
}
use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.
the class AdminFilterPanel method initializeComponent.
private void initializeComponent() {
this.setLayout(new FitLayout());
this.setScrollMode(Style.Scroll.AUTO);
this.setHeadingText(I18N.CONSTANTS.filterByGeography());
this.setIcon(IconImageBundle.ICONS.filter());
loader = new AdminTreeLoader(dispatcher);
store = new TreeStore<AdminEntityDTO>(loader);
}
use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.
the class AdminTreeProxy method load.
/**
* Load nodes in the tree
*
* @param parent
* @param callback
*/
@Override
protected void load(final Object parent, final AsyncCallback<List<AdminEntityDTO>> callback) {
if (filter == null) {
callback.onSuccess(new ArrayList<AdminEntityDTO>());
return;
}
if (!hasRestrictions()) {
callback.onSuccess(new ArrayList<AdminEntityDTO>());
} else {
GetAdminEntities request = new GetAdminEntities();
request.setFilter(filter);
if (parent == null) {
request.setParentId(GetAdminEntities.ROOT);
} else {
assert parent instanceof AdminEntityDTO : "expecting AdminEntityDTO";
request.setParentId(((AdminEntityDTO) parent).getId());
}
service.execute(request, new AsyncCallback<AdminEntityResult>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(AdminEntityResult result) {
callback.onSuccess(result.getData());
}
});
}
}
use of org.activityinfo.legacy.shared.model.AdminEntityDTO in project activityinfo by bedatadriven.
the class PolygonLayerGenerator method queryBounds.
private void queryBounds(DispatcherSync dispatcher, Filter layerFilter) {
GetAdminEntities query = new GetAdminEntities();
query.setLevelId(layer.getAdminLevelId());
AdminEntityResult entities = dispatcher.execute(query);
for (AdminEntityDTO entity : entities.getData()) {
if (entity.hasBounds()) {
AdminMarker marker = new AdminMarker(entity);
overlay.addPolygon(marker);
}
}
}
Aggregations