KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > src > nodes > ClassElementFilter


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.openide.src.nodes;
21
22 import java.lang.reflect.Modifier JavaDoc;
23
24 /* ? --jglick
25 * For convenience, implementations of this interface could use
26 * {@link Modifier} masks.
27 */

28 /** Orders and filters members in a class element node.
29 * Can be used for methods, fields, inner classes, etc.
30 * <p>The semantics are very similar to those of <code>SourceElementFilter</code>.
31 * @see org.openide.src.ClassElement
32 * @see ClassChildren
33 *
34 * @author Dafe Simonek, Jan Jancura
35 */

36 public class ClassElementFilter extends SourceElementFilter {
37     // [PENDING] should initializers be included? --jglick
38

39     /** Specifies a child representing a constructor. */
40     public static final int CONSTRUCTOR = 8;
41     /** Specifies a child representing a field (instance variable). */
42     public static final int FIELD = 16;
43     /** Specifies a child representing a method. */
44     public static final int METHOD = 32;
45     /** Specifies a child representing the superclass of the node's class. */
46     public static final int EXTENDS = 64;
47     /** Specifies a child representing an implemented interface of the node's class.
48     * For a node representing an interface, this would specify an extended interface.
49     */

50     public static final int IMPLEMENTS = 128;
51     /** Does not specify a child type. */
52     public static final int ALL = SourceElementFilter.ALL | CONSTRUCTOR | FIELD | METHOD |
53                                       EXTENDS | IMPLEMENTS;
54
55     /** Default order and filtering.
56     * Places all fields, constructors, methods, and inner classes (interfaces) together
57     * in one block.
58     */

59     public static final int[] DEFAULT_ORDER = {FIELD | CONSTRUCTOR | METHOD | CLASS | INTERFACE};
60
61     // [PENDING] where is this used? --jglick
62
/** Specifies a child which is static. */
63     public static final int STATIC = Modifier.STATIC;
64
65     /** stores property value */
66     private boolean sorted = true;
67
68     /** Test whether the elements in one element type group are sorted.
69     * @return <code>true</code> if groups in getOrder () field are sorted, <code>false</code>
70     * to default order of elements
71     */

72     public boolean isSorted () {
73         return sorted;
74     }
75
76     /** Set whether groups of elements returned by getOrder () should be sorted.
77     * @param sorted <code>true</code> if so
78     */

79     public void setSorted (boolean sorted) {
80         this.sorted = sorted;
81     }
82 }
83
Popular Tags