Search in sources :

Example 16 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method addJavaPropDefaultValue.

/**
 * Add a custom prop validator to validate a property
 * @param javaMethodName Name of the method in the {@link VueComponent}
 * @param propertyName The name of the property to validate
 */
@JsOverlay
public final void addJavaPropDefaultValue(String javaMethodName, String propertyName) {
    PropOptions propDefinition = (PropOptions) props.get(propertyName);
    propDefinition.defaultValue = getJavaComponentMethod(javaMethodName);
}
Also used : PropOptions(com.axellience.vuegwt.core.client.component.options.props.PropOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Example 17 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method initTemplateExpressions.

/**
 * Add template expressions to this {@link VueComponentOptions}.
 */
@JsOverlay
private void initTemplateExpressions() {
    int i = 0;
    Function templateMethod;
    while ((templateMethod = getJavaComponentMethod("exp$" + i)) != null) {
        addMethod("exp$" + i, templateMethod);
        i++;
    }
}
Also used : Function(elemental2.core.Function) JsOverlay(jsinterop.annotations.JsOverlay)

Example 18 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method addJavaProp.

/**
 * Add a prop to our ComponentOptions.
 * This will allow to receive data from the outside of our Component.
 * @param propName The name of the property
 * @param required Is the property required (mandatory)
 * @param jsTypeName JS name of the type of this property, if not null we will ask Vue to type
 * check based on it
 */
@JsOverlay
public final void addJavaProp(String propName, boolean required, String jsTypeName) {
    PropOptions propDefinition = new PropOptions();
    propDefinition.required = required;
    if (jsTypeName != null)
        propDefinition.type = ((JsPropertyMap<Object>) DomGlobal.window).get(jsTypeName);
    addProp(propName, propDefinition);
}
Also used : PropOptions(com.axellience.vuegwt.core.client.component.options.props.PropOptions) JsPropertyMap(jsinterop.base.JsPropertyMap) JsOverlay(jsinterop.annotations.JsOverlay)

Example 19 with JsOverlay

use of jsinterop.annotations.JsOverlay in project vue-gwt by Axellience.

the class VueComponentOptions method addJavaWatch.

/**
 * Add a watch property to this Component Definition
 * @param javaMethodName Name of the method in the {@link VueComponent}
 * @param watchedPropertyName Name of the property name to watch in the data model
 * @param isDeep Is the watcher deep (will watch child properties)
 */
@JsOverlay
public final void addJavaWatch(String javaMethodName, String watchedPropertyName, boolean isDeep) {
    if (!isDeep) {
        addWatch(watchedPropertyName, getJavaComponentMethod(javaMethodName));
        return;
    }
    JsPropertyMap watchDefinition = JsPropertyMap.of();
    watchDefinition.set("deep", true);
    watchDefinition.set("handler", getJavaComponentMethod(javaMethodName));
    addWatch(watchedPropertyName, watchDefinition);
}
Also used : JsPropertyMap(jsinterop.base.JsPropertyMap) JsOverlay(jsinterop.annotations.JsOverlay)

Aggregations

JsOverlay (jsinterop.annotations.JsOverlay)19 JsonObject (elemental.json.JsonObject)4 PropOptions (com.axellience.vuegwt.core.client.component.options.props.PropOptions)3 JsPropertyMap (jsinterop.base.JsPropertyMap)3 JsObject (elemental2.core.JsObject)2 EllipsoidSurfaceAppearanceOptions (org.cesiumjs.cs.scene.apperances.options.EllipsoidSurfaceAppearanceOptions)2 ComputedOptions (com.axellience.vuegwt.core.client.component.options.computed.ComputedOptions)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 Function (elemental2.core.Function)1 Date (java.util.Date)1 RecordUpdate (org.activityinfo.model.resource.RecordUpdate)1 PolylineGlowMaterialPropertyOptions (org.cesiumjs.cs.datasources.properties.options.PolylineGlowMaterialPropertyOptions)1 PerInstanceColorAppearanceOptions (org.cesiumjs.cs.scene.apperances.options.PerInstanceColorAppearanceOptions)1 ParticleBurstOptions (org.cesiumjs.cs.scene.particle.options.ParticleBurstOptions)1 Event (org.jboss.errai.common.client.dom.Event)1 EventListener (org.jboss.errai.common.client.dom.EventListener)1 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1