2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
* The contents of this file are subject to the terms of either the GNU
7
* General Public License Version 2 only ("GPL") or the Common
8
* Development and Distribution License("CDDL") (collectively, the
9
* "License"). You may not use this file except in compliance with the
10
* License. You can obtain a copy of the License at
11
* http://www.netbeans.org/cddl-gplv2.html
12
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
* specific language governing permissions and limitations under the
14
* License. When distributing the software, include this License Header
15
* Notice in each file and include the License file at
16
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17
* particular file as subject to the "Classpath" exception as provided
18
* by Sun in the GPL Version 2 section of the License file that
19
* accompanied this code. If applicable, add the following below the
20
* License Header, with the fields enclosed by brackets [] replaced by
21
* your own identifying information:
22
* "Portions Copyrighted [year] [name of copyright owner]"
26
* The Original Software is NetBeans. The Initial Developer of the Original
27
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
28
* Microsystems, Inc. All Rights Reserved.
30
* If you wish your version of this file to be governed by only the CDDL
31
* or only the GPL Version 2, indicate your decision by adding
32
* "[Contributor] elects to include this software in this distribution
33
* under the [CDDL or GPL Version 2] license." If you do not indicate a
34
* single choice of license, a recipient has the option to distribute
35
* your version of this file under either the CDDL, the GPL Version 2 or
36
* to extend the choice of license to its licensees as provided above.
37
* However, if you add GPL Version 2 code and therefore, elected the GPL
38
* Version 2 license, then the option applies only if the new code is
39
* made subject to such option by the copyright holder.
42
package org.netbeans.api.project;
44
import org.openide.filesystems.FileObject;
45
import org.openide.util.Lookup;
48
* Represents one IDE project in memory.
50
* <strong>Never cast a project instance</strong> to any subtype.
51
* (Nor call {@link Object#getClass} on the <code>Project</code> instance.)
53
* manager is free to wrap any project in an unspecified proxy for its own
54
* purposes. For extensibility, use {@link #getLookup}.
56
* <div class="nonnormative">
57
* <p>Note that this API is primarily of interest to project type provider
58
* modules, and to infrastructure and generic GUI. Most other modules providing
59
* tools or services should <em>not</em> need to explicitly model projects, and
60
* should not be using this API much or at all.</p>
62
* @see <a href="http://projects.netbeans.org/buildsys/howto.html">NetBeans 4.0 Project & Build System How-To</a>
65
public interface Project extends Lookup.Provider {
68
* Gets an associated directory where the project metadata and possibly sources live.
69
* In the case of a typical Ant project, this is the top directory, not the
70
* project metadata subdirectory.
73
FileObject getProjectDirectory();
76
* Get any optional abilities of this project.
77
* <div class="nonnormative">
78
* <p>If you are <em>providing</em> a project, there are a number of interfaces
79
* which you should consider implementing and including in lookup, some of which
80
* are described below. If you are <em>using</em> a project from another module,
81
* there are some cases where you will want to ask a project for a particular
82
* object in lookup (e.g. <code>ExtensibleMetadataProvider</code>) but in most
83
* cases you should not; in the case of queries, always call the static query
84
* API helper method, rather than looking for the query implementation objects
85
* yourself. <strong>In the case of <code>ProjectInformation</code> and <code>Sources</code>,
86
* use {@link ProjectUtils} rather than directly searching the project lookup.</strong>
88
* <p>The following abilities are recommended:</p>
90
* <li>{@link org.netbeans.api.project.ProjectInformation}</li>
91
* <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/LogicalViewProvider.html"><code>LogicalViewProvider</code></a></li>
92
* <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/CustomizerProvider.html"><code>CustomizerProvider</code></a></li>
93
* <li>{@link org.netbeans.api.project.Sources}</li>
94
* <li>{@link org.netbeans.spi.project.ActionProvider}</li>
95
* <li>{@link org.netbeans.spi.project.SubprojectProvider}</li>
96
* <li>{@link org.netbeans.spi.project.AuxiliaryConfiguration}</li>
97
* <li>{@link org.netbeans.spi.project.CacheDirectoryProvider}</li>
99
* <p>You might also have e.g.:</p>
101
* <li>{@link org.netbeans.spi.project.ProjectConfigurationProvider}</li>
102
* <li>{@link org.netbeans.spi.queries.FileBuiltQueryImplementation}</li>
103
* <li>{@link org.netbeans.spi.queries.SharabilityQueryImplementation}</li>
104
* <li>{@link org.netbeans.spi.queries.FileEncodingQueryImplementation}</li>
105
* <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/ProjectOpenedHook.html"><code>ProjectOpenedHook</code></a></li>
106
* <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/RecommendedTemplates.html"><code>RecommendedTemplates</code></a></li>
107
* <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/PrivilegedTemplates.html"><code>PrivilegedTemplates</code></a></li>
108
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/classpath/ClassPathProvider.html"><code>ClassPathProvider</code></a></li>
109
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/SourceForBinaryQueryImplementation.html"><code>SourceForBinaryQueryImplementation</code></a></li>
110
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/SourceLevelQueryImplementation.html"><code>SourceLevelQueryImplementation</code></a></li>
111
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/JavadocForBinaryQueryImplementation.html"><code>JavadocForBinaryQueryImplementation</code></a></li>
112
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/AccessibilityQueryImplementation.html"><code>AccessibilityQueryImplementation</code></a></li>
113
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/MultipleRootsUnitTestForSourceQueryImplementation.html"><code>MultipleRootsUnitTestForSourceQueryImplementation</code></a></li>
114
* <li><a href="@org-netbeans-modules-project-ant@/org/netbeans/spi/project/support/ant/ProjectXmlSavedHook.html"><code>ProjectXmlSavedHook</code></a></li>
115
* <li><a href="@org-netbeans-modules-project-ant@/org/netbeans/spi/project/ant/AntArtifactProvider.html"><code>AntArtifactProvider</code></a></li>
116
* <li><a href="@org-openidex-util@/org/openidex/search/SearchInfo.html"><code>SearchInfo</code></a></li>
117
* <li><a href="@org-netbeans-api-java@/org/netbeans/spi/java/queries/BinaryForSourceQueryImplementation.html"><code>BinaryForSourceQueryImplementation</code></a></li>
118
* <li><a href="@org-netbeans-modules-project-ant@/org/netbeans/api/project/ant/AntBuildExtender.html"><code>AntBuildExtender</code></a></li>
119
* <li><a href="@org-openide-loaders@/org/openide/loaders/CreateFromTemplateAttributesProvider.html"><code>CreateFromTemplateAttributesProvider</code></a></li>
121
* <p>Typical implementation:</p>
123
* private final Lookup lookup = Lookups.fixed(new Object[] {
124
* new MyAbility1(this),
127
* public Lookup getLookup() {
132
* @return a set of abilities