Package net.rim.device.api.script

Examples of net.rim.device.api.script.ScriptableFunction


        String message;
        String[] buttons;
        // the default value of the default choice. The developer cannot change it.
        final int defaultChoice = 0;
        // callback function
        ScriptableFunction callback = (ScriptableFunction) args[ 2 ];
        // the default value of the global status. The developer cannot change it.
        final boolean global = false;
        // message
        message = (String) args[ 0 ];
        // choices & values
View Full Code Here


    private class JoinHostFunction extends ScriptableFunctionBase {
       
        protected Object execute(Object thiz, Object[] args) throws Exception {
            final int hostPIN =              (int)(Long.parseLong((String) args[0], 16) & 0x0FFFFFFFFL);
            final String hostPPID =                               (String) args[1];
            final ScriptableFunction onComplete =     (ScriptableFunction) args[2];
            final ScriptableFunction onHostAccepted = (ScriptableFunction) args[3];
            final ScriptableFunction onHostDeclined = (ScriptableFunction) args[4];
            final String cookie;
            if(args.length >= 6) {
                cookie = (String) args[5];
            } else {
                cookie = null;
View Full Code Here

    public void setOnFileTransferFailed(ScriptableFunction function) {
        _onFileTransferFailed = function;
    }
   
    private void dispatchOnConnectionAccepted(BBMPlatformConnection conn) {
        final ScriptableFunction onConnAccepted;
        try {
            onConnAccepted = (ScriptableFunction) _ioNamespace.getField(IONamespace.EVENT_ON_CONN_ACCEPTED);
        } catch(Exception e) {
            return;
        }
View Full Code Here

    public void channelCreated(BBMPlatformChannel channel) {
        this.dispatchOnConnectionAccepted(channel);
    }

    public void channelCreated(BBMPlatformChannel channel, int menuItemId) {
        final ScriptableFunction onBBMMenuInvite;
        try {
            onBBMMenuInvite = (ScriptableFunction) _ioNamespace.getField(IONamespace.EVENT_ON_BBM_MENU_INVITE);
        } catch(Exception e) {
            return;
        }
View Full Code Here

    }

    public void sessionEnded(BBMPlatformContact contact, BBMPlatformSession session) {
        final SessionObject sessionObj = (SessionObject)_connsHashConnObjs.get(session);
        try {
            final ScriptableFunction callback = (ScriptableFunction) sessionObj.getField(SessionObject.EVENT_ON_ENDED);
            final Object[] args = { new BBMPlatformUser(contact) };
            Util.dispatchCallback(callback, args);
        } catch( Exception e ) {
            // do nothing
        }
View Full Code Here

            Util.dispatchCallback(scriptRequest._declinedCallback, args);
        }
    }

    public void onContactReachable(BBMPlatformContact contact) {
        final ScriptableFunction callback;
        try {
            callback = (ScriptableFunction) _ioNamespace.getField(IONamespace.EVENT_ON_USER_REACHABLE);
        } catch(Exception e) {
            return;
        }
View Full Code Here

        };
        Util.dispatchCallback(callback, args);
    }

    public void onMessagesExpired(BBMPlatformContact contact, BBMPlatformData[] data) {
        final ScriptableFunction callback;
        try {
            callback = (ScriptableFunction) _ioNamespace.getField(IONamespace.EVENT_ON_DATA_EXPIRED);
        } catch(Exception e) {
            return;
        }
View Full Code Here

        };
        Util.dispatchCallback(callback, args);
    }

    public void onShareContentReceived(BBMPlatformContact contact, String description, BBMPlatformData content, long timestamp) {
        final ScriptableFunction callback;
        try {
            callback = (ScriptableFunction) UsersNamespace.getInstance().getField(UsersNamespace.EVENT_ON_SHARE_CONTENT);
        } catch(Exception e) {
            return;
        }
View Full Code Here

                    BBMPlatformConnection hostedConn = ((ConnectionObject) hostedConnObj).getConnection();
                    hostedConn.setPrivate();
                }
               
                final ConnectionObject connection =     (ConnectionObject) args[0];
                final ScriptableFunction onComplete = (ScriptableFunction) args[1];
                _onJoinReqReceived =                  (ScriptableFunction) args[2];
                _onJoinReqCanceled =                  (ScriptableFunction) args[3];
               
                Dispatcher.getInstance().dispatch(new DispatchableEvent(null) {
                    protected void dispatch() {
View Full Code Here

     * Adds a message listener.
     *
     * @return The <code>ScripableFunction</code> to be executed.
     */
    public ScriptableFunction add() {
        return new ScriptableFunction() {
            public Object invoke( Object self, Object[] args ) {
                if( args != null && args[ 0 ] instanceof ScriptableFunction ) {
                    listener = (ScriptableFunction) args[ 0 ];
                }
                return UNDEFINED;
View Full Code Here

TOP

Related Classes of net.rim.device.api.script.ScriptableFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.