KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > project > Sources


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.api.project;
21
22 import javax.swing.event.ChangeListener JavaDoc;
23
24 /**
25  * Optional interface for a project to enumerate folders containing sources
26  * of various kinds.
27  * <strong>Use {@link ProjectUtils#getSources} as a client.</strong>
28  * Use {@link Project#getLookup} as a provider.
29  * <p class="nonnormative">
30  * May be used by the New File wizard, Find in Files, to-do task scanning,
31  * the Files tab, etc.
32  * </p>
33  * @see <a HREF="@org-netbeans-modules-project-ant@/org/netbeans/spi/project/support/ant/SourcesHelper.html"><code>SourcesHelper</code></a>
34  * @author Jesse Glick
35  */

36 public interface Sources {
37     
38     /**
39      * Generic source folders containing any source files at all.
40      * Generally should be a superset of all other kinds of source folders.
41      * Usually the project directory is the only such folder listed.
42      */

43     String JavaDoc TYPE_GENERIC = "generic"; // NOI18N
44

45     /**
46      * Find all root source folders matching a given type.
47      * <p>For a given type, the returned source folders must not overlap, i.e.
48      * there may be no duplicates and no folder may be a descendant of another.
49      * <p>In the case of {@link #TYPE_GENERIC} source folders, the project must
50      * contain at least one such folder (a nonempty array must be returned), and
51      * the {@link Project#getProjectDirectory project directory} must either be
52      * one of the returned folders, or a descendant of one of the returned folders.
53      * @param type a kind of folder, e.g. {@link #TYPE_GENERIC} or
54      * <a HREF="@org-netbeans-modules-java-project@/org/netbeans/api/java/project/JavaProjectConstants.html#SOURCES_TYPE_JAVA"><code>JavaProjectConstants.SOURCES_TYPE_JAVA</code></a>
55      * @return a list of top-level source folders of that kind (may be empty but not null)
56      */

57     SourceGroup[] getSourceGroups(String JavaDoc type);
58     
59     /**
60      * Add a listener to changes in the source groups.
61      * Any change in the result of {@link #getSourceGroups} should
62      * cause a change event to be fired.
63      * @param listener a listener to add
64      */

65     public void addChangeListener(ChangeListener JavaDoc listener);
66     
67     /**
68      * Remove a listener to changes in the source groups.
69      * @param listener a listener to remove
70      */

71     public void removeChangeListener(ChangeListener JavaDoc listener);
72     
73 }
74
Popular Tags