Package org.onebusaway.webapp.gwt.common.widgets

Examples of org.onebusaway.webapp.gwt.common.widgets.SpanWidget


    destinationPanel.add(new Anchor(trip.getTripHeadsign(), href));

    DivPanel timeAndStatusPanel = new DivPanel("arrivalsTimePanel");
    divPanel.add(timeAndStatusPanel);
    String time = _timeFormat.format(new Date(bean.computeBestDepartureTime()));
    timeAndStatusPanel.add(new SpanWidget(time, "arrivalsTimeEntry"));
    timeAndStatusPanel.add(new SpanWidget(" - "));
    String arrivalStatusLabelStyle = _methods.getStatusLabelStyle(bean);
    timeAndStatusPanel.add(new SpanWidget(_methods.getStatusLabel(bean),
        arrivalStatusLabelStyle));
    _arrivalsAndDeparturesTable.setWidget(rowIndex, 1, divPanel);

    _arrivalsAndDeparturesTable.getCellFormatter().setStyleName(rowIndex, 2,
        "arrivalsStatusEntry");
View Full Code Here


        int tableRow = index + 1;
        EntryClickHandler handler = new EntryClickHandler(tlsr);

        String labelPre = index < ROW_LABELS.length() ? (ROW_LABELS.charAt(index) + "") : "";
        grid.setWidget(tableRow, 0, new SpanWidget(labelPre));
        grid.getCellFormatter().addStyleName(tableRow, 0, "ResultsTableWidget-ResultsTable-LabelColumn");

        Anchor name = new Anchor(entry.getName());
        name.addClickHandler(handler);
        grid.setWidget(tableRow, 1, name);
