Package org.onebusaway.webapp.gwt.viewkit

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


  @Override
  public ListViewRow getListViewRowForSectionAndRow(int sectionIndex,
      int rowIndex) {

    if (_bookmarks.isEmpty()) {
      ListViewRow row = new ListViewRow();
      row.setStyle(ListViewRowStyle.DEFAULT);
      row.setText("No bookmarks");
      return row;
    }

    Bookmark bookmark = _bookmarks.get(rowIndex);

    ListViewRow row = new ListViewRow();
    row.setStyle(ListViewRowStyle.DEFAULT);
    row.setText(bookmark.getName());

    return row;
  }
View Full Code Here


  @Override
  public ListViewRow getListViewRowForSectionAndRow(int sectionIndex,
      int rowIndex) {

    if (_recentStops.isEmpty()) {
      ListViewRow row = new ListViewRow();
      row.setStyle(ListViewRowStyle.DEFAULT);
      row.setText("No recent stops");
      return row;
    }

    StopBean stop = _recentStops.get(rowIndex);

    ListViewRow row = new ListViewRow();
    row.setStyle(ListViewRowStyle.DETAIL);
    row.setText(stop.getName());

    StringBuilder b = new StringBuilder();

    if (stop.getDirection() != null)
      b.append(stop.getDirection()).append(" bound - ");
    b.append("Routes:");
    boolean first = true;
    for (RouteBean route : stop.getRoutes()) {
      if (!first)
        b.append(",");
      b.append(" ");
      b.append(route.getShortName());
      first = false;
    }
    row.setDetailText(b.toString());

    return row;
  }
View Full Code Here

  @Override
  public ListViewRow getListViewRowForSectionAndRow(int sectionIndex,
      int rowIndex) {

    ListViewRow row = new ListViewRow();

    switch (sectionIndex) {
      case 0: {

        StopBean stop = _data.getStop();
        row.setStyle(ListViewRowStyle.DEFAULT);
        row.setText(stop.getName());

        if (stop.getDirection() != null || stop.getCode() != null) {
          row.setStyle(ListViewRowStyle.DETAIL);
          StringBuilder b = new StringBuilder();
          if (stop.getDirection() != null)
            b.append(stop.getDirection()).append(" bound - ");
          if (stop.getCode() != null)
            b.append("Stop # ").append(stop.getCode());
          row.setDetailText(b.toString());
        }
        break;
      }
      case 1: {

        List<ArrivalAndDepartureBean> arrivalsAndDepartures = _data.getArrivalsAndDepartures();
        ArrivalAndDepartureBean arrival = arrivalsAndDepartures.get(rowIndex);

        Widget view = getCustomViewForArrivalAndDeparture(arrival);
        row.setCustomView(view);

        break;
      }
      case 2: {
        row.setStyle(ListViewRowStyle.DEFAULT);
        row.setText("Add bookmark");
        break;
      }
    }

    return row;
View Full Code Here

TOP

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

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.