diff --git a/apisupport.project/src/org/netbeans/modules/apisupport/project/package-info.java b/apisupport.project/src/org/netbeans/modules/apisupport/project/package-info.java
new file mode 100644
--- /dev/null
+++ b/apisupport.project/src/org/netbeans/modules/apisupport/project/package-info.java
@@ -0,0 +1,43 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ */
+
+@HelpSetRegistration(resource="org/netbeans/modules/apisupport/project/docs/nbmodules.hs", position=2700)
+package org.netbeans.modules.apisupport.project;
+
+import org.netbeans.api.javahelp.HelpSetRegistration;
diff --git a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/helpset-decl.xml b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/helpset-decl.xml
deleted file mode 100644
--- a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/helpset-decl.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
diff --git a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml
--- a/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml
+++ b/apisupport.project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml
@@ -257,13 +257,6 @@
-
-
-
-
-
-
-
diff --git a/javahelp/nbproject/project.properties b/javahelp/nbproject/project.properties
--- a/javahelp/nbproject/project.properties
+++ b/javahelp/nbproject/project.properties
@@ -42,6 +42,7 @@
javac.compilerargs=-Xlint:unchecked
javac.source=1.5
+cp.extra=${nb_all}/libs.javacapi/external/javac-api-nb-7.0-b07.jar
javadoc.arch=${basedir}/arch.xml
javadoc.docfiles=${basedir}/api/doc
javadoc.apichanges=${basedir}/apichanges.xml
diff --git a/javahelp/src/org/netbeans/api/javahelp/HelpSetRegistration.java b/javahelp/src/org/netbeans/api/javahelp/HelpSetRegistration.java
new file mode 100644
--- /dev/null
+++ b/javahelp/src/org/netbeans/api/javahelp/HelpSetRegistration.java
@@ -0,0 +1,56 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.api.javahelp;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Registers a JavaHelp help set.
+ */
+@Target(ElementType.PACKAGE)
+@Retention(RetentionPolicy.SOURCE)
+public @interface HelpSetRegistration {
+ String resource();
+ boolean merge() default true;
+ int position() default Integer.MAX_VALUE;
+}
diff --git a/javahelp/src/org/netbeans/modules/javahelp/HelpSetRegistrationProcessor.java b/javahelp/src/org/netbeans/modules/javahelp/HelpSetRegistrationProcessor.java
new file mode 100644
--- /dev/null
+++ b/javahelp/src/org/netbeans/modules/javahelp/HelpSetRegistrationProcessor.java
@@ -0,0 +1,83 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.javahelp;
+
+import java.util.Set;
+import javax.annotation.processing.Processor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.PackageElement;
+import javax.lang.model.element.TypeElement;
+import org.netbeans.api.javahelp.HelpSetRegistration;
+import org.openide.filesystems.annotations.LayerGeneratingProcessor;
+import org.openide.filesystems.annotations.LayerGenerationException;
+import org.openide.util.lookup.ServiceProvider;
+
+@ServiceProvider(service=Processor.class)
+@SupportedSourceVersion(SourceVersion.RELEASE_6)
+@SupportedAnnotationTypes("org.netbeans.api.javahelp.HelpSetRegistration")
+public class HelpSetRegistrationProcessor extends LayerGeneratingProcessor {
+
+ protected boolean handleProcess(Set extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {
+ if (roundEnv.processingOver()) {
+ return false;
+ }
+ for (Element e : roundEnv.getElementsAnnotatedWith(HelpSetRegistration.class)) {
+ HelpSetRegistration r = e.getAnnotation(HelpSetRegistration.class);
+ /* Does not work because javahelp/ dir is not part of source path:
+ try {
+ processingEnv.getFiler().getResource(StandardLocation.SOURCE_PATH, "", r.resource()).openInputStream().close();
+ } catch (IOException x) {
+ throw new LayerGenerationException("No such resource " + r.resource(), e);
+ }
+ */
+ StringBuilder b = new StringBuilder().
+ append("\n").
+ append("\n");
+ layer(e).file("Services/JavaHelp/" + ((PackageElement) e).getQualifiedName().toString().replace('.', '-') + ".xml").
+ contents(b.toString()).position(r.position()).write();
+ }
+ return true;
+ }
+
+}