The default bug view has changed. See this FAQ.

Listener type introspection broken

RESOLVED FIXED

Status

Core Graveyard
Java APIs to WebShell
P3
normal
RESOLVED FIXED
17 years ago
5 years ago

People

(Reporter: edburns, Assigned: edburns)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

17 years ago
If you have one class that implements multiple webclient listener interfaces, 
you won't be able to add listeners.
(Assignee)

Comment 1

17 years ago
accept
Status: NEW → ASSIGNED
(Assignee)

Updated

17 years ago
Blocks: 33333
(Assignee)

Comment 2

17 years ago
Created attachment 12623 [details]
Full files of fix for this bug.
(Assignee)

Comment 3

17 years ago
Created attachment 12624 [details] [diff] [review]
Context diffs of fix for this bug.  Please review.
(Assignee)

Comment 4

17 years ago
Files in this fix:

M classes_spec/org/mozilla/webclient/wrapper_native/EventRegistrationImpl.java
M classes_spec/org/mozilla/webclient/wrapper_native/NativeEventThread.java
A classes_spec/org/mozilla/webclient/wrapper_native/WCEventListenerWrapper.java
M src_moz/NativeEventThread.cpp
M src_moz/motif/NativeLoaderStub.cpp

Added class WCEventListenerWrapper:

 * This class allows the custom app to have one instance that implements
 * multiple Webclient event listener types. <P>

 * This is simply a "struct" type class that encapsulates a listener
 * instance with its class name.  This is necessary because the class
 * name is lost when we deal with the listener as a
 * WebclientEventListener, and not a WebclientEventListener subclass. <P>

 * @see org.mozilla.webclient.wrapper_native.NativeEventThread#addListener

Made it so when a java listener is added,

 * We create a WCEventListenerWrapper containing the user passed
 * DocumentLoadListener, and the string obtained from
 * DocumentLoadListener.class.getName();

We then call nativeEventThread.addListener:

 * Takes the abstract WebclientEventListener instance and adds it to a
 * Vector of listeners to be added.  This vector is scanned each time
 * around the event loop in run(). <P>

 * The vector is a vector of WCEventListenerWrapper instances.  In run()
 * these are unpacked and sent to nativeAddListener like this:
 * nativeAddListener(nativeWebShell,tempListener.listener, 
 * tempListener.listenerClassName); <P>
(Assignee)

Comment 5

17 years ago
Fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
Component: Java APIs to WebShell → Java APIs to WebShell
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.