alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 *
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 *
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.api.project;

import org.openide.filesystems.FileObject;
import org.openide.util.Lookup;

/**
 * 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 {@link #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.

*
* @author Jesse Glick */ public interface Project extends Lookup.Provider { /** * 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. * @return a directory */ FileObject getProjectDirectory(); /** * 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 {@link ProjectUtils} rather than directly searching the project lookup. *

*

The following abilities are recommended:

*
    *
  1. {@link org.netbeans.api.project.ProjectInformation}
  2. *
  3. LogicalViewProvider
  4. *
  5. CustomizerProvider
  6. *
  7. {@link org.netbeans.api.project.Sources}
  8. *
  9. {@link org.netbeans.spi.project.ActionProvider}
  10. *
  11. {@link org.netbeans.spi.project.SubprojectProvider}
  12. *
  13. {@link org.netbeans.spi.project.AuxiliaryConfiguration}
  14. *
  15. {@link org.netbeans.spi.project.CacheDirectoryProvider}
  16. *
*

You might also have e.g.:

*
    *
  1. {@link org.netbeans.spi.queries.FileBuiltQueryImplementation}
  2. *
  3. ProjectOpenedHook
  4. *
  5. RecommendedTemplates
  6. *
  7. PrivilegedTemplates
  8. *
  9. ClassPathProvider
  10. *
  11. SourceForBinaryQueryImplementation
  12. *
  13. JavadocForBinaryQueryImplementation
  14. *
  15. AccessibilityQueryImplementation
  16. *
  17. ProjectXmlSavedHook
  18. *
  19. AntArtifactProvider
  20. *
  21. UnitTestForSourceQueryImplementation
  22. *
*

Typical implementation:

*
     * private final Lookup lookup = Lookups.fixed(new Object[] {
     *     new MyAbility1(this),
     *     // ...
     * });
     * public Lookup getLookup() {
     *     return lookup;
     * }
     * 
*
* @return a set of abilities */ Lookup getLookup(); }
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.