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 149136
Collapse All | Expand All

(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/package-info.java (+43 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
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]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
@HelpSetRegistration(resource="org/netbeans/modules/apisupport/project/docs/nbmodules.hs", position=2700)
41
package org.netbeans.modules.apisupport.project;
42
43
import org.netbeans.api.javahelp.HelpSetRegistration;
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/helpset-decl.xml (-46 lines)
Lines 1-46 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
7
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License.  When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
25
26
Contributor(s):
27
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
Microsystems, Inc. All Rights Reserved.
31
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
42
-->
43
<!DOCTYPE helpsetref PUBLIC
44
          "-//NetBeans//DTD JavaHelp Help Set Reference 1.0//EN"
45
          "http://www.netbeans.org/dtds/helpsetref-1_0.dtd">
46
<helpsetref url="nbdocs:/org/netbeans/modules/apisupport/project/docs/nbmodules.hs"/>
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml (-7 lines)
Lines 257-269 Link Here
257
    </folder>
257
    </folder>
258
    <folder name="Services">
258
    <folder name="Services">
259
        <file name="org-netbeans-modules-apisupport-project-ui-ModuleUI.settings" url="moduleui.settings"/>
259
        <file name="org-netbeans-modules-apisupport-project-ui-ModuleUI.settings" url="moduleui.settings"/>
260
        <folder name="JavaHelp">
261
            <!-- Merge after J2EE Help: -->
262
            <file name="org-netbeans-modules-apisupport-project-helpset.xml" url="helpset-decl.xml">
263
                <attr name="position" intvalue="2700"/>
264
            </file>
265
            <!-- Merge before 3rd party help: -->
266
        </folder>
267
        <folder name="Hidden">
260
        <folder name="Hidden">
268
            <folder name="CatalogProvider">
261
            <folder name="CatalogProvider">
269
                <!-- No use for this, since we are registering an instance (below), and it is a singleton: -->
262
                <!-- No use for this, since we are registering an instance (below), and it is a singleton: -->
(-)a/javahelp/nbproject/project.properties (+1 lines)
Lines 42-47 Link Here
42
42
43
javac.compilerargs=-Xlint:unchecked
43
javac.compilerargs=-Xlint:unchecked
44
javac.source=1.5
44
javac.source=1.5
45
cp.extra=${nb_all}/libs.javacapi/external/javac-api-nb-7.0-b07.jar
45
javadoc.arch=${basedir}/arch.xml
46
javadoc.arch=${basedir}/arch.xml
46
javadoc.docfiles=${basedir}/api/doc
47
javadoc.docfiles=${basedir}/api/doc
47
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
(-)a/javahelp/src/org/netbeans/api/javahelp/HelpSetRegistration.java (+56 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
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]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.api.javahelp;
41
42
import java.lang.annotation.ElementType;
43
import java.lang.annotation.Retention;
44
import java.lang.annotation.RetentionPolicy;
45
import java.lang.annotation.Target;
46
47
/**
48
 * Registers a JavaHelp help set.
49
 */
50
@Target(ElementType.PACKAGE)
51
@Retention(RetentionPolicy.SOURCE)
52
public @interface HelpSetRegistration {
53
    String resource();
54
    boolean merge() default true;
55
    int position() default Integer.MAX_VALUE;
56
}
(-)a/javahelp/src/org/netbeans/modules/javahelp/HelpSetRegistrationProcessor.java (+83 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
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]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.javahelp;
41
42
import java.util.Set;
43
import javax.annotation.processing.Processor;
44
import javax.annotation.processing.RoundEnvironment;
45
import javax.annotation.processing.SupportedAnnotationTypes;
46
import javax.annotation.processing.SupportedSourceVersion;
47
import javax.lang.model.SourceVersion;
48
import javax.lang.model.element.Element;
49
import javax.lang.model.element.PackageElement;
50
import javax.lang.model.element.TypeElement;
51
import org.netbeans.api.javahelp.HelpSetRegistration;
52
import org.openide.filesystems.annotations.LayerGeneratingProcessor;
53
import org.openide.filesystems.annotations.LayerGenerationException;
54
import org.openide.util.lookup.ServiceProvider;
55
56
@ServiceProvider(service=Processor.class)
57
@SupportedSourceVersion(SourceVersion.RELEASE_6)
58
@SupportedAnnotationTypes("org.netbeans.api.javahelp.HelpSetRegistration")
59
public class HelpSetRegistrationProcessor extends LayerGeneratingProcessor {
60
61
    protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {
62
        if (roundEnv.processingOver()) {
63
            return false;
64
        }
65
        for (Element e : roundEnv.getElementsAnnotatedWith(HelpSetRegistration.class)) {
66
            HelpSetRegistration r = e.getAnnotation(HelpSetRegistration.class);
67
            /* Does not work because javahelp/ dir is not part of source path:
68
            try {
69
                processingEnv.getFiler().getResource(StandardLocation.SOURCE_PATH, "", r.resource()).openInputStream().close();
70
            } catch (IOException x) {
71
                throw new LayerGenerationException("No such resource " + r.resource(), e);
72
            }
73
             */
74
            StringBuilder b = new StringBuilder().
75
                append("<!DOCTYPE helpsetref PUBLIC '-//NetBeans//DTD JavaHelp Help Set Reference 1.0//EN' 'http://www.netbeans.org/dtds/helpsetref-1_0.dtd'>\n").
76
                append("<helpsetref url='nbdocs:/").append(r.resource()).append("' merge='" + r.merge() + "'/>\n");
77
            layer(e).file("Services/JavaHelp/" + ((PackageElement) e).getQualifiedName().toString().replace('.', '-') + ".xml").
78
                    contents(b.toString()).position(r.position()).write();
79
        }
80
        return true;
81
    }
82
83
}

Return to bug 149136