}
private AutoCompleterController createTableSearchController(UserRequest ureq, WindowControl wControl) {
ListProvider genericProvider = new ListProvider() {
public void getResult(String searchValue, ListReceiver receiver) {
Set<String> searchEntries = new TreeSet();
// loop over hole data-model
for (int rowIndex=0; rowIndex < table.getUnfilteredTableDataModel().getRowCount(); rowIndex++) {
for (int colIndex=0; colIndex < table.getUnfilteredTableDataModel().getColumnCount(); colIndex++) {
Object obj = table.getUnfilteredTableDataModel().getValueAt(rowIndex, colIndex);
if (obj instanceof String) {
String valueString = (String)obj;
if (valueString.toLowerCase().indexOf(searchValue.toLowerCase()) != -1) {
if (searchEntries.add(valueString) ) {
// Add to receiver list same entries only once
if (searchEntries.size() == 1) {
// before first entry, add searchValue. But add only when one search match
receiver.addEntry( searchValue, null );
}
receiver.addEntry(valueString, null);
}