Java 类com.google.gwt.user.client.ui.MultiWordSuggestOracle 实例源码

项目:Wiab.pro    文件:EditorHarness.java   
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);
    }
  }
}
项目:caja    文件:PlaygroundView.java   
public PlaygroundView(Playground controller) {
  this.controller = controller;
  this.sourceExamples = new MultiWordSuggestOracle();
  this.policyExamples = new MultiWordSuggestOracle();

  this.playgroundUI =
    new com.google.caja.demos.playground.client.ui.PlaygroundUI(
        sourceExamples, policyExamples);
  RootLayoutPanel.get().add(playgroundUI);
  initSourcePanel();
  initPolicyPanel();
  initFeedbackPanel();
  initExamples();
  initEditor();
  initCaja(true);
  initPlusOne();
  initUnsafe();
}
项目:google-apis-explorer    文件:EnumEditor.java   
EnumEditorViewImpl(final List<String> enumValues, final List<String> enumDescriptions) {
  // Sets up a SuggestOracle that, when the textbox has focus, displays the
  // valid enum values and their descriptions.
  MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
  List<Suggestion> suggestions = Lists.newArrayList();
  for (int i = 0; i < enumValues.size(); i++) {
    suggestions.add(new EnumSuggestion(
        enumValues.get(i), enumDescriptions == null ? "" : enumDescriptions.get(i)));
  }
  oracle.setDefaultSuggestions(suggestions);
  this.suggestBox = new SuggestBox(oracle);
  suggestBox.getTextBox().addFocusHandler(new FocusHandler() {
    @Override
    public void onFocus(FocusEvent event) {
      suggestBox.showSuggestionList();
    }
  });
  add(suggestBox);

  this.errorMessage = new Label("This parameter is invalid.");
  errorMessage.setVisible(false);
  add(errorMessage);
}
项目:incubator-wave    文件:EditorHarness.java   
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);
    }
  }
}
项目:Peergos    文件:CwSuggestBox.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Define the oracle that finds suggestions
  MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
  String[] words = constants.cwSuggestBoxWords();
  for (int i = 0; i < words.length; ++i) {
    oracle.add(words[i]);
  }

  // Create the suggest box
  final SuggestBox suggestBox = new SuggestBox(oracle);
  suggestBox.ensureDebugId("cwSuggestBox");
  VerticalPanel suggestPanel = new VerticalPanel();
  suggestPanel.add(new HTML(constants.cwSuggestBoxLabel()));
  suggestPanel.add(suggestBox);

  // Return the panel
  return suggestPanel;
}
项目:swarm    文件:CwSuggestBox.java   
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Define the oracle that finds suggestions
  MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
  String[] words = constants.cwSuggestBoxWords();
  for (int i = 0; i < words.length; ++i) {
    oracle.add(words[i]);
  }

  // Create the suggest box
  final SuggestBox suggestBox = new SuggestBox(oracle);
  suggestBox.ensureDebugId("cwSuggestBox");
  VerticalPanel suggestPanel = new VerticalPanel();
  suggestPanel.add(new HTML(constants.cwSuggestBoxLabel()));
  suggestPanel.add(suggestBox);

  // Return the panel
  return suggestPanel;
}
项目:ephesoft    文件:TableExtractionView.java   
private MultiWordSuggestOracle setMultiWordOracle(final String value, final List<String> alternateValues) {
    MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
    String actualvalue = null == value ? "" : value;
    oracle.add(actualvalue);
    for (String altValue : alternateValues) {
        oracle.add(altValue);
    }
    return oracle;
}
项目:285_02_FA15G4    文件:SearchWidget.java   
public SearchWidget(MainWidget master) {
    this.master = master;
    panel = new VerticalPanel();
    searchbar = new HorizontalPanel();
    searchbar.setHeight("100px");
    scrollable = new ScrollPanel();
    scrollable.setHeight("400px");
    oracle = new MultiWordSuggestOracle();
    box = new SuggestBox(oracle);
    b = new Button("Search");
    box.setWidth("200px");
    lbl = new Label("Enter Search Criteria");

    BuildUI();
}
项目:caja    文件:PlaygroundUI.java   
public PlaygroundUI(MultiWordSuggestOracle sourceSuggestions,
    MultiWordSuggestOracle policySuggestions) {
  addressField = new SuggestBox(sourceSuggestions);
  policyAddressField = new SuggestBox(policySuggestions);

  initWidget(UI_BINDER.createAndBindUi(this));
}
项目:gwtutil    文件:TypeaheadWrapper.java   
public void fill(Collection<T> data) {
    MultiWordSuggestOracle suggestOracle = (MultiWordSuggestOracle) decorated.getSuggestOracle();
    suggestOracle.clear();
    objects.clear();
    for (T elem : data) {
        String title = elem.getListboxValue();
        suggestOracle.add(title);
        objects.put(title, elem);
    }
}
项目:gwtutil    文件:TypeaheadBox.java   
public MultiWordSuggestOracle getSuggestOracle() {
    return (MultiWordSuggestOracle) typeahead.getSuggestOracle();
}
项目:dtgov    文件:WorkflowQueryPropertiesTable.java   
/**
 * Constructor.
 */
public WorkflowQueryPropertiesTable() {
    keyDefaultValues = new MultiWordSuggestOracle();
    properties = new ArrayList<WorkflowQueryProperty>();
}
项目:gwtbootstrap3    文件:SuggestBox.java   
/**
 * Constructor for {@link SuggestBox}. Creates a {@link MultiWordSuggestOracle} and {@link TextBox} to use
 * with this {@link SuggestBox}.
 */
public SuggestBox() {
    this(new MultiWordSuggestOracle());
}
项目:dtgov    文件:WorkflowQueryPropertiesTable.java   
/**
 * Gets the key default values.
 * 
 * @return the key default values
 */
public MultiWordSuggestOracle getKeyDefaultValues() {
    return keyDefaultValues;
}
项目:dtgov    文件:WorkflowQueryPropertiesTable.java   
/**
 * Sets the key default values.
 * 
 * @param keyDefaultValues
 *            the new key default values
 */
public void setKeyDefaultValues(MultiWordSuggestOracle keyDefaultValues) {
    this.keyDefaultValues = keyDefaultValues;
}