コード例 #1
0
 @Override
 public void edit() {
   isEditMode = true;
   storyService.getStorySummary(
       storySummary.getStoryId(),
       new ResponseHandlerLoader<DatumResponse<StorySummary>>() {
         @Override
         public void handleSuccess(DatumResponse<StorySummary> result) {
           doEdit(result.getDatum());
         }
       });
 }
コード例 #2
0
  private void fetchStorySummary(final AsyncCallback<DatumResponse<StorySummary>> callback) {
    storyService.getStorySummary(
        storySummary.getStoryId(),
        new ResponseHandlerLoader<DatumResponse<StorySummary>>() {
          @Override
          public void handleSuccess(DatumResponse<StorySummary> result) {
            storySummary = result.getDatum();
            onStorySummaryFetched();

            if (callback != null) {
              callback.onSuccess(result);
            }
          }

          @Override
          public void onFailure(Throwable e) {
            super.onFailure(e);

            if (callback != null) {
              callback.onFailure(e);
            }
          }
        });
  }