Package honeycrm.client.view

Examples of honeycrm.client.view.FulltextSuggestOracle


  protected final Map<String, Dto> nameToDto = new HashMap<String, Dto>();
  private final ReadServiceAsync readService;
  private final LocalizedMessages constants;

  public FulltextSearchView(final ReadServiceAsync readService, final LocalizedMessages constants) {
    super(new FulltextSuggestOracle());
   
    this.readService = readService;
    this.constants = constants;
   
    setupFocusAndBlur();
View Full Code Here


  protected void startFulltextSearch(final String queryString) {
    readService.fulltextSearch(queryString, 0, 10, new AsyncCallback<ListQueryResult>() {
      @Override
      public void onSuccess(ListQueryResult result) {
        if (null != result && result.getItemCount() > 0) {
          final FulltextSuggestOracle o = emptySuggestOracle();
          final Map<String, Integer> quicksearchLabels = new HashMap<String, Integer>();

          for (final Dto a : result.getResults()) {
            String label = a.getQuicksearch();

            if (quicksearchLabels.containsKey(label)) {
              quicksearchLabels.put(label, quicksearchLabels.get(label) + 1);
              // add a counter for this label since it is not unique
              label = label + " (" + quicksearchLabels.get(label) + ")";
            } else {
              quicksearchLabels.put(label, 1);
            }

            // insert this label into the name to id translation map to make sure that
            // later the id can be determined by looking up the name in this map.
            nameToDto.put(label, a);

            o.add(label);
          }

          showSuggestionList();
        }
      }
View Full Code Here

  /**
   * Empty the current suggestion oracle and return it.
   */
  protected FulltextSuggestOracle emptySuggestOracle() {
    final FulltextSuggestOracle o = (FulltextSuggestOracle) getSuggestOracle();
    o.clear();
    return o;
  }
View Full Code Here

TOP

Related Classes of honeycrm.client.view.FulltextSuggestOracle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.