Java Code Examples for com.google.gwt.user.client.ui.MultiWordSuggestOracle#add()

The following examples show how to use com.google.gwt.user.client.ui.MultiWordSuggestOracle#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditorHarness.java    From swellrt with Apache License 2.0 6 votes vote down vote up
void initContentOracle() {
  contentOracle = new MultiWordSuggestOracle();

  contentSuggestBox = new SuggestBox(contentOracle);
  contentSuggestBox.getElement().setId("content-box");

  // Some initial content xml strings
  contentOracle.add("");
  contentOracle.add("abcd");

  contentSuggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
    @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
      setFromContentBox();
    }
  });

  String[] extra = extendSampleContent();
  if (extra != null) {
    for (String content : extra) {
      contentOracle.add(content);
    }
  }
}
 
Example 2
Source File: EditorHarness.java    From incubator-retired-wave with Apache License 2.0 6 votes vote down vote up
void initContentOracle() {
  contentOracle = new MultiWordSuggestOracle();

  contentSuggestBox = new SuggestBox(contentOracle);
  contentSuggestBox.getElement().setId("content-box");

  // Some initial content xml strings
  contentOracle.add("");
  contentOracle.add("abcd");

  contentSuggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
    @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
      setFromContentBox();
    }
  });

  String[] extra = extendSampleContent();
  if (extra != null) {
    for (String content : extra) {
      contentOracle.add(content);
    }
  }
}
 
Example 3
Source File: HeapBoxItem.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Widget asWidget() {

    MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
    oracle.add("32m");
    oracle.add("64m");
    oracle.add("128m");
    oracle.add("256m");
    oracle.add("512m");
    oracle.add("1024m");

    setOracle(oracle);
    return super.asWidget();
}