コード例 #1
0
  @Override
  public void start(AcceptsOneWidget panel, final EventBus eventBus) {
    view = clientFactory.getYouTubeDetailsView();
    this.eventBus = eventBus;
    view.setPresenter(this);

    Place place = clientFactory.getPlaceController().getWhere();

    if (place instanceof YouTubeDetailsPlace) {
      YouTubeDetailsPlace youTubeDetailsPlace = (YouTubeDetailsPlace) place;

      view.setTitle(youTubeDetailsPlace.getYouTubeItem().getTitle());
      view.setEmbedContent(youTubeDetailsPlace.getYouTubeItem().getId());
      view.setDescription(youTubeDetailsPlace.getYouTubeItem().getDescription());
    }

    panel.setWidget(view);
  }
コード例 #2
0
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    view = clientFactory.getSeattleExpressLanesView();
    this.eventBus = eventBus;
    this.phoneGap = this.clientFactory.getPhoneGap();
    accessibility = clientFactory.getAccessibility();
    view.setPresenter(this);
    view.getPullHeader().setHTML("pull down");
    inAppBrowser = this.phoneGap.getInAppBrowser();

    PullArrowStandardHandler headerHandler =
        new PullArrowStandardHandler(view.getPullHeader(), view.getPullPanel());

    headerHandler.setErrorText("Error");
    headerHandler.setLoadingText("Loading");
    headerHandler.setNormalText("pull down");
    headerHandler.setPulledText("release to load");
    headerHandler.setPullActionHandler(
        new PullActionHandler() {

          @Override
          public void onPullAction(final AsyncCallback<Void> callback) {

            new Timer() {

              @Override
              public void run() {
                createPostList();
                view.refresh();
                callback.onSuccess(null);
              }
            }.schedule(1);
          }
        });

    view.setHeaderPullHandler(headerHandler);

    createPostList();
    createSchedulesLink();

    panel.setWidget(view);

    accessibility.postScreenChangeNotification();
  }
コード例 #3
0
  @Override
  public void start(AcceptsOneWidget panel, final EventBus eventBus) {
    view = clientFactory.getFerriesRouteAlertDetailsView();
    this.eventBus = eventBus;
    view.setPresenter(this);

    Place place = clientFactory.getPlaceController().getWhere();

    if (place instanceof FerriesRouteAlertDetailsPlace) {
      FerriesRouteAlertDetailsPlace ferriesRouteAlertDetailsPlace =
          (FerriesRouteAlertDetailsPlace) place;

      view.setPublishDate(
          ferriesRouteAlertDetailsPlace.getFerriesRouteAlertItem().getPublishDate());
      view.setAlertTitle(
          ferriesRouteAlertDetailsPlace.getFerriesRouteAlertItem().getAlertFullTitle());
      view.setAlertText(
          ferriesRouteAlertDetailsPlace.getFerriesRouteAlertItem().getAlertFullText());
    }

    panel.setWidget(view);
    captureClickEvents();
  }
