KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > codegen > TextBinding


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.java.codegen;
21
22 import java.util.Collection JavaDoc;
23
24 import org.openide.src.Element;
25 import org.openide.text.PositionBounds;
26
27 import org.netbeans.modules.java.bridge.Binding;
28
29 /**
30  * Interface for binding Elements to org.openide.text.* package.
31  *
32  * @author sdedic
33  * @version
34  */

35 public interface TextBinding extends Binding {
36     /** Bounds for the whole element.
37      */

38     public static final int BOUNDS_ALL = 0;
39
40     /** Bounds that will contain javadoc comment.
41      */

42     public static final int BOUNDS_JAVADOC = 1;
43     
44     /** Bounds that will contain the header of a method, declarator of a field,
45      * or header of a class.
46      */

47     public static final int BOUNDS_HEADER = 2;
48     
49     /** Bounds for body of a constructor/method/initializer/class, or init value
50      * for a field. Undefined otherwise.
51      */

52     public static final int BOUNDS_BODY = 3;
53
54     public static final int BOUNDS_FIELD_TYPE = 4;
55     
56     /** Bounds suitable for the package statement.
57      */

58     public static final int BOUNDS_PACKAGE = 10;
59     
60     public static final int BOUNDS_SOURCE = 10;
61     
62     /**
63      * Returns the associated java Element.
64      */

65     public org.openide.src.Element getElement();
66     
67     /**
68      * Returns the range occupied by the element.
69      * @param if true, the returned range will not include javadoc.
70      */

71     public PositionBounds getElementRange(boolean defRange);
72     
73     /**
74      * Returns a container of the specified type, or null if there is not any.
75      */

76     public Container getContainer(String JavaDoc containerType);
77     
78     /**
79      * Updates the specified bounds. Exact types can have element-specific meaning.
80      */

81     public void updateBounds(int boundsType, PositionBounds bounds);
82     
83     /**
84      * A special method for linking fields, that are declared in one declarator
85      * together.
86      */

87     public void linkAfter(TextBinding previousBinding);
88     
89     /** Extension for container bindings.
90      */

91     public interface Container extends Binding.Container {
92         public void updateChildren(Collection JavaDoc members);
93         public boolean isEmpty();
94     }
95     
96     public interface ExElement extends javax.swing.text.Element JavaDoc {
97         public org.openide.text.PositionRef getDeclarationStart();
98     }
99 }
100
Popular Tags