Search in sources :

Example 1 with ComputedOptions

use of com.axellience.vuegwt.core.client.component.options.computed.ComputedOptions in project vue-gwt by Axellience.

the class VueComponentOptions method addJavaComputed.

/**
 * Add a computed property to this ComponentOptions.
 * If the computed has both a getter and a setter, this will be called twice, once for each.
 * @param javaMethodName Name of the method in the {@link VueComponent}
 * @param computedPropertyName Name of the computed property in the Template and the
 * ComponentOptions
 * @param kind Kind of the computed method (getter or setter)
 */
@JsOverlay
public final void addJavaComputed(String javaMethodName, String computedPropertyName, ComputedKind kind) {
    ComputedOptions computedDefinition = getComputedOptions(computedPropertyName);
    if (computedDefinition == null) {
        computedDefinition = new ComputedOptions();
        addComputedOptions(computedPropertyName, computedDefinition);
    }
    Object method = getJavaComponentMethod(javaMethodName);
    if (kind == ComputedKind.GETTER)
        computedDefinition.get = method;
    else if (kind == ComputedKind.SETTER)
        computedDefinition.set = method;
}
Also used : JsObject(elemental2.core.JsObject) ComputedOptions(com.axellience.vuegwt.core.client.component.options.computed.ComputedOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Aggregations

ComputedOptions (com.axellience.vuegwt.core.client.component.options.computed.ComputedOptions)1 JsObject (elemental2.core.JsObject)1 JsOverlay (jsinterop.annotations.JsOverlay)1