コード例 #1
0
ファイル: SearchManager2.java プロジェクト: steog88/jabref
  /**
   * Fires an event if a search was started / canceled
   *
   * @param t
   */
  private void fireSearchlistenerEvent(String t) {
    // parse the Search string to words
    ArrayList<String> words;
    if ((t == null) || (t.isEmpty())) {
      words = null;
    } else {
      words = getSearchwords(t);
    }

    // fire an event for every listener
    for (SearchTextListener s : listeners) {
      s.searchText(words);
    }
  }
コード例 #2
0
ファイル: SearchManager2.java プロジェクト: steog88/jabref
 /**
  * Subscribe to the SearchListener and receive events, if the user searches for some thing. You
  * will receive a list of words
  *
  * @param l
  */
 public void addSearchListener(SearchTextListener l) {
   if (listeners.contains(l)) {
     return;
   } else {
     listeners.add(l);
   }
   // fire event for the new subscriber
   l.searchText(getSearchwords(searchField.getText()));
 }