edu.rice.cs.drjava.model.javadoc
Class JavadocEventNotifier

java.lang.Object
  extended by edu.rice.cs.drjava.model.EventNotifier<JavadocListener>
      extended by edu.rice.cs.drjava.model.javadoc.JavadocEventNotifier
All Implemented Interfaces:
JavadocListener

 class JavadocEventNotifier
extends EventNotifier<JavadocListener>
implements JavadocListener

Keeps track of all listeners to a JavadocModel, and has the ability to notify them of some event.

This class has a specific role of managing JavadocListeners. Other classes with similar names use similar code to perform the same function for other interfaces, e.g. InteractionsEventNotifier and GlobalEventNotifier. These classes implement the appropriate interface definition so that they can be used transparently as composite packaging for a particular listener interface.

Components which might otherwise manage their own list of listeners use EventNotifiers instead to simplify their internal implementation. Notifiers should therefore be considered a private implementation detail of the components, and should not be used directly outside of the "host" component.

All methods in this class must use the synchronization methods provided by ReaderWriterLock. This ensures that multiple notifications (reads) can occur simultaneously, but only one thread can be adding or removing listeners (writing) at a time, and no reads can occur during a write.

No methods on this class should be synchronized using traditional Java synchronization!

Version:
$Id: JavadocEventNotifier.java 5236 2010-04-27 01:43:36Z mgricken $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.model.EventNotifier
_listeners, _lock
 
Constructor Summary
JavadocEventNotifier()
           
 
Method Summary
 void compileBeforeJavadoc(CompilerListener afterCompile)
          Asks the user if all files should be compiled before running javadoc (assuming the proper listener has been installed).
 void javadocEnded(boolean success, File destDir, boolean allDocs)
          Called after Javadoc is finished.
 void javadocStarted()
          Called after Javadoc is started by the GlobalModel.
 void saveBeforeJavadoc()
          Asks the user if all files should be saved before running javadoc (assuming the proper listener has been installed).
 
Methods inherited from class edu.rice.cs.drjava.model.EventNotifier
addListener, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavadocEventNotifier

JavadocEventNotifier()
Method Detail

javadocStarted

public void javadocStarted()
Called after Javadoc is started by the GlobalModel.

Specified by:
javadocStarted in interface JavadocListener

javadocEnded

public void javadocEnded(boolean success,
                         File destDir,
                         boolean allDocs)
Called after Javadoc is finished.

Specified by:
javadocEnded in interface JavadocListener
Parameters:
success - whether the Javadoc operation generated proper output
destDir - if (success == true) the location where the output was generated, otherwise undefined (null?)
allDocs - Whether Javadoc was run for all open documents

saveBeforeJavadoc

public void saveBeforeJavadoc()
Asks the user if all files should be saved before running javadoc (assuming the proper listener has been installed). Does not continue with javadoc if the user fails to save!

Specified by:
saveBeforeJavadoc in interface JavadocListener

compileBeforeJavadoc

public void compileBeforeJavadoc(CompilerListener afterCompile)
Asks the user if all files should be compiled before running javadoc (assuming the proper listener has been installed). Does not continue with javadoc if the user fails to save!

Specified by:
compileBeforeJavadoc in interface JavadocListener