Interface Project
- All Superinterfaces:
org.openide.util.Lookup.Provider
Never cast a project instance to any subtype.
(Nor call Object.getClass()
on the Project
instance.)
The project
manager is free to wrap any project in an unspecified proxy for its own
purposes. For extensibility, use getLookup()
.
Note that this API is primarily of interest to project type provider modules, and to infrastructure and generic GUI. Most other modules providing tools or services should not need to explicitly model projects, and should not be using this API much or at all.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.openide.util.Lookup
Get any optional abilities of this project.org.openide.filesystems.FileObject
Gets an associated directory where the project metadata and possibly sources live.
-
Method Details
-
getProjectDirectory
org.openide.filesystems.FileObject getProjectDirectory()Gets an associated directory where the project metadata and possibly sources live. In the case of a typical Ant project, this is the top directory, not the project metadata subdirectory.- Returns:
- a directory
-
getLookup
org.openide.util.Lookup getLookup()Get any optional abilities of this project.If you are providing a project, there are a number of interfaces which you should consider implementing and including in lookup, some of which are described below. If you are using a project from another module, there are some cases where you will want to ask a project for a particular object in lookup (e.g.
ExtensibleMetadataProvider
) but in most cases you should not; in the case of queries, always call the static query API helper method, rather than looking for the query implementation objects yourself. In the case ofProjectInformation
andSources
, useProjectUtils
rather than directly searching the project lookup.The following abilities are recommended:
ProjectInformation
LogicalViewProvider
CustomizerProvider
Sources
ActionProvider
SubprojectProvider
AuxiliaryConfiguration
AuxiliaryProperties
CacheDirectoryProvider
You might also have e.g.:
ProjectConfigurationProvider
FileBuiltQueryImplementation
SharabilityQueryImplementation
FileEncodingQueryImplementation
ProjectOpenedHook
RecommendedTemplates
PrivilegedTemplates
ClassPathProvider
SourceForBinaryQueryImplementation
SourceLevelQueryImplementation2
JavadocForBinaryQueryImplementation
AccessibilityQueryImplementation
MultipleRootsUnitTestForSourceQueryImplementation
ProjectXmlSavedHook
AntArtifactProvider
SearchInfo
BinaryForSourceQueryImplementation
AntBuildExtender
CreateFromTemplateAttributesProvider
Typical implementation:
private final Lookup lookup = Lookups.fixed(new Object[] { new MyAbility1(this), // ... }); public Lookup getLookup() { return lookup; }
- Specified by:
getLookup
in interfaceorg.openide.util.Lookup.Provider
- Returns:
- a set of abilities
-