KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > CodeGenerator


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
21 package org.netbeans.modules.form;
22
23 import org.openide.nodes.Node;
24
25 /**
26  *
27  * @author Ian Formanek
28  */

29 public abstract class CodeGenerator {
30
31     /**
32      * initializes a CodeGenerator for a given FormModel
33      * @param formModel a FormModel object
34      */

35     public abstract void initialize(FormModel formModel);
36
37     /**
38      * Alows the code generator to provide synthetic properties for specified
39      * component which are specific to the code generation method. E.g. a
40      * JavaCodeGenerator will return variableName property, as it generates
41      * global Java variable for every component
42      * @param component The RADComponent for which the properties are to be
43      * obtained
44      */

45
46     public Node.Property[] getSyntheticProperties(RADComponent component) {
47         return new Node.Property[0];
48     }
49
50     /**
51      * Generates the specified event handler, if it does not exist yet.
52      * @param handlerName The name of the event handler
53      * @param paramTypes the list of event handler parameter types
54      * @param bodyText the body text of the event handler or null for default
55      *(empty) one
56      * @return true if the event handler have not existed yet and was creaated,
57      * false otherwise
58      */

59
60 // public abstract boolean generateEventHandler(String handlerName,
61
// String[] paramTypes,
62
// String[] exceptTypes,
63
// String bodyText);
64

65     /**
66      * Changes the text of the specified event handler, if it already exists.
67      * @param handlerName The name of the event handler
68      * @param paramTypes the list of event handler parameter types
69      * @param bodyText the new body text of the event handler or null for default
70      *(empty) one
71      * @return true if the event handler existed and was modified, false
72      * otherwise
73      */

74
75 // public abstract boolean changeEventHandler(final String handlerName,
76
// final String[] paramTypes,
77
// final String[] exceptTypes,
78
// final String bodyText);
79

80     /**
81      * Removes the specified event handler - removes the whole method together
82      * with the user code!
83      * @param handlerName The name of the event handler
84      */

85
86 // public abstract boolean deleteEventHandler(String handlerName);
87

88     /**
89      * Renames the specified event handler to the given new name.
90      * @param oldHandlerName The old name of the event handler
91      * @param newHandlerName The new name of the event handler
92      * @param paramTypes the list of event handler parameter types
93      */

94
95 // public abstract boolean renameEventHandler(String oldHandlerName,
96
// String newHandlerName,
97
// String[] exceptTypes,
98
// String[] paramTypes);
99

100     /**
101      * Gets the body (text) of event handler of given name.
102      * @param handlerName name of the event handler
103      * @return text of the event handler body
104      */

105
106 // public abstract String getEventHandlerText(String handlerName);
107

108     /** Focuses the specified event handler in the editor. */
109
110 // public abstract void gotoEventHandler(String handlerName);
111

112     /**
113      * Returns whether the specified event handler is empty (with no user
114      * code). Empty handlers can be deleted without user confirmation.
115      * @return true if the event handler exists and is empty
116      */

117 // public boolean isEventHandlerEmpty(String handlerName) {
118
// return false;
119
// }
120
}
121
Popular Tags