コード例 #1
0
  protected Activity makeCreateActivity() {
    StudentEditView.instance().setCreating(true);
    final StudentRequest request = requests.studentRequest();
    Activity activity =
        new CreateAndEditProxy<StudentProxy>(
            StudentProxy.class,
            request,
            ScaffoldApp.isMobile() ? StudentMobileEditView.instance() : StudentEditView.instance(),
            placeController) {

          @Override
          protected RequestContext createSaveRequest(StudentProxy proxy) {
            request.saveStudent(proxy);
            return request;
          }
        };
    return new StudentEditActivityWrapper(
        requests,
        ScaffoldApp.isMobile() ? StudentMobileEditView.instance() : StudentEditView.instance(),
        activity,
        null);
  }
コード例 #2
0
  protected Activity makeEditActivity(ProxyPlace place) {
    StudentEditView.instance().setCreating(false);
    EntityProxyId<StudentProxy> proxyId = coerceId(place);
    Activity activity =
        new FindAndEditProxy<StudentProxy>(
            proxyId,
            requests,
            ScaffoldApp.isMobile() ? StudentMobileEditView.instance() : StudentEditView.instance(),
            placeController) {

          @Override
          protected RequestContext createSaveRequest(StudentProxy proxy) {
            StudentRequest request = requests.studentRequest();
            request.saveStudent(proxy);
            return request;
          }
        };
    return new StudentEditActivityWrapper(
        requests,
        ScaffoldApp.isMobile() ? StudentMobileEditView.instance() : StudentEditView.instance(),
        activity,
        proxyId);
  }