KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > javadoc > AutoCommenterField


1 package org.netbeans.modules.tasklist.javadoc;
2
3 import org.openide.src.ElementFormat;
4 import org.openide.src.FieldElement;
5 import org.openide.src.JavaDoc;
6 import org.openide.src.SourceException;
7 import org.netbeans.modules.tasklist.javadoc.ext.JavaTagNames;
8
9 public class AutoCommenterField extends AutoCommenterElement {
10
11     private static final String JavaDoc[] NOT_PERMITTED_TAGS = {
12         JavaTagNames.TAG_AUTHOR,
13         JavaTagNames.TAG_EXCEPTION,
14         JavaTagNames.TAG_PARAM,
15         JavaTagNames.TAG_RETURN,
16         JavaTagNames.TAG_SERIALDATA,
17         JavaTagNames.TAG_THROWS,
18         JavaTagNames.TAG_VERSION
19     };
20
21     private static final ElementFormat nameFormat = new ElementFormat( "{m} {t} {n}" ); // NOI18N
22

23     public AutoCommenterField( FieldElement element ) {
24         super( element );
25     }
26
27     JavaDoc getJavaDoc() {
28         return ((FieldElement)srcElement).getJavaDoc();
29     }
30
31     String JavaDoc[] getNotPermittedTags() {
32         return NOT_PERMITTED_TAGS;
33     }
34
35     String JavaDoc typeToString() {
36         return "field"; // NOI18N
37
}
38
39     boolean elementTagsOk() {
40         boolean error = false;
41         if (this.isMultipleTags(JavaTagNames.TAG_SERIAL)) {
42             error = true;
43         }
44
45         return !error;
46     }
47
48     void autoCorrect() throws SourceException {
49         super.autoCorrect( getJavaDoc() );
50     }
51
52     boolean isCorrectable() {
53         return super.isCorrectable();
54     }
55
56     ElementFormat getNameFormat () {
57         return nameFormat;
58     }
59 }
60
Popular Tags