Example usage for com.google.gwt.search.client SearchControl addSearchStartingHandler

List of usage examples for com.google.gwt.search.client SearchControl addSearchStartingHandler

Introduction

In this page you can find the example usage for com.google.gwt.search.client SearchControl addSearchStartingHandler.

Prototype

public void addSearchStartingHandler(SearchStartingHandler handler) 

Source Link

Document

Adds a SearchStartingHandler to inform the search control that the caller would like to be notified when a search starts.

Usage

From source file:com.google.gwt.search.sample.hellosearch.client.HelloSearch.java

License:Apache License

public void onApiLoad() {
    SearchControlOptions options = new SearchControlOptions();

    // We can use custom subclasses
    options.add(new GoogleCodeWebSearch(), ExpandMode.OPEN);

    // Or configure inline
    WebSearch ws = new WebSearch();
    ws.setSiteRestriction("ajaxian.com");
    ws.setUserDefinedLabel("Ajaxian");
    ws.setResultSetSize(ResultSetSize.SMALL);
    options.add(ws);/*from  w  w w  .ja va2  s .com*/
    options.add(new BookSearch());
    options.add(new NewsSearch());
    options.add(new VideoSearch(), ExpandMode.CLOSED);
    options.add(new ImageSearch());
    options.setKeepLabel(KeepLabel.SAVE);
    options.setLinkTarget(LinkTarget.BLANK);

    SearchControl searchControl = new SearchControl(options);
    searchControl.addKeepHandler(this);
    searchControl.addSearchResultsHandler(this);
    searchControl.addSearchStartingHandler(this);
    searchControl.execute("Google Web Toolkit");
    hp.add(searchControl);
}