コード例 #1
0
  public ProjectDisplayImpl(ProjectId projectId) {
    this.projectId = checkNotNull(projectId);
    setTitle(getLabel());
    setTopToolbar(new Toolbar()); // TODO: make it configurable
    setEnableTabScroll(true);
    buildUI();

    // TODO: use this to remove tab from config
    addListener(
        new TabPanelListenerAdapter() {
          @Override
          public void onTabChange(TabPanel source, Panel tab) {
            //                EventBusManager.getManager().postEvent(new
            // PlaceCoordinateChangedEvent(ProjectDisplayImpl.this, getPlaceCoordinate()));
            // TODO:  PLACE HAS CHANGED!!!
          }
        });

    EventBusManager.getManager()
        .registerHandler(
            PlaceChangeEvent.TYPE,
            new PlaceChangeEvent.Handler() {
              @Override
              public void onPlaceChange(PlaceChangeEvent event) {
                updateFromPlace();
              }
            });
    updateFromPlace();
  }
コード例 #2
0
 public void dispatchEvents(EventList<?> eventList) {
   if (eventList.isEmpty()) {
     return;
   }
   GWT.log(
       "Retrieved "
           + eventList.getEvents().size()
           + " events from server. From "
           + eventList.getStartTag()
           + " to "
           + eventList.getEndTag());
   EventTag eventListStartTag = eventList.getStartTag();
   if (!eventList.getStartTag().equals(eventList.getEndTag())
       && nextTag.isGreaterOrEqualTo(eventListStartTag)) {
     // We haven't missed any events - our next retrieval will be from where we got the event to.
     nextTag = eventList.getEndTag();
     GWT.log("Updated events.  Next tag is " + nextTag);
   }
   if (!eventList.isEmpty()) {
     GWT.log("Dispatching events from polling manager");
     EventBusManager.getManager().postEvents(eventList.getEvents());
   }
 }