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

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

public class CollectionDataset<T>
extends Dataset<T>

A Dataset operating on a collection of values.

Author:
Florian Kremser

Constructor Summary
CollectionDataset(Collection<T> data)
           
 
Method Summary
 void findMatches(String query, SuggestionCallback<T> callback)
          Find all Suggestions matching a search query and pass them to the callback.
 Collection<T> getData()
           
 String getValue(T datum)
          Return the (display) value associated with a particular datum.
 void setData(Collection<T> data)
           
 
Methods inherited from class org.gwtbootstrap3.extras.typeahead.client.base.Dataset
equals, getEmptyTemplate, getFooterTemplate, getHeaderTemplate, getName, getSuggestionTemplate, hashCode, setEmptyTemplate, setFooterTemplate, setHeaderTemplate, setName, setSuggestionTemplate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionDataset

public CollectionDataset(Collection<T> data)
Method Detail

getData

public Collection<T> getData()

setData

public void setData(Collection<T> data)

getValue

public String getValue(T datum)
Return the (display) value associated with a particular datum. If the given datum is selected from the suggestions, then value will be set as text of the input.

Parameters:
datum - a datum instance from this Dataset
Returns:
the text representing the data

findMatches

public void findMatches(String query,
                        SuggestionCallback<T> callback)
Description copied from class: Dataset
Find all Suggestions matching a search query and pass them to the callback.

Specified by:
findMatches in class Dataset<T>
Parameters:
query - the user input
callback - callback for suggestions


Copyright © 2015. All rights reserved.