Package net.rim.device.api.script

Examples of net.rim.device.api.script.ScriptableFunction.invoke()


        // send JSON object to JavaScript function provided as the call back function parameter to the register_ndef function
        ScriptableFunction ndef_callback = _registry.getNdefFunction(typeNameFormat,record_type);
        if (ndef_callback != null) {
            try {
                Object[] args = new Object[] { json_ndef_message };
                ndef_callback.invoke(null, args);
            } catch (Exception e) {
                log("Could not dispatch message",typeNameFormat,record_type,json_ndef_message,e);
            }
        } else {
            log("No listener registered for message", typeNameFormat,
View Full Code Here


        log("Reporting error",typeNameFormat,record_type,error_message);
        ScriptableFunction on_error_function = _registry.getErrorFunction(record_type);
        if (on_error_function != null) {
            try {
                Object [] args = new Object[] { error_message };
                on_error_function.invoke(null, args);
            } catch(Exception e) {
                log("Could not dispatch error message",typeNameFormat, record_type, error_message,e);
            }
        } else {
            log("No error handler registered",typeNameFormat,record_type,error_message);
View Full Code Here

                 final ScriptableFunction sf = (ScriptableFunction)_vec.elementAt(i);
                   _appObject.invokeLater(new Runnable() {
                       public void run() {
                             try {
                                
                                 sf.invoke(null, new Object[] { eService, msg });

                             } catch (Exception e) {
                                   System.out.println("Error invoking callback: " + e.getMessage());
                                   throw new RuntimeException("Error invoking callback: " + e.getMessage());
                             }
View Full Code Here

           
            Object[] result = new Object[] {item};
         
            // Pass the event back to the JavaScript callback
            ScriptableFunction onItemOpened = messageListNamespace.getOnItemOpened();
            onItemOpened.invoke(onItemOpened, result);
          }
          catch (Exception e) {
            throw new RuntimeException(e.getMessage());
          }
        }
View Full Code Here

                  final ScriptableFunction sf = (ScriptableFunction)_vec.elementAt(i);
                    _appObject.invokeLater(new Runnable() {
                        public void run() {
                              try {
                                 
                                  sf.invoke(null, new Object[] { eService, msg });

                              } catch (Exception e) {
                                    System.out.println("Error invoking callback: " + e.getMessage());
                                    throw new RuntimeException("Error invoking callback: " + e.getMessage());
                              }
View Full Code Here

           
            Object[] result = new Object[] {item};
         
            // Pass the event back to the JavaScript callback
            ScriptableFunction onItemOpened = getOnItemOpened();
            onItemOpened.invoke(onItemOpened, result);
          }
          catch (Exception e) {
            throw new RuntimeException(e.getMessage());
          }
        }
View Full Code Here

           
            Object[] result = new Object[]{item};
         
            // Pass the event back to the JavaScript callback
            ScriptableFunction onItemMarkedRead = getOnItemMarkedRead();
            onItemMarkedRead.invoke(onItemMarkedRead, result);
          }
          catch (Exception e) {
            throw new RuntimeException(e.getMessage());
          }
        }
View Full Code Here

           
            Object[] result = new Object[]{item};
         
            // Pass the event back to the JavaScript callback
            ScriptableFunction onItemMarkedUnread = getOnItemMarkedUnread();
            onItemMarkedUnread.invoke(onItemMarkedUnread, result);
          }
          catch (Exception e) {
            throw new RuntimeException(e.getMessage());
          }
        }
View Full Code Here

           
            Object[] result = new Object[]{item};
         
            // Pass the event back to the JavaScript callback
            ScriptableFunction onItemDeleted = getOnItemDeleted();
            onItemDeleted.invoke(onItemDeleted, result);
          }
          catch (Exception e) {
            throw new RuntimeException(e.getMessage());
          }
        }
View Full Code Here

            }
            public void throwError(Exception e){
              if(errorCallback != null){
               
          try {
            errorCallback.invoke(thiz, new Object[] {new ErrorObject(-1, e.getMessage())} );
          } catch (Exception e1) {
          }
              }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.