Search in sources :

Example 96 with Function

use of org.mozilla.javascript.Function in project servoy-client by Servoy.

the class JSForm method js_setOnHideMethod.

/**
 * @deprecated  As of release 4.1, replaced by setOnHideCmd(JSMethod).
 */
@Deprecated
public void js_setOnHideMethod(Object functionOrInteger) {
    checkModification();
    if (functionOrInteger instanceof Function) {
        Function function = (Function) functionOrInteger;
        ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
        if (scriptMethod != null) {
            getForm().setOnHideMethodID(scriptMethod.getID());
        } else {
            getForm().setOnHideMethodID(0);
        }
    } else if (functionOrInteger instanceof Number) {
        getForm().setOnHideMethodID(((Number) functionOrInteger).intValue());
    }
}
Also used : JSFunction(org.mozilla.javascript.annotations.JSFunction) Function(org.mozilla.javascript.Function) ScriptMethod(com.servoy.j2db.persistence.ScriptMethod)

Example 97 with Function

use of org.mozilla.javascript.Function in project servoy-client by Servoy.

the class JSForm method js_setOnSearchCmdMethod.

/**
 * @deprecated As of release 4.1, replaced by setOnSearchCmd(JSMethod).
 */
@Deprecated
public void js_setOnSearchCmdMethod(Object functionOrInteger) {
    checkModification();
    if (functionOrInteger instanceof Function) {
        Function function = (Function) functionOrInteger;
        ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
        if (scriptMethod != null) {
            getForm().setOnSearchCmdMethodID(scriptMethod.getID());
        } else {
            getForm().setOnSearchCmdMethodID(0);
        }
    } else if (functionOrInteger instanceof Number) {
        getForm().setOnSearchCmdMethodID(((Number) functionOrInteger).intValue());
    }
}
Also used : JSFunction(org.mozilla.javascript.annotations.JSFunction) Function(org.mozilla.javascript.Function) ScriptMethod(com.servoy.j2db.persistence.ScriptMethod)

Example 98 with Function

use of org.mozilla.javascript.Function in project servoy-client by Servoy.

the class JSForm method js_setOnRecordSelectionMethod.

/**
 * @deprecated As of release 4.1, replaced by setOnRecordSelection(JSMethod).
 */
@Deprecated
public void js_setOnRecordSelectionMethod(Object functionOrInteger) {
    checkModification();
    if (functionOrInteger instanceof Function) {
        Function function = (Function) functionOrInteger;
        ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
        if (scriptMethod != null) {
            getForm().setOnRecordSelectionMethodID(scriptMethod.getID());
        } else {
            getForm().setOnRecordSelectionMethodID(0);
        }
    } else if (functionOrInteger instanceof Number) {
        getForm().setOnRecordSelectionMethodID(((Number) functionOrInteger).intValue());
    }
}
Also used : JSFunction(org.mozilla.javascript.annotations.JSFunction) Function(org.mozilla.javascript.Function) ScriptMethod(com.servoy.j2db.persistence.ScriptMethod)

Example 99 with Function

use of org.mozilla.javascript.Function in project servoy-client by Servoy.

the class JSForm method js_setOnShowMethod.

/**
 * @deprecated As of release 4.1, replaced by setOnShow(JSMethod).
 */
@Deprecated
public void js_setOnShowMethod(Object functionOrInteger) {
    checkModification();
    if (functionOrInteger instanceof Function) {
        Function function = (Function) functionOrInteger;
        ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
        if (scriptMethod != null) {
            getForm().setOnShowMethodID(scriptMethod.getID());
        } else {
            getForm().setOnShowMethodID(0);
        }
    } else if (functionOrInteger instanceof Number) {
        getForm().setOnShowMethodID(((Number) functionOrInteger).intValue());
    }
}
Also used : JSFunction(org.mozilla.javascript.annotations.JSFunction) Function(org.mozilla.javascript.Function) ScriptMethod(com.servoy.j2db.persistence.ScriptMethod)

Example 100 with Function

use of org.mozilla.javascript.Function in project servoy-client by Servoy.

the class JSForm method js_setOnDuplicateRecordCmdMethod.

/**
 * @deprecated  As of release 4.1, replaced by setOnDuplicateRecordCmd(JSMethod).
 */
@Deprecated
@ServoyClientSupport(ng = false, wc = true, sc = true)
public void js_setOnDuplicateRecordCmdMethod(Object functionOrInteger) {
    checkModification();
    if (functionOrInteger instanceof Function) {
        Function function = (Function) functionOrInteger;
        ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
        if (scriptMethod != null) {
            getForm().setOnDuplicateRecordCmdMethodID(scriptMethod.getID());
        } else {
            getForm().setOnDuplicateRecordCmdMethodID(0);
        }
    } else if (functionOrInteger instanceof Number) {
        getForm().setOnDuplicateRecordCmdMethodID(((Number) functionOrInteger).intValue());
    }
}
Also used : JSFunction(org.mozilla.javascript.annotations.JSFunction) Function(org.mozilla.javascript.Function) ScriptMethod(com.servoy.j2db.persistence.ScriptMethod) ServoyClientSupport(com.servoy.base.scripting.annotations.ServoyClientSupport)

Aggregations

Function (org.mozilla.javascript.Function)126 Scriptable (org.mozilla.javascript.Scriptable)35 Context (org.mozilla.javascript.Context)33 ScriptMethod (com.servoy.j2db.persistence.ScriptMethod)27 ScriptableObject (org.mozilla.javascript.ScriptableObject)27 JSFunction (org.mozilla.javascript.annotations.JSFunction)25 MouseEventImpl (org.loboevolution.html.js.events.MouseEventImpl)11 BaseFunction (org.mozilla.javascript.BaseFunction)10 NativeJavaObject (org.mozilla.javascript.NativeJavaObject)10 NativeObject (org.mozilla.javascript.NativeObject)10 RepositoryException (com.servoy.j2db.persistence.RepositoryException)8 GlobalScope (com.servoy.j2db.scripting.GlobalScope)7 ServoyException (com.servoy.j2db.util.ServoyException)7 IOException (java.io.IOException)7 HtmlRendererContext (org.loboevolution.http.HtmlRendererContext)7 JSONObject (org.json.JSONObject)6 ModelNode (org.loboevolution.html.dom.nodeimpl.ModelNode)6 RhinoException (org.mozilla.javascript.RhinoException)6 PropertyDescription (org.sablo.specification.PropertyDescription)6 ArrayList (java.util.ArrayList)5