edu.rice.cs.drjava.model.javadoc
Interface JavadocModel

All Known Implementing Classes:
DefaultJavadocModel, NoJavadocAvailable

public interface JavadocModel

Model interface for Javadoc integration features. Note: Implementors should have a constructor taking an IGetDocuments.

Version:
$Id: JavadocModel.java 5175 2010-01-20 08:46:32Z mgricken $

Field Summary
static java.lang.String SUGGESTED_DIR_NAME
          Name for the suggested destination directory to be placed in the source root of one of the open documents.
 
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.
 java.io.File suggestJavadocDestination(OpenDefinitionsDocument doc)
          Suggests a default location for generating Javadoc, based on the given document's source root.
 

Field Detail

SUGGESTED_DIR_NAME

static final java.lang.String SUGGESTED_DIR_NAME
Name for the suggested destination directory to be placed in the source root of one of the open documents. (Value is "doc".)

See Also:
Constant Field Values
Method Detail

isAvailable

boolean isAvailable()
true iff the classes to run javadoc are available


addListener

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

Parameters:
listener - a listener that reacts to Javadoc events

removeListener

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

Parameters:
listener - a listener that reacts to Javadoc events

removeAllListeners

void removeAllListeners()
Removes all JavadocListeners from this model.


getJavadocErrorModel

CompilerErrorModel getJavadocErrorModel()
Accessor for the Javadoc error model.


resetJavadocErrors

void resetJavadocErrors()
Clears all current Javadoc errors.


suggestJavadocDestination

java.io.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.)

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

javadocAll

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

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:
java.io.IOException - if there is a problem manipulating files

javadocDocument

void javadocDocument(OpenDefinitionsDocument doc,
                     FileSaveSelector saver)
                     throws java.io.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.

Parameters:
doc - Document to generate Javadoc for
saver - a command object for saving the document (if it moved/changed)
Throws:
java.io.IOException - if there is a problem manipulating files