Package org.htmlunit
Class WebClient.CurrentWindowTracker
java.lang.Object
org.htmlunit.WebClient.CurrentWindowTracker
- All Implemented Interfaces:
Serializable
,WebWindowListener
- Enclosing class:
WebClient
private static final class WebClient.CurrentWindowTracker
extends Object
implements WebWindowListener, Serializable
Keeps track of the current window. Inspired by WebTest's logic to track the current response.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Postprocessing to make sure we have always one top level window open.void
webWindowClosed
(WebWindowEvent event) A web window has been closed.void
The contents of a web window has been changed.void
webWindowOpened
(WebWindowEvent event) A web window has been opened.
-
Field Details
-
webClient_
-
ensureOneTopLevelWindow_
private final boolean ensureOneTopLevelWindow_
-
-
Constructor Details
-
CurrentWindowTracker
CurrentWindowTracker(WebClient webClient, boolean ensureOneTopLevelWindow)
-
-
Method Details
-
webWindowClosed
A web window has been closed. Closing the last window of the WebClient will automatically open a new one. You will receive an additional open event in this case.- Specified by:
webWindowClosed
in interfaceWebWindowListener
- Parameters:
event
- the event
-
afterWebWindowClosedListenersProcessed
Postprocessing to make sure we have always one top level window open. -
webWindowContentChanged
The contents of a web window has been changed.- Specified by:
webWindowContentChanged
in interfaceWebWindowListener
- Parameters:
event
- the event
-
webWindowOpened
A web window has been opened.Caution: the
WebClient.getCurrentWindow()
might be not updated so far. This usually takes place AFTER the event was processed- Specified by:
webWindowOpened
in interfaceWebWindowListener
- Parameters:
event
- the event (the oldPage and newPage properties will benull
because the event is generated after the window is opened but before the content is loaded)
-