public final class ModuleRoots extends SourceRoots
FileObject
's
or URL
s.
This class is thread safe and listens to the changes
in Ant project metadata (see SourceRoots.PROP_ROOT_PROPERTIES
) as well as
in project properties (see SourceRoots.PROP_ROOTS
).Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MODULE_LABEL
Default label for sources node used in
LogicalViewProvider . |
static String |
DEFAULT_TEST_MODULE_LABEL
Default label for sources node used in
LogicalViewProvider . |
DEFAULT_SOURCE_LABEL, DEFAULT_TEST_LABEL, PROP_ROOT_PROPERTIES, PROP_ROOTS
Modifier and Type | Method and Description |
---|---|
static ModuleRoots |
create(UpdateHelper helper,
PropertyEvaluator evaluator,
ReferenceHelper refHelper,
String projectConfigurationNamespace,
String elementName,
boolean isTest,
String newRootNameTemplate) |
String |
createInitialDisplayName(File sourceRoot)
Creates initial display name of source/test root.
|
String |
createInitialPath()
Creates initial path of module root.
|
String |
getRootDisplayName(String rootName,
String propName)
Translates root name into display name of source/test root.
|
String |
getRootPath(String rootPathProperty) |
String[] |
getRootPathProperties() |
URL[] |
getRootURLs(boolean removeInvalidRoots)
Returns the source roots as
URL s. |
void |
putModuleRoots(URL[] roots,
String[] paths)
Replaces the current module roots by the given ones.
|
getRootDisplayNames, getRootNames, getRootProperties, getRoots, getRootURLs, isTest, putRoots
addPropertyChangeListener, nonSourceRoots, propertyBased, removePropertyChangeListener
public static final String DEFAULT_MODULE_LABEL
LogicalViewProvider
.public static final String DEFAULT_TEST_MODULE_LABEL
LogicalViewProvider
.public static ModuleRoots create(UpdateHelper helper, PropertyEvaluator evaluator, ReferenceHelper refHelper, String projectConfigurationNamespace, String elementName, boolean isTest, String newRootNameTemplate)
public String[] getRootPathProperties()
public URL[] getRootURLs(boolean removeInvalidRoots)
SourceRoots
URL
s.getRootURLs
in class SourceRoots
removeInvalidRoots
- when true the URL
s pointing to existing non folder roots are removed.URL
.public void putModuleRoots(URL[] roots, String[] paths)
roots
- the URL
s of the new roots.paths
- the paths of the new roots.public String getRootDisplayName(String rootName, String propName)
SourceRoots
getRootDisplayName
in class SourceRoots
rootName
- the name of root got from SourceRoots.getRootNames()
.propName
- the name of a property the root is stored in.public String createInitialDisplayName(File sourceRoot)
SourceRoots
createInitialDisplayName
in class SourceRoots
sourceRoot
- the source root.public String createInitialPath()