KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > navigation > actions > GenerateJavadocAction


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * GenerateJavadocAction.java
21  *
22  * Created on September 24, 2004, 11:59 PM
23  */

24
25 package org.netbeans.modules.java.navigation.actions;
26
27 import org.openide.util.*;
28
29 import javax.swing.*;
30 import java.awt.event.*;
31 import java.lang.UnsupportedOperationException JavaDoc;
32 import java.util.*;
33
34 /**
35  * Generates a javadoc stub.
36  *
37  * @author Tim Boudreau
38  */

39 public final class GenerateJavadocAction extends AbstractAction {
40     
41     //private final ClassMember member;
42

43     /**
44      * Creates a new instance of GenerateJavadocAction
45      */

46     public GenerateJavadocAction (/*ClassMember e*/) {
47         // this.member = e;
48
putValue ( NAME, NbBundle.getMessage ( GenerateJavadocAction.class,
49                 "LBL_GenJavadoc" ) ); //NOI18N
50
}
51
52     /** Renders template of Javadoc for asociated class member */
53     public void actionPerformed (ActionEvent ae) {
54         throw new UnsupportedOperationException JavaDoc( "Not rewritten to new Java Infrastructure" );
55         /*
56         StringBuffer sb = new StringBuffer ( 80 );
57         if ( member instanceof CallableFeature ) {
58             // [dafe] space on following line is intentional! it fixes #52881
59             sb.append ( " \n" ); //NOI18N
60             CallableFeature cf = ((CallableFeature) member);
61             for ( Iterator i = cf.getParameters ().iterator (); i.hasNext ();) {
62                 Parameter p = (Parameter) i.next ();
63                 sb.append ( " @param " ); //NOI18N
64                 sb.append ( p.getName () );
65                 sb.append ( " \n" );
66             }
67             Type t = cf.getType();
68             if (t != null && !"void".equals(t.getName())) {
69                 sb.append ("@return ");
70             }
71             
72             member.setJavadocText ( sb.toString () );
73         }
74         */

75     }
76
77     public boolean isEnabled () {
78         return false;
79 // return member != null && member.getJavadoc () == null &&
80
// member instanceof CallableFeature;
81
}
82     
83 }
84
Popular Tags