This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 75471
Collapse All | Expand All

(-)nbproject/project.properties (+1 lines)
Lines 11-16 Link Here
11
11
12
is.autoload=true
12
is.autoload=true
13
13
14
javac.source=1.5
14
javadoc.title=Java Project API
15
javadoc.title=Java Project API
15
javadoc.overview=${basedir}/overview.html
16
javadoc.overview=${basedir}/overview.html
16
javadoc.arch=${basedir}/arch.xml
17
javadoc.arch=${basedir}/arch.xml
(-)src/org/netbeans/spi/java/project/classpath/ProjectClassPathChanger.java (+127 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.spi.java.project.classpath;
15
16
import java.io.IOException;
17
import java.net.URI;
18
import org.netbeans.api.project.SourceGroup;
19
import org.netbeans.api.project.ant.AntArtifact;
20
import org.netbeans.api.project.libraries.Library;
21
import org.openide.filesystems.FileObject;
22
23
/**
24
 * Interface for project's classpaths modification.
25
 * A project can provide this interface in its {@link org.netbeans.api.project.Project#getLookup lookup} to
26
 * allow clients to add or remove new classpath elements (JAR, folder, dependent project, or library) to its 
27
 * classpaths.
28
 * @since org.netbeans.modules.java.project/1 1.9
29
 */
30
public interface ProjectClassPathChanger {
31
    
32
    /**
33
     * Adds a library into the project's classpath if the
34
     * library is not already included.
35
     * @param library to be added
36
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
37
     * identifying the compilation unit to change
38
     * @param classPathId the id of the classpath the library should be added to,
39
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
40
     * @return true in case the classpath was changed
41
     * @exception IOException in case the project metadata cannot be changed
42
     * @exception UnsupportedOperationException is thrown when the project does not support
43
     * adding of a library to the classpath of the given id.
44
     */
45
    boolean addLibrary (Library library, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
46
    
47
    
48
    /**
49
     * Removes a library from the project's classpath if the
50
     * library is included on it.
51
     * @param library to be removed
52
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
53
     * identifying the compilation unit to change
54
     * @param classPathId the id of the classpath the library should be removed from,
55
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
56
     * @return true in case the classpath was changed
57
     * @exception IOException in case the project metadata cannot be changed
58
     * @exception UnsupportedOperationException is thrown when the project does not support
59
     * removing of a library from the classpath of the given id.
60
     */
61
    boolean removeLibrary (Library library, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
62
    
63
    /**
64
     * Adds an archive file or folder into the project's classpath if the
65
     * entry is not already there.
66
     * @param classPathRoot root to be added, either root of an archive or folder
67
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
68
     * identifying the compilation unit to change
69
     * @param classPathId the id of the classpath the root should be added to,
70
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
71
     * @return true in case the classpath was changed
72
     * @exception IOException in case the project metadata cannot be changed
73
     * @exception UnsupportedOperationException is thrown when the project does not support
74
     * adding of a root to the classpath of the given id.
75
     */
76
    boolean addRoot (FileObject classPathRoot, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
77
    
78
    /**
79
     * Removes an archive file or folder from the project's classpath if the
80
     * entry is included on it.
81
     * @param classPathRoot root to be removed, either root of an archive or folder
82
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
83
     * identifying the compilation unit to change
84
     * @param classPathId the id of the classpath the root should be removed from,
85
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
86
     * @return true in case the classpath was changed
87
     * @exception IOException in case the project metadata cannot be changed
88
     * @exception UnsupportedOperationException is thrown when the project does not support
89
     * removing of a root from the classpath of the given id.
90
     */
91
    boolean removeRoot (FileObject classPathRoot, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
92
    
93
    /**
94
     * Adds an artifact (e.g. subproject) into project's classpath if the
95
     * artifact is not already on it.
96
     * @param artifact to be added
97
     * @param artifactElement the URI of the build output
98
     * (must be owned by the artifact and be relative to it)
99
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
100
     * identifying the compilation unit to change
101
     * @param classPathId the id of the classpath the artifact should be added to,
102
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
103
     * @return true in case the classpath was changed
104
     * @exception IOException in case the project metadata cannot be changed
105
     * @exception UnsupportedOperationException is thrown when the project does not support
106
     * adding of an artifact to the classpath of the given id.
107
     */
108
    boolean addAntArtifact (AntArtifact artifact, URI artifactElement, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
109
    
110
    /**
111
     * Removes an artifact (e.g. subproject) from project's classpath if the
112
     * artifact is not already on it.
113
     * @param artifact to be added
114
     * @param artifactElement the URI of the build output
115
     * (must be owned by the artifact and be relative to it)
116
     * @param sourceGroup of type {@link org.netbeans.api.java.project.JavaProjectConstants#SOURCES_TYPE_JAVA}
117
     * identifying the compilation unit to change
118
     * @param classPathId the id of the classpath the artifact should be removed from,
119
     * eg {@link org.netbeans.api.java.classpath.ClassPath.COMPILE}
120
     * @return true in case the classpath was changed
121
     * @exception IOException in case the project metadata cannot be changed
122
     * @exception UnsupportedOperationException is thrown when the project does not support
123
     * removing of an artifact from the classpath of the given id.
124
     */
125
    boolean removeAntArtifact (AntArtifact artifact, URI artifactElement, SourceGroup sourceGroup, String classPathId) throws IOException, UnsupportedOperationException;
126
127
}
(-)src/org/netbeans/spi/java/project/classpath/ProjectClassPathExtender.java (-2 / +6 lines)
Lines 24-32 Link Here
24
 * A project can provide this interface in its {@link org.netbeans.api.project.Project#getLookup lookup} to
24
 * A project can provide this interface in its {@link org.netbeans.api.project.Project#getLookup lookup} to
25
 * allow clients to extend its compilation classpath
25
 * allow clients to extend its compilation classpath
26
 * by a new classpath element (JAR, folder, dependent project, or library).
26
 * by a new classpath element (JAR, folder, dependent project, or library).
27
 * @since org.netbeans.modules.java.project/1 1.3 
27
 * @since org.netbeans.modules.java.project/1 1.3
28
 * @deprecated Please use the {@link ProjectClassPathChanger} instead.
28
 */
29
 */
29
public interface ProjectClassPathExtender {
30
public @Deprecated interface ProjectClassPathExtender {
30
31
31
    /**
32
    /**
32
     * Adds a library into the project's compile classpath if the
33
     * Adds a library into the project's compile classpath if the
Lines 34-39 Link Here
34
     * @param library to be added
35
     * @param library to be added
35
     * @return true in case the classpath was changed
36
     * @return true in case the classpath was changed
36
     * @exception IOException in case the project metadata cannot be changed
37
     * @exception IOException in case the project metadata cannot be changed
38
     * @deprecated Please use {@link ProjectClassPathChanger#addLibrary} instead.
37
     */
39
     */
38
    boolean addLibrary(Library library) throws IOException;
40
    boolean addLibrary(Library library) throws IOException;
39
41
Lines 43-48 Link Here
43
     * @param archiveFile ZIP/JAR file to be added
45
     * @param archiveFile ZIP/JAR file to be added
44
     * @return true in case the classpath was changed
46
     * @return true in case the classpath was changed
45
     * @exception IOException in case the project metadata cannot be changed
47
     * @exception IOException in case the project metadata cannot be changed
48
     * @deprecated Please use {@link ProjectClassPathChanger#addArchive} instead.
46
     */
49
     */
47
    boolean addArchiveFile(FileObject archiveFile) throws IOException;
50
    boolean addArchiveFile(FileObject archiveFile) throws IOException;
48
51
Lines 54-59 Link Here
54
     *                        (must be owned by the artifact and be relative to it)
57
     *                        (must be owned by the artifact and be relative to it)
55
     * @return true in case the classpath was changed
58
     * @return true in case the classpath was changed
56
     * @exception IOException in case the project metadata cannot be changed
59
     * @exception IOException in case the project metadata cannot be changed
60
     * @deprecated Please use {@link ProjectClassPathChanger#addAntArtifact} instead.
57
     */
61
     */
58
    boolean addAntArtifact(AntArtifact artifact, URI artifactElement) throws IOException;
62
    boolean addAntArtifact(AntArtifact artifact, URI artifactElement) throws IOException;
59
63

Return to bug 75471