站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.0

Project (NetBeans Project API) - NetBeans API Javadoc 5.5.0

org.netbeans.modules.projectapi/1 1.9.22

org.netbeans.api.project
Interface Project

All Superinterfaces:
Lookup.Provider

public interface Project
extends Lookup.Provider

Represents one IDE project in memory.

Never cast a project instance to any subtype. 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:
NetBeans 4.0 Project & Build System How-To

Method Summary
 Lookup getLookup()
          Get any optional abilities of this project.
 FileObject getProjectDirectory()
          Gets an associated directory where the project metadata and possibly sources live.
 

Method Detail

getProjectDirectory

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

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 of ProjectInformation and Sources, use ProjectUtils rather than directly searching the project lookup.

The following abilities are recommended:

  1. ProjectInformation
  2. LogicalViewProvider
  3. CustomizerProvider
  4. Sources
  5. ActionProvider
  6. SubprojectProvider
  7. AuxiliaryConfiguration
  8. CacheDirectoryProvider

You might also have e.g.:

  1. FileBuiltQueryImplementation
  2. SharabilityQueryImplementation
  3. ProjectOpenedHook
  4. RecommendedTemplates
  5. PrivilegedTemplates
  6. ClassPathProvider
  7. SourceForBinaryQueryImplementation
  8. SourceLevelQueryImplementation
  9. JavadocForBinaryQueryImplementation
  10. AccessibilityQueryImplementation
  11. MultipleRootsUnitTestForSourceQueryImplementation
  12. ProjectXmlSavedHook
  13. AntArtifactProvider

Typical implementation:

 private final Lookup lookup = Lookups.fixed(new Object[] {
     new MyAbility1(this),
     // ...
 });
 public Lookup getLookup() {
     return lookup;
 }
 

Specified by:
getLookup in interface Lookup.Provider
Returns:
a set of abilities

org.netbeans.modules.projectapi/1 1.9.22

Built on May 28 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.