KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > JavadocModel


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2006 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.model;
35
36 import java.io.File JavaDoc;
37 import java.io.IOException JavaDoc;
38
39 import edu.rice.cs.drjava.model.compiler.CompilerErrorModel;
40 import edu.rice.cs.util.DirectorySelector;
41
42 /**
43  * Model interface for Javadoc integration features.
44  * Note: Implementors should have a constructor taking an IGetDocuments.
45  * @version $Id: JavadocModel.java 3901 2006-06-30 05:28:11Z rcartwright $
46  */

47 public interface JavadocModel {
48   /**
49    * Name for the suggested destination directory to be placed in the
50    * source root of one of the open documents. (Value is "doc".)
51    */

52   public static final String JavaDoc SUGGESTED_DIR_NAME = "doc";
53   
54   /**
55    * Add a JavadocListener to the model.
56    * @param listener a listener that reacts to Javadoc events
57    */

58   public void addListener(JavadocListener listener);
59
60   /**
61    * Remove a JavadocListener from the model. If the listener is not currently
62    * listening to this model, this method has no effect.
63    * @param listener a listener that reacts to Javadoc events
64    */

65   public void removeListener(JavadocListener listener);
66
67   /** Removes all JavadocListeners from this model. */
68   public void removeAllListeners();
69   
70   /** Accessor for the Javadoc error model. */
71   public CompilerErrorModel getJavadocErrorModel();
72   
73   /** Clears all current Javadoc errors. */
74   public void resetJavadocErrors();
75   
76   /**
77    * Suggests a default location for generating Javadoc, based on the given
78    * document's source root. (Appends JavadocModel.SUGGESTED_DIR_NAME to
79    * the sourceroot.)
80    * @param doc Document with the source root to use as the default.
81    * @return Suggested destination directory, or null if none could be
82    * determined.
83    */

84   public File JavaDoc suggestJavadocDestination(OpenDefinitionsDocument doc);
85   
86   /**
87    * Javadocs all open documents, after ensuring that all are saved.
88    * The user provides a destination, and the gm provides the package info.
89    *
90    * @param select a command object for selecting a directory and warning a user
91    * about bad input
92    * @param saver a command object for saving a document (if it moved/changed)
93    * @param classPath a collection of classpath elements to be used by Javadoc
94    *
95    * @throws IOException if there is a problem manipulating files
96    */

97   public void javadocAll(DirectorySelector select, FileSaveSelector saver,
98                          String JavaDoc classPath)
99     throws IOException JavaDoc;
100   
101   /**
102    * Generates Javadoc for the given document only, after ensuring it is saved.
103    * Saves the output to a temporary directory, which is provided in the
104    * javadocEnded event on the provided listener.
105    *
106    * @param doc Document to generate Javadoc for
107    * @param saver a command object for saving the document (if it moved/changed)
108    * @param classPath a collection of classpath elements to be used by Javadoc
109    *
110    * @throws IOException if there is a problem manipulating files
111    */

112   public void javadocDocument(final OpenDefinitionsDocument doc,
113                               final FileSaveSelector saver,
114                               final String JavaDoc classPath)
115     throws IOException JavaDoc;
116 }
117
Popular Tags