KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > apisupport > project > spi > NbModuleProvider


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.apisupport.project.spi;
21
22 import java.io.File JavaDoc;
23 import java.io.IOException JavaDoc;
24 import org.openide.filesystems.FileObject;
25 import org.openide.modules.SpecificationVersion;
26
27 /**
28  * Interface to be implemented by NetBeans module projects.
29  *
30  * @see org.netbeans.api.project.Project#getLookup
31  * @author Martin Krauskopf, Milos Kleint
32  * @since org.netbeans.modules.apisupport.project 1.15
33  */

34 public interface NbModuleProvider {
35
36     // These are just for convenience:
37
NbModuleType STANDALONE = NbModuleType.STANDALONE;
38     NbModuleType SUITE_COMPONENT = NbModuleType.SUITE_COMPONENT;
39     NbModuleType NETBEANS_ORG = NbModuleType.NETBEANS_ORG;
40     
41     /** Used for a type-safe enumeration of NetBeans module types. */
42     enum NbModuleType {
43         STANDALONE,
44         SUITE_COMPONENT,
45         NETBEANS_ORG
46     }
47     
48     /** Returns type of this NetBeans module.
49      * @return STANDALONE SUITE_COMPONENT or NETBEANS_ORG
50      */

51     NbModuleType getModuleType();
52     
53     /**
54      * Returns the specification version of the module
55      * @return specification version of the module
56      */

57     String JavaDoc getSpecVersion();
58     
59     /**
60      * Returns the codenamebase of the module
61      * @return module's codenamebase
62      */

63     String JavaDoc getCodeNameBase();
64     
65     
66     /** Returns a relative path to a project's source directory.
67      * @return relative path to sources..
68      */

69     String JavaDoc getSourceDirectoryPath();
70     /**
71      * relative path to the directory which contains/is to contain resources, META-INF/services folder or layer file for example
72      * @param inTests
73      * @return relative path from project root to resource root.
74      */

75     String JavaDoc getResourceDirectoryPath(boolean inTests);
76
77     /**
78      * returns the relative path to the main project file (eg. nbproject/project.xml)
79      * @return relative path from project root to the main project file.
80      */

81     String JavaDoc getProjectFilePath();
82     
83     /**
84      * returns root directory with sources.
85      * @return sources root FileObject
86      */

87     FileObject getSourceDirectory();
88     
89     /**
90      * returns the location of the module's manifest
91      * @return manifest FileObject.
92      */

93     FileObject getManifestFile();
94     
95     /**
96      * add/updates the given dependency to the project
97      */

98     boolean addDependency(
99             final String JavaDoc codeNameBase, final String JavaDoc releaseVersion,
100             final SpecificationVersion version, final boolean useInCompiler) throws IOException JavaDoc;
101     
102     /**
103      * checks the declared version of the given dependency
104      * @param codenamebase
105      * @return
106      */

107     SpecificationVersion getDependencyVersion(String JavaDoc codenamebase) throws IOException JavaDoc;
108     
109     /**
110      * get the NetBeans platform for the module
111      * @return location of the root directory of NetBeans platform installation
112      */

113     File JavaDoc getActivePlatformLocation();
114     
115     
116 }
117
Popular Tags