public void deleteRoute(final Long id) { RouteRequest routeRequest = boulderLogRequestFactory.routeRequest(); routeRequest .deleteById(id) .fire( new Receiver<Void>() { @Override public void onSuccess(Void response) { routeListView.removeRouteWidgetById(id); } }); }
public void addRoute(String text) { RouteRequest routeRequest = boulderLogRequestFactory.routeRequest(); RouteProxy newRoute = routeRequest.create(RouteProxy.class); newRoute.setName(text); routeRequest .saveAndReturn(newRoute) .fire( new Receiver<RouteProxy>() { @Override public void onSuccess(RouteProxy response) { routeListView.createRouteWidget(response); routeListView.resetTextBox(); } }); }
/** Invoked by the ActivityManager to start a new Activity */ public void start(AcceptsOneWidget containerWidget, EventBus eventBus) { routeListView.setPresenter(this); routeListView.clearRouteList(); RouteRequest routeRequest = boulderLogRequestFactory.routeRequest(); routeRequest .listAll() .fire( new Receiver<List<RouteProxy>>() { @Override public void onSuccess(List<RouteProxy> response) { for (final RouteProxy r : response) { routeListView.createRouteWidget(r); } } }); containerWidget.setWidget(routeListView.asWidget()); }