public final class ProjectConvertors extends Object
ProjectConvertors.| Modifier and Type | Method and Description |
|---|---|
static Lookup |
createDelegateToOwnerLookup(FileObject projectDirectory)
Creates a
Lookup delegating to the owner project. |
static FileEncodingQueryImplementation |
createFileEncodingQuery()
Creates
FileEncodingQueryImplementation delegating to the nearest non convertor project. |
static Lookup |
createProjectConvertorLookup(Object... instances)
Creates a
Lookup with given instances. |
static Project |
getNonConvertorOwner(FileObject file)
Finds the owning non convertor project.
|
static boolean |
isConvertorProject(Project project)
Checks if the given
Project is a artificial one created by a ProjectConvertor. |
static void |
unregisterConvertorProject(Project project)
Unregisters the artifical convertor
Project from ProjectManager. |
public static boolean isConvertorProject(@NonNull Project project)
Project is a artificial one created by a ProjectConvertor.project - the Project to be testedProject was created by a ProjectConvertorpublic static void unregisterConvertorProject(@NonNull Project project)
Project from ProjectManager.
Unregisters the artifical convertor Project from ProjectManager to
allow another Project to take folder ownership. The method should be called
only by Project generators when creating a new Project.
Requires ProjectManager.mutex() write access.project - the project to be unregistered.@CheckForNull public static Project getNonConvertorOwner(@NonNull FileObject file)
file - the FileObject to find owner forProject or null if there is no such a project.@NonNull public static FileEncodingQueryImplementation createFileEncodingQuery()
FileEncodingQueryImplementation delegating to the nearest non convertor project.FileEncodingQueryImplementation@NonNull public static Lookup createProjectConvertorLookup(@NonNull Object... instances)
Lookup with given instances.
The returned Lookup implements Closeable, calling Closeable.close()
on it removes all the instances.
Typical usage would be to pass the Lookup to ProjectConvertor.Result#Result
and call Closeable.close() on it in the convertor's project factory before the real
project is created.