View Full Code Here

    itemCount.addStyleName(_css.ItemCountPanel());
    elements.setWidget(0, 0, itemCount);

    FlowPanel pagesPanel = new FlowPanel();
    pagesPanel.addStyleName(_css.PagesPanel());
    pagesPanel.add(new SpanWidget("Go to page "));

    int lastPage = -1;

    for (int i = 0; i < totalPages; i++) {
      final int pIndex = i;

      boolean display = (i == 0) || (i == totalPages - 1) || (Math.abs(i - pageIndex) < 3);

      if (display) {

        if (lastPage != -1) {
          String value = pIndex - lastPage == 1 ? "|" : "...";
          pagesPanel.add(new SpanWidget(value));
        }

        String label = Integer.toString(pIndex + 1);
        Widget page = (i == pageIndex) ? new SpanWidget(label) : new Anchor(label);
        pagesPanel.add(page);
        page.addStyleName(_css.PageCount());
        if (i == pageIndex) {
          page.addStyleName(_css.CurrentPage());
        } else {
          ((Anchor) page).addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent arg0) {
              _model.setPageIndex(pIndex);
            }
          });
        }

        lastPage = pIndex;
      }
    }
    elements.setWidget(0, 1, pagesPanel);

    FlowPanel prevNextPagePanel = new FlowPanel();
    prevNextPagePanel.addStyleName(_css.PrevNextPanel());

    if (pageIndex > 0) {
      Anchor prev = new Anchor("Previous");
      prevNextPagePanel.add(prev);
      if (pageIndex > 0) {
        prev.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent arg0) {
            int pi = _model.getPageIndex();
            _model.setPageIndex(pi - 1);
          }
        });
      }
    }

    if (pageIndex > 0 && pageIndex < totalPages - 1)
      prevNextPagePanel.add(new SpanWidget("|"));

    if (pageIndex < totalPages - 1) {
      Anchor next = new Anchor("Next");
      prevNextPagePanel.add(next);
      if (pageIndex + 1 < totalPages) {
View Full Code Here

  private DivPanel getNotificationMinutesBeforePanel() {

    DivPanel minutesRow = new DivPanel(
        _notificationCss.notificationMinutesBeforePanel());

    minutesRow.add(new SpanWidget("Notify me"));

    _minutesBeforeTextBox = new TextBox();
    _minutesBeforeTextBox.addStyleName(_notificationCss.notificationMinutesBeforeTextBox());
    _minutesBeforeTextBox.setText(Integer.toString(DEFAULT_NOTIFY_MINUTES_BEFORE));
    MinutesBeforeHandler handler = new MinutesBeforeHandler();
    _minutesBeforeTextBox.addKeyUpHandler(handler);

    minutesRow.add(_minutesBeforeTextBox);

    minutesRow.add(new SpanWidget("minutes before arrival"));
    return minutesRow;
  }
View Full Code Here

    return methodsPanel;
  }

  private DivPanel getSaveDefaultsPanel() {
    DivPanel panel = new DivPanel(_notificationCss.notificationDefaultsPanel());
    panel.add(new SpanWidget("Make this the default for:",
        _notificationCss.notificationDefaultsText()));

    Button justThisStop = new Button("This Stop");
    justThisStop.addStyleName(_notificationCss.notificationDefaultsButton());
    justThisStop.addClickHandler(new ClickHandler() {
View Full Code Here

    destinationPanel.add(new Anchor(trip.getTripHeadsign(), href));

    DivPanel timeAndStatusPanel = new DivPanel(_stopCss.arrivalsTimePanel());
    divPanel.add(timeAndStatusPanel);
    String time = _timeFormat.format(new Date(bean.computeBestDepartureTime()));
    timeAndStatusPanel.add(new SpanWidget(time, _stopCss.arrivalsTimeEntry()));
    timeAndStatusPanel.add(new SpanWidget(" - "));
    String arrivalStatusLabelStyle = _methods.getStatusLabelStyle(bean);
    timeAndStatusPanel.add(new SpanWidget(_methods.getStatusLabel(bean),
        arrivalStatusLabelStyle));
    _arrivalsAndDeparturesTable.setWidget(1, 1, divPanel);

    _arrivalsAndDeparturesTable.getCellFormatter().setStyleName(1, 2,
        _stopCss.arrivalsStatusEntry());
View Full Code Here

    FlowPanel namePart = new FlowPanel();
    tab.add(namePart);

    String name = tabBarItem.getName();
    if (name != null) {
      namePart.add(new SpanWidget(name));
    } else {
      namePart.addStyleName(_css.TabBarItemNoName());
    }

    tab.addClickHandler(new ClickHandler() {
View Full Code Here

    FlowPanel panel = new FlowPanel();

    FlowPanel fromPanel = new FlowPanel();
    panel.add(fromPanel);

    fromPanel.add(new SpanWidget("From:"));
    TextBox fromBox = new TextBox();
    fromPanel.add(fromBox);

    FlowPanel toPanel = new FlowPanel();
    panel.add(toPanel);

    toPanel.add(new SpanWidget("To:"));
    TextBox toBox = new TextBox();
    toPanel.add(toBox);

    update(context);
View Full Code Here

  public PlaceCollection(String name, Image image) {
    FlowPanel header = new FlowPanel();
    add(header);
    header.add(image);
    SpanWidget label = new SpanWidget(name);
    header.add(label);

    add(_elements);
    _elements.setVisible(_expanded);

    _label = new Label("0 elements");
    _label.setVisible(!_expanded);
    add(_label);

    ClickHandlerImpl handler = new ClickHandlerImpl();
    image.addClickHandler(handler);
    label.addClickHandler(handler);
  }
View Full Code Here

    DivPanel addressPanel2 = new DivPanel();
    addressPanel2.addStyleName(_css.SearchWidgetExamplePanel());
    addressPanel.add(addressPanel2);

    SpanWidget addressExampleLabel1 = new SpanWidget(
        "(ex. \"3rd and pike\" or ");
    addressExampleLabel1.addStyleName(_css.SearchWidgetExampleLabel());
    addressPanel2.add(addressExampleLabel1);

    Anchor addressExampleLabel2 = new Anchor("use the map");
    addressExampleLabel2.addStyleName(_css.SearchWidgetExampleLabel());
    addressExampleLabel2.addClickHandler(new UseTheMapHandler());
    addressPanel2.add(addressExampleLabel2);

    SpanWidget addressExampleLabel3 = new SpanWidget(")");
    addressExampleLabel3.addStyleName(_css.SearchWidgetExampleLabel());
    addressPanel2.add(addressExampleLabel3);

    DivPanel buttonPanel = new DivPanel();
    buttonPanel.addStyleName(_css.SearchWidgetButtonPanel());
    searchPanel.add(buttonPanel);

    Button button = new Button("Go");
    buttonPanel.add(button);
    button.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent widget) {
        handleQuery();
      }
    });

    AddressTextBoxHandler handler = new AddressTextBoxHandler();
    _addressTextBox.addKeyPressHandler(handler);
    _addressTextBox.addFocusHandler(handler);
    _addressTextBox.addBlurHandler(handler);

    _optionsButton = new Anchor("Show More Options");
    _optionsButton.addStyleName(_css.SearchWidgetShowOptionsButton());
    _optionsButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent arg0) {
        toggleExpansion();
        // TODO : Refresh layout
      }
    });
    buttonPanel.add(_optionsButton);

    DivPanel clearPanel = new DivPanel();
    clearPanel.addStyleName(_css.ClearPanel());
    panel.add(clearPanel);
    Image hiddenPixel = new Image(
        CommonResources.INSTANCE.getHiddenPixel().getUrl());
    clearPanel.add(hiddenPixel);

    _optionsPanel = new DivPanel();
    _optionsPanel.addStyleName(_css.SearchWidgetOptionsPanel());
    _optionsPanel.setVisible(false);
    panel.add(_optionsPanel);

    Grid optionsGrid = new Grid(2, 4);
    optionsGrid.addStyleName(_css.SearchWidgetOptionsGrid());
    for (int i = 0; i < 4; i++) {
      optionsGrid.getCellFormatter().addStyleName(0, i,
          "SearchWidget-OptionsGrid-Column" + i);
      optionsGrid.getCellFormatter().addStyleName(1, i,
          "SearchWidget-OptionsGrid-Column" + i);
    }
    _optionsPanel.add(optionsGrid);

    SpanWidget timeLabel = new SpanWidget("Start Time:");
    optionsGrid.setWidget(0, 0, timeLabel);

    DivPanel dateAndTimePanel = new DivPanel();
    optionsGrid.setWidget(0, 1, dateAndTimePanel);
    _dateTextBox = new TextBox();
    _dateTextBox.addStyleName(_css.SearchWidgetStartDateTextBox());
    dateAndTimePanel.add(_dateTextBox);
    _timeTextBox = new TextBox();
    _timeTextBox.addStyleName(_css.SearchWidgetStartTimeTextBox());
    dateAndTimePanel.add(_timeTextBox);

    SpanWidget maxLengthLabel = new SpanWidget("Trip Time:");
    optionsGrid.setWidget(1, 0, maxLengthLabel);

    _maxTripLengthBox = new ListBox();
    _maxTripLengthBox.addItem("10 mins", "10");
    _maxTripLengthBox.addItem("15 mins", "15");
    _maxTripLengthBox.addItem("20 mins", "20");
    _maxTripLengthBox.addItem("30 mins", "30");
    _maxTripLengthBox.addItem("45 mins", "45");
    _maxTripLengthBox.addItem("1 hour", "60");
    _maxTripLengthBox.addStyleName(_css.SearchWidgetTripLengthList());
    optionsGrid.setWidget(1, 1, _maxTripLengthBox);

    SpanWidget maxTransfersLabel = new SpanWidget("Transfers:");
    optionsGrid.setWidget(0, 2, maxTransfersLabel);

    _maxTransfersListBox = new ListBox();
    _maxTransfersListBox.addItem("Don't Care", "-1");
    _maxTransfersListBox.addItem("0", "0");
    _maxTransfersListBox.addItem("1", "1");
    _maxTransfersListBox.addItem("2", "2");
    optionsGrid.setWidget(0, 3, _maxTransfersListBox);

    SpanWidget maxWalkLabel = new SpanWidget("Walk at most:");
    optionsGrid.setWidget(1, 2, maxWalkLabel);

    _maxWalkDistance = new ListBox();
    _maxWalkDistance.addItem("1/4 mile", "1320");
    _maxWalkDistance.addItem("1/2 mile", "2640");
View Full Code Here

TOP

Related Classes of org.onebusaway.webapp.gwt.common.widgets.SpanWidget

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.