Package com.google.gwt.event.shared

Examples of com.google.gwt.event.shared.SimpleEventBus


public class DefaultApplicationEventBus implements ApplicationEventBus {

    private final ResettableEventBus eventBus;

    public DefaultApplicationEventBus() {
        eventBus = new ResettableEventBus(new SimpleEventBus());
    }
View Full Code Here


    activateLast();
    ensureHandlers().fireEvent(new UnregisterEvent<Widget>(widget));
  }

  SimpleEventBus ensureHandlers() {
    return eventBus == null ? eventBus = new SimpleEventBus() : eventBus;
  }
View Full Code Here

  protected void setLastLoadConfig(C lastLoadConfig) {
    this.lastLoadConfig = lastLoadConfig;
  }

  SimpleEventBus ensureHandler() {
    return eventBus == null ? eventBus = new SimpleEventBus() : eventBus;
  }
View Full Code Here

    ensureHandlers().fireEvent(new LiveGridViewUpdateEvent(liveStoreOffset, viewIndex, totalCount, rowCount));
  }

  SimpleEventBus ensureHandlers() {
    return eventBus == null ? eventBus = new SimpleEventBus() : eventBus;
  }
View Full Code Here

   * Instantiates the eventBus if not already instantiated.
   *
   * @return the eventBus
   */
  SimpleEventBus ensureHandlers() {
    return eventBus == null ? eventBus = new SimpleEventBus() : eventBus;
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void testInitialization() {
    CapabilitiesView mockView = EasyMock.createMock(CapabilitiesView.class);
    ProjectRpcAsync projectService = EasyMock.createMock(ProjectRpcAsync.class);
    UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
    SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
    Project testProject = new Project();
    testProject.setProjectId(42L);

    ArrayList<Component> components = Lists.newArrayList();
    ArrayList<Attribute> attributes = Lists.newArrayList();
View Full Code Here

  public void testInitialization() {

    // Test setup
    ProjectRpcAsync mockProjService = EasyMock.createMock(ProjectRpcAsync.class);
    ComponentsView mockView = EasyMock.createMock(ComponentsView.class);
    SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
    UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
    DataRpcAsync dataService = EasyMock.createMock(DataRpcAsync.class);

    List<Component> components = new ArrayList<Component>();
    List<Signoff> signoffs = new ArrayList<Signoff>();
View Full Code Here

    mockView.setProjectLabels(labels);

    EasyMock.replay(mockView, mockProjService, securityService, dataService);

    AttributesPresenter testPresenter = new AttributesPresenter(parentProject, mockProjService,
        securityService, dataService, mockView, new SimpleEventBus());

    EasyMock.verify(mockView, mockProjService, securityService, dataService);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void testProjectHasNoAttributesEvent() {
    // Test setup
    ProjectRpcAsync mockProjService = EasyMock.createMock(ProjectRpcAsync.class);
    AttributesView mockView = EasyMock.createMock(AttributesView.class);
    SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
    UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
    DataRpcAsync dataService = EasyMock.createMock(DataRpcAsync.class);

    ArrayList<Attribute> attributes = new ArrayList<Attribute>();
    ArrayList<Signoff> signoffs = new ArrayList<Signoff>();
    Collection<String> labels = Lists.newArrayList();

    Project parentProject = new Project();
    parentProject.setProjectId(42L);

    // Test #1 - Verify the ProjectHasNoEvents event get fired.
    securityService.hasEditAccess(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(false);
    mockProjService.getProjectAttributes(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(attributes);
    dataService.getSignoffsByType(EasyMock.eq(42L), EasyMock.eq(AccElementType.ATTRIBUTE),
        EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(signoffs);
    mockProjService.getLabels(EasyMock.eq(42L), EasyMock.isA(AsyncCallback.class));
    EasyMockUtils.setLastAsyncCallbackSuccessWithResult(labels);

    mockEventBus.fireEvent(EasyMock.isA(ProjectHasNoElementsEvent.class));

    mockView.setPresenter((AttributesView.Presenter) EasyMock.anyObject());
    mockView.setProjectAttributes(attributes);
    mockView.setSignoffs(signoffs);
    mockView.setProjectLabels(labels);
View Full Code Here

  @SuppressWarnings("unchecked")
  public void testAttributeAddedEventOnInitialization() {
    ProjectRpcAsync mockProjService = EasyMock.createMock(ProjectRpcAsync.class);
    AttributesView mockView = EasyMock.createMock(AttributesView.class);
    // Since HandlerManager is a concrete type, must import 'org.easymock.EasyMock'
    SimpleEventBus mockEventBus = EasyMock.createMock(SimpleEventBus.class);
    UserRpcAsync securityService = EasyMock.createMock(UserRpcAsync.class);
    DataRpcAsync dataService = EasyMock.createMock(DataRpcAsync.class);

    ArrayList<Attribute> attributes = new ArrayList<Attribute>();
    Attribute att = new Attribute();
View Full Code Here

TOP

Related Classes of com.google.gwt.event.shared.SimpleEventBus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.