public interface Sources
ProjectUtils.getSources(org.netbeans.api.project.Project)
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.
SourcesHelper
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_GENERIC
Generic source folders containing any source files at all.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
removeChangeListener(ChangeListener listener)
Remove a listener to changes in the source groups.
|
static final String TYPE_GENERIC
SourceGroup[] getSourceGroups(String 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 directory
must either be
one of the returned folders, or a descendant of one of the returned folders.
type
- a kind of folder, e.g. Sources.TYPE_GENERIC
or
JavaProjectConstants.SOURCES_TYPE_JAVA
void addChangeListener(ChangeListener listener)
Sources.getSourceGroups(java.lang.String)
should
cause a change event to be fired.listener
- a listener to addvoid removeChangeListener(ChangeListener listener)
listener
- a listener to remove