author = ashuk

r = edburns
a = edburns

Implements RemoveListener


git-svn-id: svn://10.0.0.236/trunk@74818 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ashuk%eng.sun.com
2000-07-26 20:07:11 +00:00
parent 4554a01d45
commit b5f214c647
5 changed files with 157 additions and 30 deletions

View File

@@ -90,8 +90,6 @@ public EventRegistrationImpl(WrapperFactory yourFactory,
public void delete()
{
// this removes all listeners
nativeEventThread.removeListener(null);
nativeEventThread = null;
super.delete();
@@ -127,11 +125,12 @@ public void removeDocumentLoadListener(DocumentLoadListener listener)
ParameterCheck.nonNull(listener);
myFactory.throwExceptionIfNotInitialized();
Assert.assert(-1 != nativeWebShell);
throw new UnimplementedException("\nUnimplementedException -----\n API Function EventRegistration.removeDocumentLoadListener has not yet been implemented.\n");
// synchronized(myBrowserControl) {
// }
Assert.assert(null != nativeEventThread);
ParameterCheck.nonNull(listener);
synchronized(myBrowserControl) {
nativeEventThread.removeListener(listener);
}
}
public void addMouseListener(MouseListener listener)
@@ -160,11 +159,12 @@ public void removeMouseListener(MouseListener listener)
ParameterCheck.nonNull(listener);
myFactory.throwExceptionIfNotInitialized();
Assert.assert(-1 != nativeWebShell);
Assert.assert(null != nativeEventThread);
ParameterCheck.nonNull(listener);
throw new UnimplementedException("\nUnimplementedException -----\n API Function EventRegistration.removeMouseListener has not yet been implemented.\n");
// synchronized(myBrowserControl) {
// }
synchronized(myBrowserControl) {
nativeEventThread.removeListener((WebclientEventListener)listener);
}
}
// ----VERTIGO_TEST_START
@@ -179,7 +179,7 @@ public static void main(String [] args)
Log.setApplicationName("EventRegistrationImpl");
Log.setApplicationVersion("0.0");
Log.setApplicationVersionDate("$Id: EventRegistrationImpl.java,v 1.7 2000-07-22 02:48:25 edburns%acm.org Exp $");
Log.setApplicationVersionDate("$Id: EventRegistrationImpl.java,v 1.8 2000-07-26 20:03:09 ashuk%eng.sun.com Exp $");
try {
org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]);

View File

@@ -226,14 +226,15 @@ public void run()
if (null != listenersToAdd && !listenersToAdd.isEmpty()) {
tempEnum = listenersToAdd.elements();
while (tempEnum.hasMoreElements()) {
nativeAddListener(nativeWebShell,
(WebclientEventListener)
tempEnum.nextElement());
}
listenersToAdd.clear();
while (tempEnum.hasMoreElements()) {
WebclientEventListener tempListener = (WebclientEventListener)
tempEnum.nextElement();
nativeAddListener(nativeWebShell,tempListener);
}
doRemoveListeners();
listenersToAdd.clear();
}
doRemoveListeners();
}
}
@@ -268,9 +269,12 @@ private void doRemoveListeners()
}
}
else {
throw new UnimplementedException("Webclient nativeRemoveListener not yet implemented");
// throw new UnimplementedException("Webclient nativeRemoveListener not yet implemented");
nativeRemoveListener(nativeWebShell,
(WebclientEventListener) listenerObj);
}
}
listenersToRemove.clear();
}
@@ -423,6 +427,15 @@ public native void nativeProcessEvents(int webShellPtr);
public native void nativeAddListener(int webShellPtr,
WebclientEventListener typedListener);
/**
* Called from Java to allow the native code to remove a listener.
*/
public native void nativeRemoveListener(int webShellPtr,
WebclientEventListener typedListener);
/**
* Called from Java to allow the native code to remove all listeners.