コード例 #4
0
  @Override
  public void start(AcceptsOneWidget panel, final EventBus eventBus) {
    view = clientFactory.getRestAreaView();
    analytics = clientFactory.getAnalytics();
    accessibility = clientFactory.getAccessibility();
    this.eventBus = eventBus;
    view.setPresenter(this);

    Place place = clientFactory.getPlaceController().getWhere();

    if (place instanceof RestAreaPlace) {
      RestAreaPlace restAreaPlace = (RestAreaPlace) place;

      int restAreaId = Integer.valueOf(restAreaPlace.getId());

      String jsonString = AppBundle.INSTANCE.restAreaData().getText();
      RestAreaFeed restAreas = JsonUtils.safeEval(jsonString);

      view.setTitle("Safety Rest Area");

      SafeHtmlBuilder detailsHTMLBuilder = new SafeHtmlBuilder();

      detailsHTMLBuilder.appendEscaped(
          restAreas.getRestAreas().get(restAreaId).getRoute()
              + " - "
              + restAreas.getRestAreas().get(restAreaId).getLocation());

      detailsHTMLBuilder.appendHtmlConstant("<br>");

      detailsHTMLBuilder.appendEscaped(
          "Milepost: "
              + restAreas.getRestAreas().get(restAreaId).getMilepost()
              + " - "
              + restAreas.getRestAreas().get(restAreaId).getDirection());

      view.setDetails(detailsHTMLBuilder.toSafeHtml());

      if (restAreas.getRestAreas().get(restAreaId).getNotes() == null) {
        view.hideNotesHeading();
        view.setNotes("");
      } else {
        view.showNotesHeading();
        view.setNotes(restAreas.getRestAreas().get(restAreaId).getNotes());
      }

      SafeHtmlBuilder amenitiesHTMLBuilder = new SafeHtmlBuilder();

      amenitiesHTMLBuilder.appendHtmlConstant("<ul>");
      for (int i = 0; i < restAreas.getRestAreas().get(restAreaId).getAmenities().length; i++) {
        amenitiesHTMLBuilder.appendHtmlConstant("<li>");
        amenitiesHTMLBuilder.appendEscaped(
            restAreas.getRestAreas().get(restAreaId).getAmenities()[i]);
        amenitiesHTMLBuilder.appendHtmlConstant("</li>");
      }

      if (restAreas.getRestAreas().get(restAreaId).getAmenities().length == 0) {
        view.hideAmenitiesHeading();
      } else {
        view.showAmenitiesHeading();
      }

      amenitiesHTMLBuilder.appendHtmlConstant("</ul>");

      view.setAmenities(amenitiesHTMLBuilder.toSafeHtml());

      view.setLatLon(
          Double.valueOf(restAreas.getRestAreas().get(restAreaId).getLatitude()),
          Double.valueOf(restAreas.getRestAreas().get(restAreaId).getLongitude()));

      view.refresh();
    }

    panel.setWidget(view);
    accessibility.postScreenChangeNotification();
  }
コード例 #5
0
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    this.eventBus = eventBus;
    dbService = clientFactory.getDbService();
    phoneGap = clientFactory.getPhoneGap();
    view.setPresenter(this);
    view.getNorthboundPullHeader().setHTML("pull down");
    view.getSouthboundPullHeader().setHTML("pull down");

    PullArrowStandardHandler headerHandler =
        new PullArrowStandardHandler(view.getNorthboundPullHeader(), view.getNorthboundPullPanel());

    headerHandler.setErrorText("Error");
    headerHandler.setLoadingText("Loading");
    headerHandler.setNormalText("pull down");
    headerHandler.setPulledText("release to load");
    headerHandler.setPullActionHandler(
        new PullActionHandler() {

          @Override
          public void onPullAction(final AsyncCallback<Void> callback) {

            new Timer() {

              @Override
              public void run() {
                createBorderWaitList(view);
                view.refresh();
                callback.onSuccess(null);
              }
            }.schedule(1);
          }
        });

    PullArrowStandardHandler headerHandler2 =
        new PullArrowStandardHandler(view.getSouthboundPullHeader(), view.getSouthboundPullPanel());

    headerHandler2.setErrorText("Error");
    headerHandler2.setLoadingText("Loading");
    headerHandler2.setNormalText("pull down");
    headerHandler2.setPulledText("release to load");
    headerHandler2.setPullActionHandler(
        new PullActionHandler() {

          @Override
          public void onPullAction(final AsyncCallback<Void> callback) {

            new Timer() {

              @Override
              public void run() {
                createBorderWaitList(view);
                view.refresh();
                callback.onSuccess(null);
              }
            }.schedule(1);
          }
        });

    view.setNorthboundHeaderPullHandler(headerHandler);
    view.setSouthboundHeaderPullHandler(headerHandler2);

    buildRouteIcons();
    createBorderWaitList(view);
    panel.setWidget(view);
  }
コード例 #6
0
 public BorderWaitActivity(ClientFactory clientFactory) {
   this.clientFactory = clientFactory;
   view = clientFactory.getBorderWaitView();
 }