|
org.netbeans.modules.projectapi/1 1.36.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.api.project.ProjectUtils
public class ProjectUtils
Utility methods to get information about Project
s.
Method Summary | |
---|---|
static AuxiliaryConfiguration |
getAuxiliaryConfiguration(Project project)
Find a way of storing extra configuration in a project. |
static FileObject |
getCacheDirectory(Project project,
Class<?> owner)
Gets a directory in which modules may store arbitrary extra unversioned files associated with a project. |
static ProjectInformation |
getInformation(Project p)
Get basic information about a project. |
static Preferences |
getPreferences(Project project,
Class clazz,
boolean shared)
Return Preferences for the given project and given module. |
static Sources |
getSources(Project p)
Get a list of sources for a project. |
static boolean |
hasSubprojectCycles(Project master,
Project candidate)
Check whether a project has, or might have, cycles in its subproject graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ProjectInformation getInformation(Project p)
ProjectInformation
instance in its lookup,
that is used. Otherwise, a basic dummy implementation is returned.
p
- a project
Project.getLookup()
public static Sources getSources(Project p)
Sources
instance in its lookup,
that is used. Otherwise, a basic implementation is returned
using GenericSources.genericOnly(org.netbeans.api.project.Project)
.
p
- a project
Project.getLookup()
public static boolean hasSubprojectCycles(Project master, Project candidate)
If the candidate parameter is null, this simply checks whether the master project's current directed graph of (transitive) subprojects contains any cycles. If the candidate is also passed, this checks whether the master project's subproject graph would contain cycles if the candidate were added as a (direct) subproject of the master project.
All cycles are reported even if they do not contain the master project.
If the master project already contains the candidate as a (direct) subproject, the effect is as if the candidate were null.
Projects with no SubprojectProvider
are considered to have no
subprojects, just as if the provider returned an empty set.
Acquires read access.
Project types which let the user somehow configure subprojects in the GUI (perhaps indirectly, e.g. via a classpath) should use this call to check for possible cycles before adding new subprojects.
master
- a project to root the subproject graph fromcandidate
- a potential direct subproject of the master project, or null
public static Preferences getPreferences(Project project, Class clazz, boolean shared)
Preferences
for the given project and given module.
The preferences are stored in the project using either AuxiliaryConfiguration
or AuxiliaryProperties
.
project
- project for which preferences should be returnedclazz
- module specification as in NbPreferences.forModule(java.lang.Class)
shared
- whether the returned settings should be shared
Preferences
for the given projectpublic static AuxiliaryConfiguration getAuxiliaryConfiguration(Project project)
The current fallback implementation uses file attributes
for "nonsharable" configuration, and a specially named file in the project directory
for "sharable" configuration. For compatibility purposes (in case a project adds an
AuxiliaryConfiguration
instance to its lookup where before it had none),
the fallback storage is read (but not written) even if there is an instance in project lookup.
project
- a project
public static FileObject getCacheDirectory(Project project, Class<?> owner) throws IOException
If the project supplies a CacheDirectoryProvider
, that will be used
for the parent directory. Otherwise an unspecified storage area will be used.
project
- a projectowner
- a class from the calling module (each module or package will get its own space)
IOException
- if no such directory could be created
|
org.netbeans.modules.projectapi/1 1.36.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |