|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.javadoc.DefaultJavadocModel
public class DefaultJavadocModel
Default implementation of JavadocModel interface; generates Javadoc HTML files for a set of documents.
| Field Summary | |
|---|---|
private CompilerErrorModel |
_javadocErrorModel
The error model containing all current Javadoc errors. |
private JVMBuilder |
_jvmBuilder
Launcher for javadoc process |
private GlobalModel |
_model
Used by CompilerErrorModel to open documents that have errors. |
private JavadocEventNotifier |
_notifier
Manages listeners to this model. |
| Fields inherited from interface edu.rice.cs.drjava.model.javadoc.JavadocModel |
|---|
SUGGESTED_DIR_NAME |
| Constructor Summary | |
|---|---|
DefaultJavadocModel(GlobalModel model,
File javaCommand,
Iterable<File> toolsPath)
Main constructor. |
|
| Method Summary | |
|---|---|
private void |
_attemptSaveAllDocuments()
If any documents are modified, this gives the user a chance to save them before proceeding. |
private List<DJError> |
_extractErrors(String text)
Reads through javadoc output text, looking for Javadoc errors. |
private File |
_getFileFromDocument(OpenDefinitionsDocument doc,
FileSaveSelector saver)
Attempts to get the file from the given document. |
private Iterable<String> |
_getLinkArgs()
|
private void |
_javadocAllWorker(File destDirFile,
FileSaveSelector saver)
This method handles most of the logic of performing a Javadoc operation, once we know that it won't be canceled. |
private void |
_notifyCompileBeforeJavadoc(CompilerListener afterCompile)
Helper method to notify JavadocModel listeners that all open files must be compiled before Javadoc is run. |
private DJError |
_parseJavadocErrorLine(String line)
Convert a line of Javadoc text to a DJError. |
private void |
_rawJavadocDocument(File file)
|
private void |
_runJavadoc(Iterable<String> files,
File destDir,
Iterable<String> extraArgs,
boolean allDocs)
Run a new process to generate javdocs, and then tell the listeners when we're done. |
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 |
|---|
private GlobalModel _model
private final JavadocEventNotifier _notifier
private final JVMBuilder _jvmBuilder
private CompilerErrorModel _javadocErrorModel
| Constructor Detail |
|---|
public DefaultJavadocModel(GlobalModel model,
File javaCommand,
Iterable<File> toolsPath)
model - Source of documents for this JavadocModeljavaCommand - Location of the java command to use (null means the default: java.home)toolsPath - Location of the tools library containing the javadoc code (null means the default:
javaCommand's boot class path)| Method Detail |
|---|
public boolean isAvailable()
JavadocModeltrue iff the classes to run javadoc are available
isAvailable in interface JavadocModelpublic void addListener(JavadocListener listener)
addListener in interface JavadocModellistener - a listener that reacts to Javadoc eventspublic void removeListener(JavadocListener listener)
removeListener in interface JavadocModellistener - a listener that reacts to Javadoc eventspublic void removeAllListeners()
removeAllListeners in interface JavadocModelpublic CompilerErrorModel getJavadocErrorModel()
getJavadocErrorModel in interface JavadocModelpublic void resetJavadocErrors()
resetJavadocErrors in interface JavadocModel
public void javadocAll(DirectorySelector select,
FileSaveSelector saver)
throws IOException
javadocAll in interface JavadocModelselect - a command object for selecting a directory and warning a user about bad inputsaver - a command object for saving a document (if it moved/changed)
IOException - if there is a problem manipulating files
private void _javadocAllWorker(File destDirFile,
FileSaveSelector saver)
destDirFile - the destination directory for the doc filessaver - a command object for saving a document (if it moved/changed)
public void javadocDocument(OpenDefinitionsDocument doc,
FileSaveSelector saver)
throws IOException
javadocDocument in interface JavadocModeldoc - Document to generate Javadoc forsaver - a command object for saving the document (if it moved/changed)
IOException - if there is a problem manipulating files
private void _rawJavadocDocument(File file)
throws IOException
IOExceptionprivate void _notifyCompileBeforeJavadoc(CompilerListener afterCompile)
public File suggestJavadocDestination(OpenDefinitionsDocument doc)
suggestJavadocDestination in interface JavadocModeldoc - Document with the source root to use as the default.
private void _attemptSaveAllDocuments()
private void _runJavadoc(Iterable<String> files,
File destDir,
Iterable<String> extraArgs,
boolean allDocs)
files - List of files to generatedestDir - Directory where the results are being savedextraArgs - List of additional arguments to use with javadoc (besides those gathered from config settings)allDocs - Whether this is running on all documents. If Javadoc is not run on all documents, the target directory will be deleted when DrJava exitsprivate Iterable<String> _getLinkArgs()
private List<DJError> _extractErrors(String text)
private DJError _parseJavadocErrorLine(String line)
null.
private File _getFileFromDocument(OpenDefinitionsDocument doc,
FileSaveSelector saver)
throws IOException
doc - OpenDefinitionsDocument from which to get the filesaver - FileSaveSelector to allow the user to save the file if it has moved.
IllegalStateException - if the doc has no file (hasn't been saved)
IOException - if the file can't be saved after it was moved
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||