textbender.o.rhinohide.events
Class RelaySI

java.lang.Object
  extended by Relay
      extended by RelaySI
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
RelaySIP

public abstract class RelaySI
extends Relay

A synchronous relay, based on an intermediate JavaScript listener/relay [but with bugs] The JavaScript side listener/relay pushes events out to the Java side.

Suffers same bugs as RelayS. Try RelaySIP, instead.


Nested Class Summary
 class RelaySI.DispatchAdaptor
          Relay adaptor that wraps each event from the JavaScript side, as a proper Java Event.
 
Field Summary
(package private)  Object dispatchAdaptor
          Called from JavaScript side when event occurs.
static String HANDLE_EVENT_SCRIPT
          Implementation of rhiRelay listener, expressed as a script fragment.
(package private)  Rhinohide rhiRelay
          The listener/relay on the JavaScript side.
 
Constructor Summary
RelaySI()
          Creates a RelaySI.
RelaySI(boolean dummyFlag)
          Creates a modified RelaySI.
 
Method Summary
(package private)  void addTo(RhiEventTarget target, String type, boolean useCapture)
          Adds a JavaScript relay to the specified target, as a listener.
(package private)  netscape.javascript.JSObject createJSORelay_orNull(RhiWindow window)
           
(package private)  void removeFrom(RhiEventTarget target, String type, boolean useCapture)
          Removes this relay from the specified target.
 
Methods inherited from class Relay
checkThreadSafe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.events.EventListener
handleEvent
 

Field Detail

dispatchAdaptor

Object dispatchAdaptor
Called from JavaScript side when event occurs. Wraps it as Java DOM Event, and forwards it to EventListener.this.


rhiRelay

Rhinohide rhiRelay
The listener/relay on the JavaScript side. It's a free object on that side, subject to garbage collection, so it should cleanly evaporate when we're done with it.


HANDLE_EVENT_SCRIPT

public static final String HANDLE_EVENT_SCRIPT
Implementation of rhiRelay listener, expressed as a script fragment. [This will later be made private.]

See Also:
Constant Field Values
Constructor Detail

RelaySI

public RelaySI()
Creates a RelaySI.


RelaySI

RelaySI(boolean dummyFlag)
Creates a modified RelaySI.

Parameters:
dummyFlag - ignored, serves only to discriminate constructor
Method Detail

createJSORelay_orNull

@ThreadSafe
netscape.javascript.JSObject createJSORelay_orNull(RhiWindow window)

addTo

@ThreadSafe
void addTo(RhiEventTarget target,
                      String type,
                      boolean useCapture)
     throws StubbornRhinoException
Adds a JavaScript relay to the specified target, as a listener. The JavaScript relay pushes events out to this Java relay, which then wraps them and passes them on to the Java listener.

Specified by:
addTo in class Relay
Throws:
StubbornRhinoException

removeFrom

@ThreadSafe
void removeFrom(RhiEventTarget target,
                           String type,
                           boolean useCapture)
Description copied from class: Relay
Removes this relay from the specified target.

Specified by:
removeFrom in class Relay