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

java.lang.Object
  extended by edu.rice.cs.drjava.model.javadoc.NoJavadocAvailable
All Implemented Interfaces:
JavadocModel

public class NoJavadocAvailable
extends Object
implements JavadocModel

Javadoc model to use when javadoc is unavailable.

Version:
$Id: NoJavadocAvailable.java 5553 2012-05-01 17:28:45Z rcartwright $

Field Summary
private  CompilerErrorModel _javadocErrorModel
           
private  JavadocEventNotifier _notifier
           
 
Fields inherited from interface edu.rice.cs.drjava.model.javadoc.JavadocModel
SUGGESTED_DIR_NAME
 
Constructor Summary
NoJavadocAvailable(GlobalModel model)
           
 
Method Summary
 void addListener(JavadocListener listener)
          Add a JavadocListener to the model.
 CompilerErrorModel getJavadocErrorModel()
          Accessor for the Javadoc error model.
 boolean isAvailable()
          true iff the classes to run javadoc are available
 void javadocAll(DirectorySelector select, FileSaveSelector saver)
          Javadocs all open documents, after ensuring that all are saved.
 void javadocDocument(OpenDefinitionsDocument doc, FileSaveSelector saver)
          Generates Javadoc for the given document only, after ensuring it is saved.
 void removeAllListeners()
          Removes all JavadocListeners from this model.
 void removeListener(JavadocListener listener)
          Remove a JavadocListener from the model.
 void resetJavadocErrors()
          Clears all current Javadoc errors.
 File suggestJavadocDestination(OpenDefinitionsDocument doc)
          Suggests a default location for generating Javadoc, based on the given document's source root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_notifier

private final JavadocEventNotifier _notifier

_javadocErrorModel

private final CompilerErrorModel _javadocErrorModel
Constructor Detail

NoJavadocAvailable

public NoJavadocAvailable(GlobalModel model)
Method Detail

isAvailable

public boolean isAvailable()
Description copied from interface: JavadocModel
true iff the classes to run javadoc are available

Specified by:
isAvailable in interface JavadocModel

addListener

public void addListener(JavadocListener listener)
Add a JavadocListener to the model.

Specified by:
addListener in interface JavadocModel
Parameters:
listener - a listener that reacts to Javadoc events

removeListener

public void removeListener(JavadocListener listener)
Remove a JavadocListener from the model. If the listener is not instaled, this method has no effect.

Specified by:
removeListener in interface JavadocModel
Parameters:
listener - a listener that reacts to Javadoc events

removeAllListeners

public void removeAllListeners()
Removes all JavadocListeners from this model.

Specified by:
removeAllListeners in interface JavadocModel

getJavadocErrorModel

public CompilerErrorModel getJavadocErrorModel()
Accessor for the Javadoc error model.

Specified by:
getJavadocErrorModel in interface JavadocModel

resetJavadocErrors

public void resetJavadocErrors()
Clears all current Javadoc errors.

Specified by:
resetJavadocErrors in interface JavadocModel

suggestJavadocDestination

public File suggestJavadocDestination(OpenDefinitionsDocument doc)
Suggests a default location for generating Javadoc, based on the given document's source root. (Appends JavadocModel.SUGGESTED_DIR_NAME to the sourceroot.)

Specified by:
suggestJavadocDestination in interface JavadocModel
Parameters:
doc - Document with the source root to use as the default.
Returns:
Suggested destination directory, or null if none could be determined.

javadocAll

public void javadocAll(DirectorySelector select,
                       FileSaveSelector saver)
                throws IOException
Javadocs all open documents, after ensuring that all are saved. The user provides a destination, and the gm provides the package info.

Specified by:
javadocAll in interface JavadocModel
Parameters:
select - a command object for selecting a directory and warning a user about bad input
saver - a command object for saving a document (if it moved/changed)
Throws:
IOException - if there is a problem manipulating files

javadocDocument

public void javadocDocument(OpenDefinitionsDocument doc,
                            FileSaveSelector saver)
                     throws IOException
Generates Javadoc for the given document only, after ensuring it is saved. Saves the output to a temporary directory, which is provided in the javadocEnded event on the provided listener.

Specified by:
javadocDocument in interface JavadocModel
Parameters:
doc - Document to generate Javadoc for
saver - a command object for saving the document (if it moved/changed)
Throws:
IOException - if there is a problem manipulating files