xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Iterating Listeners
Date Mon, 20 Nov 2006 00:50:16 GMT
Hi KWL,

"K. W. Landry" <kwlandry@gmail.com> wrote on 11/18/2006 09:44:33 PM:

> I have to believe if there were another way you'd mention it, but just 
in case, 
> is there another way you'd suggest going about enumerating all active 
listeners? 

   There isn't a way that I would suggest enumerating listeners.  However 
if
you are willing to hack Batik enough it can be done.  You would need to 
replace
the standard EventSupport class in the DOM, by overriding 
batik.dom.AbstractDOMImplementation.createEventSupport, to return a custom
subclass of batik.dom.events.EventSupport that exposed public getters for
the capturingListenrs and bubblingListeners HashTables.  Then you
could call 'getEventSupport()' on any node and get those two HashTables
which would give you all the active listeners.

   The main problem with this is that you will likely be surprised at
the number of listeners that are present on even a simple document as
Batik uses listeners to implement much if it's own update/change 
management
and you will see these listeners mixed with your own...

> I know in the API there is an 
org.apache.batik.dom.events.EventListenerList, I
> haven't been able to get it to work as I would like, however. 
> 
> Any thoughts appreciated, 
> 
> Thanks, 
> 
> KWL

> On 11/17/06, thomas.deweese@kodak.com <thomas.deweese@kodak.com> wrote:
> Hi K. W.
> 
> "K. W. Landry" <kwlandry@gmail.com> wrote on 11/13/2006 10:34:33 PM:
> 
> > Anyone have an example of iterating through a DOM to return all active 

> > Listeners (of any flavor)?
> 
>    To my knowledge this can't be done in DOM.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message