/*
 * Copyright (C) 2016 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jboss.errai.demo.client.local;

import javax.enterprise.inject.Produces;

import org.jboss.errai.common.client.dom.Element;
import org.jboss.errai.common.client.dom.HTMLElement;

import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 *
 * @author Max Barkley <mbarkley@redhat.com>
 */
@JsType(isNative = true)
public abstract class JQueryProducer {

  @JsFunction @FunctionalInterface
  public static interface JQuery {
    JQueryElement wrap(Element element);
  }

  @JsType(isNative = true)
  public static interface JQueryElement extends HTMLElement {
    void after(HTMLElement element);
    void before(HTMLElement element);
    JQueryArray children();
    JQueryArray children(String selector);
  }

  @JsType(isNative = true)
  public static interface JQueryArray {
    JQueryElement first();
    JQueryElement get(int index);
  }

  @Produces
  @JsProperty(name = "$", namespace = JsPackage.GLOBAL)
  public static native JQuery get();

}

@@ -975,19 +975,152 @@
 e;%0A%0A/**%0A
+ * %3Cp%3E%0A * An example JS interop API for JQuery. Wraps a small subset of JQuery and allows for the JQuery function to be%0A * injected.%0A
  *%0A
-
  * @auth
@@ -1225,16 +1225,97 @@
 ucer %7B%0A%0A
+  /**%0A   * %3Cp%3E%0A   * The JQuery function, used to enhance regular elements.%0A   */%0A
   @JsFun
@@ -1414,32 +1414,271 @@
  element);%0A  %7D%0A%0A
+  /**%0A   * %3Cp%3E%0A   * Interface for enhanced JQuery elements, exposing API for some convenient methods for getting children or inserting%0A   * sibling elements.%0A   *%0A   * %3Cp%3E%0A   * See %7B@link AppSetup%7D for usage.%0A   *%0A   * @see AppSetup%0A   */%0A
   @JsType(isNati
@@ -1901,16 +1901,121 @@
 );%0A  %7D%0A%0A
+  /**%0A   * %3Cp%3E%0A   * Interface for an element array returned by some %7B@link JQueryElement%7D methods.%0A   */%0A
   @JsTyp
@@ -2139,16 +2139,271 @@
 );%0A  %7D%0A%0A
+  /**%0A   * %3Cp%3E%0A   * Declares a producer for the JQuery function, allowing it to be injected via Errai IoC.%0A   *%0A   * %3Cp%3E%0A   * %7B@link JsProperty%7D is used so that GWT translates method calls to property access of the globally-scoped %7B@code $%7D symbol.%0A   */%0A
   @Produ

Add javadoc to JQuery JS interop wrapper.