org.gwtbootstrap3.extras.typeahead.client.base
Class Dataset<T>

java.lang.Object
  extended by org.gwtbootstrap3.extras.typeahead.client.base.Dataset<T>
Direct Known Subclasses:
CollectionDataset

public abstract class Dataset<T>
extends Object

A Dataset represents a collection of suggestion objects for a Typeahead. A Typeahead is composed of one or more Datasets. When an end-user modifies the value of a Typeahead, each Dataset will attempt to render suggestions for the new value.

Author:
Florian Kremser

Constructor Summary
protected Dataset()
           
 
Method Summary
 boolean equals(Object o)
           
abstract  void findMatches(String query, SuggestionCallback<T> callback)
          Find all Suggestions matching a search query and pass them to the callback.
 Template getEmptyTemplate()
          Rendered when 0 suggestions are available for the given query.
 Template getFooterTemplate()
          Rendered at the bottom of the dataset.
 Template getHeaderTemplate()
          Rendered at the top of the dataset.
 String getName()
           
 SuggestionTemplate<T> getSuggestionTemplate()
          Renders a single suggestion.
 int hashCode()
           
 void setEmptyTemplate(Template emptyTemplate)
           
 void setFooterTemplate(Template footerTemplate)
           
 void setHeaderTemplate(Template headerTemplate)
           
 void setName(String name)
           
 void setSuggestionTemplate(SuggestionTemplate<T> suggestionTemplate)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dataset

protected Dataset()
Method Detail

getName

public String getName()

setName

public void setName(String name)

getEmptyTemplate

public Template getEmptyTemplate()
Rendered when 0 suggestions are available for the given query.

Returns:
a template to render in case of 0 results

setEmptyTemplate

public void setEmptyTemplate(Template emptyTemplate)

getFooterTemplate

public Template getFooterTemplate()
Rendered at the bottom of the dataset.

Returns:
a template to render at the bottom of the dataset

setFooterTemplate

public void setFooterTemplate(Template footerTemplate)

getHeaderTemplate

public Template getHeaderTemplate()
Rendered at the top of the dataset.

Returns:
a template to render at the top of the dataset

setHeaderTemplate

public void setHeaderTemplate(Template headerTemplate)

getSuggestionTemplate

public SuggestionTemplate<T> getSuggestionTemplate()
Renders a single suggestion.

Returns:
a template for rendering suggestions

setSuggestionTemplate

public void setSuggestionTemplate(SuggestionTemplate<T> suggestionTemplate)

findMatches

public abstract void findMatches(String query,
                                 SuggestionCallback<T> callback)
Find all Suggestions matching a search query and pass them to the callback.

Parameters:
query - the user input
callback - callback for suggestions

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015. All rights reserved.