Esempio n. 1
0
 private void fireOnOpen() {
   if (openHandler_ == null) {
     return;
   }
   final Scriptable scope = openHandler_.getParentScope();
   final JavaScriptEngine jsEngine = containingPage_.getWebClient().getJavaScriptEngine();
   jsEngine.callFunction(
       containingPage_, openHandler_, scope, WebSocket.this, ArrayUtils.EMPTY_OBJECT_ARRAY);
 }
Esempio n. 2
0
 private boolean isAccepted(final Node node) {
   if (filter_ == null) {
     return true;
   }
   Function function = null;
   if (filter_ instanceof Function) {
     function = (Function) filter_;
   }
   final Object acceptNode = filter_.get("acceptNode", filter_);
   if (acceptNode instanceof Function) {
     function = (Function) acceptNode;
   }
   if (function != null) {
     final double value =
         Context.toNumber(
             function.call(
                 Context.getCurrentContext(), getParentScope(), this, new Object[] {node}));
     return value == NodeFilter.FILTER_ACCEPT;
   }
   return true;
 }