public class FilterBuilderWindow {

private FilterBuilder createFilter() {
        FilterBuilder result = new FilterBuilder();
        result.setDataSource(testds);
        result.setSaveOnEnter(true);
        result.setFieldPickerWidth(200);
        result.setValueItemWidth(200);
        result.addSearchHandler(new SearchHandler() {

            @Override
            public void onSearch(FilterSearchEvent event) {
                // We focus the searchButton, this is mandatory as otherwise
                // the "exit" is not called on the currently focused text item
                // and thus its value is not store in the criteria ... To check
                // if SGWT correct this bug later.
                searchButton.focus();

                filterCallback.onFilter();
            }
        });
        return result;
    }
}	