title: Progress listener passed through classes
body: <p>I have a class (SearchIndexManager) which does calculations:</p>
  
  <pre><code>public void buildSearchIndex(SwiftDocList docList, TagManager tm)
  {
          System.out.println("Building index...");
  
          // for indexing progress
          int nCounter = 0;
          for (SwiftDoc doc : docList)
          {
              // create a lucene doc to add to the index
              Document luceneDoc = makeLuceneDocument(doc);
  
              // ready to add the document
              indexer.addDocument(luceneDoc);
  
              // Some calculations
  
              // progress ( Thats how I measure progress)
              int nProgress = (int) (99 * ((double) ++nCounter / docList.size()));
          }
          // close the index
          indexer.close();
      }
  </code></pre>
  
  <p>I have another class which calls the above class.</p>
  
  <pre><code>mSearchManager = new SearchIndexManager();
  mSearchManager.buildSearchIndex(mAllDocs, mTagBrowserModel.getTagManager());
  </code></pre>
  
  <p>Then I have a GUI class, which calls above class and invokes the method of the first class, which does some calculations. I need to show the progress of these long calculations on GUI. How can I do that using some listeners.</p>