Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.SuggestBox$DefaultSuggestionDisplay


    t.setWidget(1, 0, showSuggestions);
    return t;
  }

  private SuggestBox simpleSuggestBox() {
    SuggestBox b = new SuggestBox(girlsNames);
    return b;
  }
View Full Code Here


    SuggestBox b = new SuggestBox(girlsNames);
    return b;
  }

  private SuggestBox suggestBoxWithDefault() {
    final SuggestBox b = new SuggestBox(girlsNamesWithDefault);
    b.setAutoSelectEnabled(false);
    b.getTextBox().addMouseDownHandler(new MouseDownHandler() {

      public void onMouseDown(MouseDownEvent event) {
        b.showSuggestionList();
      }

    });
    return b;
  }
View Full Code Here

public class Issue2392 extends AbstractIssue {
  private MultiWordSuggestOracle oracle = null;

  @Override
  public Widget createIssue() {
    SuggestBox box = new SuggestBox(getSuggestOracle());

    // Enable animations to ensure that the suggestions are only animated when
    // they are opened the first time.
    box.setAnimationEnabled(true);

    return box;
  }
View Full Code Here

        "Jamie", "Jill", "Jackie", "Susan", "Helen", "Emily", "Karen",
        "Abigail", "Kaitlyn", "Laura", "Joanna", "Tasha"});
    MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
    oracle.addAll(femaleNames);

    final SuggestBox b = new SuggestBox(oracle);
    b.setTitle(suggestBoxName);
    p.add(b);
    final CheckBox selectsFirst = new CheckBox("Selects first suggestion");
    selectsFirst.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
      public void onValueChange(ValueChangeEvent<Boolean> event) {
        b.setAutoSelectEnabled(event.getValue());
      }
    });
    selectsFirst.setChecked(b.isAutoSelectEnabled());
    p.add(selectsFirst);
    final EventReporter<String, SuggestBox> handler = new EventReporter<String, SuggestBox>(
        report);

    handler.new CheckBoxEvent("KeyDown", p) {

      @Override
      public HandlerRegistration addHandler() {
        return b.addKeyDownHandler(handler);
      }

    };

    handler.new CheckBoxListener("ChangeListener", p) {

      @Override
      public void addListener() {
        b.addChangeListener(handler);
      }

      @Override
      public void removeListener() {
        b.removeChangeListener(handler);
      }
    };
    handler.new CheckBoxListener("Suggestion listener", p) {

      @Override
      public void addListener() {
        b.addEventHandler(handler);
      }

      @Override
      public void removeListener() {
        b.removeEventHandler(handler);
      }
    };

    b.addKeyUpHandler(handler);
    b.addKeyPressHandler(handler);
    b.addFocusListener(handler);
    b.addSelectionHandler(handler);
    b.addValueChangeHandler(handler);
    return b;
  }
View Full Code Here

    public Widget asWidget() {

        if(null==oracle)
            throw new RuntimeException("oracle required!");

        this.suggestBox = new SuggestBox(oracle, textBox);

        suggestBox.addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(ValueChangeEvent<String> event) {
                setModified(true);
View Full Code Here

        final PTTextBox ptTextBox = (PTTextBox) uiService.getPTObject(create.getLong(PROPERTY.TEXTBOX_ID));
        final long oracleID = create.getLong(PROPERTY.ORACLE);
        final SuggestOracle oracle = oracleByID.get(oracleID);
        if (oracle == null) throw new RuntimeException("Oracle #" + oracleID + " not registered");

        init(create, uiService, new SuggestBox(oracle, ptTextBox.cast()));
    }
View Full Code Here

   * @param textbox The text box to wrap to provide suggestions to.
   */
  public static SuggestBox newSuggestBox(final String suggest_type,
                                         final TextBoxBase textbox) {
    final RemoteOracle oracle = new RemoteOracle(suggest_type);
    final SuggestBox box = new SuggestBox(oracle, textbox);
    oracle.requester = box;
    return box;
  }
View Full Code Here

    // Left hand-side panel.
      final HorizontalPanel hbox = new HorizontalPanel();
      final InlineLabel l = new InlineLabel();
      l.setText("Metric:");
      hbox.add(l);
      final SuggestBox suggest = RemoteOracle.newSuggestBox("metrics",
                                                            metric);
      suggest.setLimit(40);
      hbox.add(suggest);
      hbox.setWidth("100%");
      metric.setWidth("100%");

      tagtable.setWidget(0, 0, hbox);
View Full Code Here

  private void addTag(final String default_tagname,
                      final String default_value) {
    final int row = tagtable.getRowCount();

    final ValidatedTextBox tagname = new ValidatedTextBox();
    final SuggestBox suggesttagk = RemoteOracle.newSuggestBox("tagk", tagname);
    final ValidatedTextBox tagvalue = new ValidatedTextBox();
    final SuggestBox suggesttagv = RemoteOracle.newSuggestBox("tagv", tagvalue);
    tagname.setValidationRegexp(TSDB_ID_RE);
    tagvalue.setValidationRegexp(TSDB_TAGVALUE_RE);
    tagname.setWidth("100%");
    tagvalue.setWidth("100%");
    tagname.addBlurHandler(recompact_tagtable);
View Full Code Here

  public void autoSuggestTag(final String tag) {
    // First try to see if the tag is already in the table.
    final int nrows = tagtable.getRowCount();
    int unused_row = -1;
    for (int row = 1; row < nrows; row++) {
      final SuggestBox tagname = ((SuggestBox) tagtable.getWidget(row, 1));
      final SuggestBox tagvalue = ((SuggestBox) tagtable.getWidget(row, 2));
      final String thistag = tagname.getValue();
      if (thistag.equals(tag)) {
        return// This tag is already in the table.
      } if (thistag.isEmpty() && tagvalue.getValue().isEmpty()) {
        unused_row = row;
        break;
      }
    }
    if (unused_row >= 0) {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.SuggestBox$DefaultSuggestionDisplay

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.