// This class provides an object that can be used to wait // until a web load has been completed in IE. // // It overrides NavigateComplete2 to get a reference to // the top level dispatch-object. // // It also overrides DocumentComplete to check when the // top level dispatch-object has completed loading, // and then calls notifyAll. public class WebLoadListener extends WebEventsAdapter { private ezjcom.JComObject topLevelpDisp = null; String fullUrl = null; public void initialize() { topLevelpDisp = null; } public String getFullURL() { return fullUrl; } public void NavigateComplete2(ezjcom.JComObject pDisp, ezjcom.JComVariant URL) { if ( topLevelpDisp == null ) { // Save the top level dispatch pointer, as well as the fully expanded URL topLevelpDisp = pDisp; fullUrl = URL.toString(); } } public void DocumentComplete(ezjcom.JComObject pDisp, ezjcom.JComVariant URL) { if ( pDisp.equals( topLevelpDisp )) { topLevelpDisp = null; // Top level object completed, page loading is complete. synchronized( this ) { // Notify any listeners notifyAll(); } } } }