
org.ioc.commons.impl.gwt.client.ui.JsUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-gwt-impl Show documentation
Show all versions of ioc-commons-gwt-impl Show documentation
GWT implementation for ioc-commons artifacts.
package org.ioc.commons.impl.gwt.client.ui;
public class JsUtil {
private JsUtil() {
// Sólo métodos estáticos
}
public static native double extractNumberValue(String s) /*-{
if (s == "auto" || s == "inherit" || s == "") {
return 0;
} else {
// numberRegex is similar to java.lang.Number.floatRegex, but divides
// the string into a leading numeric portion followed by an arbitrary
// portion.
var numberRegex = @com.google.gwt.user.client.ui.UIObject::numberRegex;
if (!numberRegex) {
numberRegex = @com.google.gwt.user.client.ui.UIObject::numberRegex = /^(\s*[+-]?((\d+\.?\d*)|(\.\d+))([eE][+-]?\d+)?)(.*)$/;
}
// Extract the leading numeric portion of s
s = s.replace(numberRegex, "$1");
return parseFloat(s);
}
}-*/;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy