| org.netbeans.api.project.Sources
Sources | public interface Sources (Code) | | Optional interface for a project to enumerate folders containing sources
of various kinds.
Use
ProjectUtils.getSources as a client.
Use
Project.getLookup as a provider.
May be used by the New File wizard, Find in Files, to-do task scanning,
the Files tab, etc.
See Also: SourcesHelper author: Jesse Glick |
Field Summary | |
String | TYPE_GENERIC Generic source folders containing any source files at all. |
Method Summary | |
public void | addChangeListener(ChangeListener listener) Add a listener to changes in the source groups. | SourceGroup[] | getSourceGroups(String type) Find all root source folders matching a given type.
For a given type, the returned source folders must not overlap, i.e.
there may be no duplicates and no folder may be a descendant of another.
In the case of
Sources.TYPE_GENERIC source folders, the project must
contain at least one such folder (a nonempty array must be returned), and
the
Project.getProjectDirectory project directory must either be
one of the returned folders, or a descendant of one of the returned folders.
Parameters: type - a kind of folder, e.g. | public void | removeChangeListener(ChangeListener listener) Remove a listener to changes in the source groups. |
TYPE_GENERIC | String TYPE_GENERIC(Code) | | Generic source folders containing any source files at all.
Generally should be a superset of all other kinds of source folders.
Usually the project directory is the only such folder listed.
|
addChangeListener | public void addChangeListener(ChangeListener listener)(Code) | | Add a listener to changes in the source groups.
Any change in the result of
Sources.getSourceGroups should
cause a change event to be fired.
Parameters: listener - a listener to add |
getSourceGroups | SourceGroup[] getSourceGroups(String type)(Code) | | Find all root source folders matching a given type.
For a given type, the returned source folders must not overlap, i.e.
there may be no duplicates and no folder may be a descendant of another.
In the case of
Sources.TYPE_GENERIC source folders, the project must
contain at least one such folder (a nonempty array must be returned), and
the
Project.getProjectDirectory project directory must either be
one of the returned folders, or a descendant of one of the returned folders.
Parameters: type - a kind of folder, e.g. Sources.TYPE_GENERIC orJavaProjectConstants.SOURCES_TYPE_JAVA a list of top-level source folders of that kind (may be empty but not null) |
removeChangeListener | public void removeChangeListener(ChangeListener listener)(Code) | | Remove a listener to changes in the source groups.
Parameters: listener - a listener to remove |
|
|