net.java.html.lib.angular.IAttributes Maven / Gradle / Ivy
package net.java.html.lib.angular;
public class IAttributes extends net.java.html.lib.Objs {
protected IAttributes(net.java.html.lib.Objs.Constructor> c, java.lang.Object js) {
super(c, js);
}
private static final class $Constructor extends net.java.html.lib.Objs.Constructor {
$Constructor() {
super(IAttributes.class);
}
@Override
public IAttributes create(java.lang.Object obj) {
return obj == null ? null : new IAttributes(this, obj);
}
};
private static final $Constructor $AS = new $Constructor();
public static IAttributes $as(java.lang.Object obj) {
return $AS.create(obj);
}
/**
* this is necessary to be able to access the scoped attributes. it's not very elegant
* because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
* this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
*/
public java.lang.Object $get(java.lang.String name) {
return $Typings$.$get$56($js(this), name);
}
/**
* A map of DOM element attribute names to the normalized name. This is needed
* to do reverse lookup from normalized name back to actual name.
*/
public net.java.html.lib.Objs.Property $attr = net.java.html.lib.Objs.Property.create(this, net.java.html.lib.Objs.class, "$attr");
public net.java.html.lib.Objs $attr() { return $attr.get(); }
/**
* Adds the CSS class value specified by the classVal parameter to the
* element. If animations are enabled then an animation will be triggered
* for the class addition.
*/
public void $addClass(java.lang.String classVal) {
$Typings$.$addClass$57($js(this), classVal);
}
/**
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
*
* Also there is special case for Moz prefix starting with upper case letter.
*
* For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives
*/
public java.lang.String $normalize(java.lang.String name) {
return $Typings$.$normalize$58($js(this), name);
}
/**
* Observes an interpolated attribute.
* The observer function will be invoked once during the next $digest
* following compilation. The observer is then invoked whenever the
* interpolated value changes.
*/
public net.java.html.lib.Function $observe(java.lang.String name, net.java.html.lib.Function.A1 super T,? extends java.lang.Object> fn) {
return (net.java.html.lib.Function)net.java.html.lib.Function.$as($Typings$.$observe$59($js(this), name, net.java.html.lib.Objs.$js(net.java.html.lib.Function.newFunction(fn, new Class[] {null}))));
}
/**
* Removes the CSS class value specified by the classVal parameter from the
* element. If animations are enabled then an animation will be triggered for
* the class removal.
*/
public void $removeClass(java.lang.String classVal) {
$Typings$.$removeClass$60($js(this), classVal);
}
/**
* Set DOM element attribute value.
*/
public void $set(java.lang.String key, java.lang.Object value) {
$Typings$.$set$61($js(this), key, /* AnyKeyword*/$js(value));
}
/**
* Adds and removes the appropriate CSS class values to the element based on the difference between
* the new and old CSS class values (specified as newClasses and oldClasses).
*/
public void $updateClass(java.lang.String newClasses, java.lang.String oldClasses) {
$Typings$.$updateClass$62($js(this), newClasses, oldClasses);
}
}