/*
 * Copyright 2000-2013 Vaadin Ltd.
 * 
 * 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 com.vaadin.shared.annotations;

import java.io.Serializable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

@Target({ ElementType.METHOD, ElementType.FIELD })
public @interface DelegateToWidget {
    public String value() default "";

    public static class Helper implements Serializable {
        public static String getDelegateTarget(String propertyName,
                String annotationValue) {
            String name = annotationValue;
            if (name.isEmpty()) {
                name = "set" + Character.toUpperCase(propertyName.charAt(0))
                        + propertyName.substring(1);
            }
            return name;
        }
    }
}

@@ -743,191 +743,2411 @@
 t;%0A%0A
-@Target(%7B ElementType.METHOD, ElementType.FIELD %7D)%0Apublic @interface DelegateToWidget %7B%0A    public String value() default %22%22;%0A%0A    public static class Helper implements Serializable %7B
+/**%0A * Signals that the property value from a state class should be forwarded to the%0A * Widget of the corresponding connector instance.%0A * %3Cp%3E%0A * When this annotation is present on a field or on a setter method, the%0A * framework will call the corresponding setter in the Connector's Widget%0A * instance with the current state property value whenever it has been changed.%0A * This is happens after firing%0A * %7B@link com.vaadin.client.ConnectorHierarchyChangeEvent%7Ds but before firing%0A * any %7B@link com.vaadin.client.communication.StateChangeEvent%7D.%0A * %3Cp%3E%0A * Take for example a state class looking like this:%0A * %0A * %3Cpre%3E%0A * public class MyComponentState extends AbstractComponentState %7B%0A *     &#064;DelegateToWidget%0A *     public String myProperty;%0A * %7D%0A * %3C/pre%3E%0A * %0A * Whenever %3Ccode%3EmyProperty%3C/code%3E is changed, the framework will call code%0A * like this:%0A * %0A * %3Cpre%3E%0A * connector.getWidget().setMyProperty(connector.getState().myProperty);%0A * %3C/pre%3E%0A * %0A * %3Cp%3E%0A * By default, the Widget method to call is derived from the property name, but%0A * %7B@link #value()%7D in the annotation can be used to provide a custom method%0A * name, e.g. %7B@code @DelegateToWidget(%22someSpecialName%22)%7D.%0A * %0A * @since 7.0.0%0A * @author Vaadin Ltd%0A */%0A@Target(%7B ElementType.METHOD, ElementType.FIELD %7D)%0Apublic @interface DelegateToWidget %7B%0A    /**%0A     * Defines the name of the Widget method to call when the annotated state%0A     * property has changed. If no value is defined, the method name will be%0A     * derived from the property name, so e.g. a field named%0A     * %3Ccode%3EmyProperty%3C/code%3E will delegate to a method named%0A     * %3Ccode%3EsetMyProperty%3C/code%3E.%0A     * %0A     * @return the name of the method to delegate to, or empty string to use the%0A     *         default name%0A     */%0A    public String value() default %22%22;%0A%0A    /**%0A     * Internal helper for handling default values in a uniform way both at%0A     * runtime and during widgetset compilation.%0A     */%0A    public static class Helper implements Serializable %7B%0A        /**%0A         * Gets the name of the method to delegate to for a given property name%0A         * and annotation value.%0A         * %0A         * @param propertyName%0A         *            the name of the delegated property%0A         * @param annotationValue%0A         *            the %7B@link DelegateToWidget#value()%7D of the annotation%0A         * @return the name of the method to delegate to%0A         */
 %0A   

Add javadoc for @DelegateToWidget (#10980)