|
org.netbeans.modules.java.api.common/0 1.37 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.modules.java.api.common.Roots
org.netbeans.modules.java.api.common.SourceRoots
public final class SourceRoots
Represents a project source roots. It can be used to obtain source roots as Ant properties, FileObject's
or URLs.
This class is thread safe and listens to the changes
in Ant project metadata (see PROP_ROOT_PROPERTIES) as well as
in project properties (see PROP_ROOTS).
| Field Summary | |
|---|---|
static String |
DEFAULT_SOURCE_LABEL
Default label for sources node used in LogicalViewProvider. |
static String |
DEFAULT_TEST_LABEL
Default label for tests node used in LogicalViewProvider. |
static String |
PROP_ROOT_PROPERTIES
Property name of a event that is fired when Ant project metadata change. |
static String |
PROP_ROOTS
Property name of a event that is fired when project properties change. |
| Method Summary | |
|---|---|
static SourceRoots |
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 |
getRootDisplayName(String rootName,
String propName)
Translates root name into display name of source/test root. |
String[] |
getRootDisplayNames()
Returns root's display names |
String[] |
getRootNames()
Returns the display names of source roots. |
String[] |
getRootProperties()
Returns names of Ant properties in the project.properties file holding the roots. |
FileObject[] |
getRoots()
Returns the source roots in the form of absolute paths. |
URL[] |
getRootURLs()
Returns the source roots as URLs. |
boolean |
isTest()
Returns true if the current SourceRoots instance represents source roots belonging to
the test compilation unit. |
void |
putRoots(URL[] roots,
String[] labels)
Replaces the current roots by the given ones. |
| Methods inherited from class org.netbeans.modules.java.api.common.Roots |
|---|
addPropertyChangeListener, nonSourceRoots, propertyBased, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_ROOT_PROPERTIES
public static final String PROP_ROOTS
public static final String DEFAULT_SOURCE_LABEL
LogicalViewProvider.
public static final String DEFAULT_TEST_LABEL
LogicalViewProvider.
| Method Detail |
|---|
public static SourceRoots create(UpdateHelper helper,
PropertyEvaluator evaluator,
ReferenceHelper refHelper,
String projectConfigurationNamespace,
String elementName,
boolean isTest,
String newRootNameTemplate)
public String[] getRootNames()
getRootProperties().
It may contain empty Strings but not null.
public String[] getRootDisplayNames()
Roots
getRootDisplayNames in class Rootspublic String[] getRootProperties()
Roots
getRootProperties in class Rootspublic FileObject[] getRoots()
FileObjects.public URL[] getRootURLs()
URLs.
URL.
public void putRoots(URL[] roots,
String[] labels)
roots - the URLs of the new roots.labels - the names of the new roots.
public String getRootDisplayName(String rootName,
String propName)
rootName - the name of root got from getRootNames().propName - the name of a property the root is stored in.
public String createInitialDisplayName(File sourceRoot)
sourceRoot - the source root.
public boolean isTest()
true if the current SourceRoots instance represents source roots belonging to
the test compilation unit.
true if the instance belongs to the test compilation unit, false otherwise.
|
org.netbeans.modules.java.api.common/0 1.37 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||