Esempio n. 1
0
  private VerticalPanel buildExtras() {

    HorizontalPanel extsBaseRow = new HorizontalPanel();

    ToggleButton bShowOnly = new ToggleButton(new Image("images/button_eye.gif"), this);
    bShowOnly.setTitle("Click to hide all route segments except this one! Click again to restore.");
    extsBaseRow.add(bShowOnly);

    soClick = new HTML("<div class=\"togglelink\">詳細內容</div>");
    soClick.setTitle("顯示詳細內容.");
    soClick.addClickListener(this);
    extsBaseRow.add(soClick);

    VerticalPanel exts = new VerticalPanel();
    exts.add(extsBaseRow);

    detailPanel = buildStopOvers();
    exts.add(detailPanel);

    exts.setStyleName("extras");
    extsBaseRow.setStyleName("base_row");
    bShowOnly.setStyleName("eye");
    detailPanel.setStyleName("stopovers");
    return exts;
  }
Esempio n. 2
0
  private void buildSearchPanel() {

    expandableSearch.add(searchBox);
    searchBox.setWidth("100%");
    searchButton =
        new Button(
            "Search",
            new SelectionListener<ButtonEvent>() {
              @Override
              public void componentSelected(ButtonEvent ce) {
                if (!searchBox.getText().trim().equalsIgnoreCase("")) {
                  searchButton.setEnabled(false);
                  start = 0;
                  search(searchBox.getText());
                }
              }
            });

    expandableSearch.add(searchButton);
    final HTML showAdvanced = new HTML("Show Advanced Search");
    showAdvanced.addClickListener(
        new ClickListener() {
          public void onClick(Widget sender) {

            if (!advancedSearch) {
              advancedSearch = true;
              showAdvanced.setText("Hide Advanced Search");
              advancedOptions.setVisible(true);
            } else {
              advancedSearch = false;
              showAdvanced.setText("Show Advanced Search");
            }

            layout();
          }
        });
  }