Search in sources :

Example 51 with Function

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

the class JSForm method js_setOnFindCmdMethod.

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

Example 52 with Function

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

the class JSForm method js_setOnDeleteAllRecordsCmdMethod.

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

Example 53 with Function

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

the class JSForm method js_setOnNewRecordCmdMethod.

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

Example 54 with Function

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

the class JSForm method js_setOnShowOmittedRecordsCmdMethod.

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

Example 55 with Function

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

the class JSForm method js_setOnNextRecordCmdMethod.

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

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