Package org.onebusaway.presentation.client

Examples of org.onebusaway.presentation.client.UrlBuilder


  @UiHandler("_saveBookmarkAnchor")
  void handleShowCustomViewClick(ClickEvent e) {
    e.preventDefault();

    UrlBuilder b = UrlBuilder.createFromLocation();

    String path = Location.getPath();
    path = path.replace("bookmark-edit.action", "bookmark-update.action");
    b.setPath(path);

    String name = _bookmarkName.getText();
    if (name.length() > 0)
      b.setParameter("name", name);

    String[] stopIds = _stopsById.keySet().toArray(new String[0]);
    b.setParameter("stopId", stopIds);

    boolean allRoutesIncluded = true;
    List<String> routeIds = new ArrayList<String>();

    for (Map.Entry<String, Boolean> entry : _routeSelectionById.entrySet()) {
      if (entry.getValue())
        routeIds.add(entry.getKey());
      else
        allRoutesIncluded = false;
    }

    if (!allRoutesIncluded) {
      String[] routeIdsArray = routeIds.toArray(new String[routeIds.size()]);
      b.setParameter("routeId", routeIdsArray);
    }

    System.out.println(b.buildString());
    Location.assign(b.buildString());
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.presentation.client.UrlBuilder

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.