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);
}
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++;
}
}
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);
}
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);
}
Aggregations