Search in sources :

Example 1 with PropOptions

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

the class VueComponentOptions method addJavaPropValidator.

/**
 * 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 addJavaPropValidator(String javaMethodName, String propertyName) {
    PropOptions propDefinition = (PropOptions) props.get(propertyName);
    propDefinition.validator = getJavaComponentMethod(javaMethodName);
}
Also used : PropOptions(com.axellience.vuegwt.core.client.component.options.props.PropOptions) JsOverlay(jsinterop.annotations.JsOverlay)

Example 2 with PropOptions

use of com.axellience.vuegwt.core.client.component.options.props.PropOptions 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 3 with PropOptions

use of com.axellience.vuegwt.core.client.component.options.props.PropOptions 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)

Aggregations

PropOptions (com.axellience.vuegwt.core.client.component.options.props.PropOptions)3 JsOverlay (jsinterop.annotations.JsOverlay)3 JsPropertyMap (jsinterop.base.JsPropertyMap)1