当前位置: 首页>>代码示例>>Java>>正文


Java RequestContext类代码示例

本文整理汇总了Java中com.google.web.bindery.requestfactory.shared.RequestContext的典型用法代码示例。如果您正苦于以下问题:Java RequestContext类的具体用法?Java RequestContext怎么用?Java RequestContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RequestContext类属于com.google.web.bindery.requestfactory.shared包,在下文中一共展示了RequestContext类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: edit

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
/**
 * Construct and display the UI that will be used to edit the current
 * PersonProxy, using the given RequestContext to accumulate the edits.
 */
private void edit(RequestContext requestContext) {
  editorDriver = GWT.create(Driver.class);
  editorDriver.initialize(requestFactory, personEditor);
  
  if (requestContext == null) {
    this.favorite.setVisible(true);
    fetchAndEdit();
    return;
  }

  editorDriver.edit(person, requestContext);
  personEditor.focus();
  favorite.setValue(manager.isFavorite(person), false);
  dialog.center();
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:20,代码来源:PersonEditorWorkflow.java

示例2: TransportEntry

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
public TransportEntry(RequestContext requestContext, Receiver recv) {
    QosRequestTransport transport = (QosRequestTransport) requestContext.getRequestFactory().getRequestTransport();
    transport.startBatch();

    transport.setNextReceiverForEntry(QosRequestTransport.CAPTURE);

    if (recv == null) {
        requestContext.fire();
    } else {
        requestContext.fire(recv);
    }

    List<BatchedRequest> b = transport.flushBatch();
    payload = b.get(0).payload;
    receiver = b.get(0).receiver;

    // close the RequestContext so can be re-used.
    try {
        receiver.onTransportFailure(new ServerFailure("GOO"));
    } catch (Throwable th) {
    }
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:23,代码来源:TransportEntry.java

示例3: append

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
@Override
public <T extends RequestContext> T append(final T other) {
  final AbstractRequestContext child = (AbstractRequestContext) other;
  if (!this.state.isCompatible(child.state)) {
    throw new IllegalStateException(
        this.getClass().getName() + " and " + child.getClass().getName() + " are not compatible");
  }
  if (!child.state.isClean()) {
    throw new IllegalStateException("The provided RequestContext has been changed");
  }
  child.setState(this.state);
  return other;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:14,代码来源:AbstractRequestContext.java

示例4: createServiceInstance

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
@Override
public Object createServiceInstance(Class<? extends RequestContext> requestContext) {
    Class<? extends ServiceLocator> serviceLocatorClass;
    if ((serviceLocatorClass = getTop().resolveServiceLocator(requestContext)) != null) {
        return injector.getInstance(serviceLocatorClass).getInstance(requestContext.getAnnotation(Service.class).value());
    } else {
        return null;
    }
}
 
开发者ID:dharmab,项目名称:sheets,代码行数:10,代码来源:InjectableServiceLayerDecorator.java

示例5: register

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
static void register(EventBus eventBus,
    final DynaTableRequestFactory requestFactory,
    final FavoritesManager manager) {
  eventBus.addHandler(EditPersonEvent.TYPE, new EditPersonEvent.Handler() {
    public void startEdit(PersonProxy person, RequestContext requestContext) {
      new PersonEditorWorkflow(requestFactory, manager, person).edit(requestContext);
    }
  });
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:10,代码来源:PersonEditorWorkflow.java

示例6: onSave

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
/**
 * Called by the edit dialog's save button. This method will flush the
 * contents of the UI into the PersonProxy that is being edited, check for
 * errors, and send the request to the server.
 */
@UiHandler("save")
void onSave(ClickEvent event) {
  // Flush the contents of the UI
  RequestContext context = editorDriver.flush();

  // Check for errors
  if (editorDriver.hasErrors()) {
    dialog.setText("Errors detected locally");
    return;
  }

  // Send the request
  context.fire(new Receiver<Void>() {
    @Override
    public void onConstraintViolation(Set<ConstraintViolation<?>> errors) {
      // Otherwise, show ConstraintViolations in the UI
      dialog.setText("Errors detected on the server");
      editorDriver.setConstraintViolations(errors);
    }

    @Override
    public void onSuccess(Void response) {
      // If everything went as planned, just dismiss the dialog box
      dialog.hide();
    }
  });
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:33,代码来源:PersonEditorWorkflow.java

示例7: EditPersonEvent

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
public EditPersonEvent(PersonProxy person, RequestContext request) {
  this.person = person;
  this.request = request;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:5,代码来源:EditPersonEvent.java

示例8: getRequestContext

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
@Override
public RequestContext getRequestContext() {
    return request.getRequestContext();
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:5,代码来源:RequestAdapter.java

示例9: to

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
@Override
public RequestContext to(Receiver receiver) {
    request.to(receiver);
    return getRequestContext();
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:6,代码来源:RequestAdapter.java

示例10: RequestContextEntry

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
public RequestContextEntry(RequestContext requestContext2) {
    this(requestContext2, null);
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:4,代码来源:RequestContextEntry.java

示例11: getRequestContext

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
RequestContext getRequestContext() {
    return requestContext;
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:4,代码来源:RequestContextEntry.java

示例12: add

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
@Override
public void add(RequestContext r) {
    add(new RequestContextEntry(r));
}
 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:5,代码来源:AbstractPipeInput.java

示例13: startEdit

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
void startEdit(PersonProxy person, RequestContext requestContext); 
开发者ID:Peergos,项目名称:Peergos,代码行数:2,代码来源:EditPersonEvent.java

示例14: add

import com.google.web.bindery.requestfactory.shared.RequestContext; //导入依赖的package包/类
void add(RequestContext r); 
开发者ID:salk31,项目名称:gwt-rf-queue,代码行数:2,代码来源:PipeInput.java


注:本文中的com.google.web.bindery.requestfactory.shared.RequestContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。