コード例 #1
0
  /**
   * Constructs a BasicSearchResultsModel with the specified search details, search request object,
   * and services.
   */
  public BasicSearchResultsModel(
      SearchInfo searchInfo,
      Search search,
      PropertiableHeadings propertiableHeadings,
      DownloadListManager downloadListManager,
      SaveLocationExceptionHandler saveLocationExceptionHandler) {

    this.searchInfo = searchInfo;
    this.search = search;
    this.downloadListManager = downloadListManager;
    this.saveLocationExceptionHandler = saveLocationExceptionHandler;

    // Create list of all search results.
    allSearchResults = new BasicEventList<SearchResult>();

    // Create list of search results grouped by URN.
    GroupingList<SearchResult> groupingListUrns =
        GlazedListsFactory.groupingList(allSearchResults, new UrnComparator());

    // Create list of visual search results where each element represents
    // a single group.
    groupedUrnResults =
        GlazedListsFactory.functionList(
            groupingListUrns, new SearchResultGrouper(resultCount, propertiableHeadings));

    // Create observable list that fires an event when results are modified.
    observableList =
        GlazedListsFactory.observableElementList(
            groupedUrnResults, GlazedLists.beanConnector(VisualSearchResult.class));

    // Create filtered list.
    filteredResultList = GlazedListsFactory.filterList(observableList);

    // Initialize display category and sorted list.
    setSelectedCategory(searchInfo.getSearchCategory());
  }
コード例 #2
0
 @Override
 public String getSearchQuery() {
   return searchInfo.getSearchQuery();
 }
コード例 #3
0
 @Override
 public SearchCategory getSearchCategory() {
   return searchInfo.getSearchCategory();
 }