Package org.onebusaway.webapp.gwt.viewkit

Examples of org.onebusaway.webapp.gwt.viewkit.NavigationController


  }

  public static ViewController ensureStopIsSelected(ViewController controller,
      String stopId) {

    NavigationController nav = controller.getNavigationController();
    ViewController next = nav.getNextController(controller);

    if (next != null) {

      String currentStopId = Actions.getStopIdForViewController(next);
      if (currentStopId != null && currentStopId.equals(stopId))
        return next;

      // Otherwise, clear the existing view stack
      nav.popToViewController(controller);
    }

    return Actions.showArrivalsAndDeparturesForStop(nav, stopId);
  }
View Full Code Here


    }

    // If we've made it this far, it means we didn't find a match. Let's clear
    // the remainder of the view stack
    ListViewController vc = getListViewController();
    NavigationController nav = vc.getNavigationController();
    nav.popToViewController(vc);
  }
View Full Code Here

  public MobileApplication() {

    TabBarController tabs = MobileApplicationContext.getRootController();

    NavigationController maps = createNavigationController("map", "Map",
        _resources.getCrossHairsIcon(),
        MobileApplicationContext.getMapViewController());

    NavigationController bookmarks = createNavigationController("bookmarks",
        "Bookmarks", _resources.getBookmarksIcon(),
        new BookmarksViewController());

    NavigationController recentStops = createNavigationController("recent",
        "Recent", _resources.getClockIcon(), new RecentStopsViewController());

    NavigationController search = createNavigationController("search",
        "Search", _resources.getMagnifyingGlassIcon(),
        new SearchViewController());

    tabs.addViewController(maps);
    tabs.addViewController(bookmarks);
    tabs.addViewController(recentStops);
    tabs.addViewController(search);

    tabs.addVieControllerSelectedHandler(new ViewControllerSelectedHandler() {
      @Override
      public void handleViewControllerSelected(ViewControllerSelectedEvent event) {
        NavigationController nav = (NavigationController) event.getViewController();
        nav.popToRootViewController();
      }
    });

    setRootViewController(tabs);
View Full Code Here

      String title, ImageResource img, ViewController firstView) {

    Image image = new Image(img.getURL(), img.getLeft(), img.getTop(),
        img.getWidth(), img.getHeight());

    NavigationController navigationController = new NavigationController();
    navigationController.getTabBarItem().setName(title);
    navigationController.getTabBarItem().setImage(image);
    navigationController.getNavigationItem().setId(id);
    navigationController.getNavigationItem().setTitle(title);
    navigationController.pushViewController(firstView);
    return navigationController;
  }
View Full Code Here

  }

  @Override
  public void retrieveContext(List<String> path, Map<String, String> context) {
    ListViewController controller = getListViewController();
    NavigationController nav = controller.getNavigationController();
    ViewController next = nav.getNextController(controller);
    String stopId = Actions.getStopIdForViewController(next);
    if (stopId != null)
      path.add(stopId);
  }
View Full Code Here

      bookmark.setStopId(_data.getStop().getId());
      bookmark.setName(_data.getStop().getName());
      BookmarkViewController vc = new BookmarkViewController(bookmark, true);

      ListViewController lvc = getListViewController();
      NavigationController nav = lvc.getNavigationController();
      nav.pushViewController(vc);
    }
  }
View Full Code Here

    if( _newBookmark ) {
      MobileApplicationDao dao = MobileApplicationContext.getDao();
      dao.addBookmark(_bookmark);
    }
     
    NavigationController nav = getNavigationController();
    nav.popViewController();
  }
View Full Code Here

 
  private class CancelHandler implements ClickHandler {

    @Override
    public void onClick(ClickEvent arg0) {
      NavigationController nav = getNavigationController();
      nav.popViewController();
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.webapp.gwt.viewkit.NavigationController

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.