KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > forminfo > FormInfo


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 package org.netbeans.modules.form.forminfo;
21
22 import java.awt.Container JavaDoc;
23 import org.openide.nodes.Node;
24
25 /** FormInfo is a class which provides information specific to certain form
26  * type. E.g. for a JFrame form, the top-level bean is the JFrame itself, the
27  * top-level container is its getContentPane(), and the top-level container
28  * generation string is "getContentPane().".
29  *
30  * @author Ian Formanek
31  *
32  * @deprecated
33  */

34
35 public abstract class FormInfo
36 {
37     /** Constant for empty list of properties */
38     public final static Node.Property[] NO_PROPERTIES = new Node.Property[0];
39
40     /** Used to create the design-time instance of the form object, which is used
41      * only for displaing properties and events of the form. I.e. it is not
42      * displayed visually, instead the FormTopComponent is used with the
43      * container provided from <code>getTopContainer()</code> method.
44      * @return the instance of the form
45      * @see #getTopContainer
46      */

47     public abstract Object JavaDoc getFormInstance();
48
49     /** Used to provide the container which is used during design-time as the
50      * top-level container. The container provided by this class should not be a
51      * Window, as it is added as a component to the FormTopComponent, rather a
52      * JPanel, Panel or JDesktopPane should be used according to the form type.
53      * By returning a <code>null</code> value, the form info declares that it
54      * does not represent a "visual" form and the visual editing should not be
55      * used with it.
56      * @return the top level container which will be used during design-time or
57      * null if the form is not visual
58      */

59     public abstract Container JavaDoc getTopContainer();
60
61     /** Used to provide the container which is used during design-time as the
62      * top-level container for adding components. The container provided by this
63      * class should not be a Window, as it is added as a component to the
64      * FormTopComponent, rather a JPanel, Panel or JDesktopPane should be used
65      * according to the form type. By returning a <code>null</code> value, the
66      * form info declares that it does not represent a "visual" form and the
67      * visual editing should not be used with it. The default implementation
68      * returns the same value as getTopContainer() method .
69      * @return the top level container which will be used during design-time or
70      * null if the form is not visual
71      */

72     public Container JavaDoc getTopAddContainer() {
73         return getTopContainer();
74     }
75
76     /** By overriding this method, the form info can specify a string which is
77      * used to add top-level components - i.e. for java.awt.Frame, the default
78      *(empty string) implementation is used, while for javax.swing.JFrame a
79      * <code>"getContentPane()."</code> will be returned.
80      * @return the String to be used for adding to the top-level container
81      * @see #getTopContainer
82      */

83     public String JavaDoc getContainerGenName() {
84         return ""; // NOI18N
85
}
86 }
87
Popular Tags