private void setMainWindow(WebWindow win) { wc.setCurrentWindow(win); this.win = win; }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { webWindow_.getWebClient().setCurrentWindow(webWindow_); }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { webWindow_.getWebClient().setCurrentWindow(webWindow_); }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { webWindow_.getWebClient().setCurrentWindow(webWindow_); }
webClient_.setCurrentWindow(newWindow); webClient_.setCurrentWindow( webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1)); webClient_.setCurrentWindow(null); webClient_.setCurrentWindow( webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1));
webClient_.setCurrentWindow(newWindow); webClient_.setCurrentWindow( webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1)); webClient_.setCurrentWindow(null); webClient_.setCurrentWindow( webClient_.topLevelWindows_.get(webClient_.topLevelWindows_.size() - 1));
private WebDriver finishSelecting(WebWindow window) { getWebClient().setCurrentWindow(window); currentWindow = window; pickWindow(); return HtmlUnitDriver.this; }
/** * {@inheritDoc} */ public void webWindowClosed(final WebWindowEvent event) { final WebWindow window = event.getWebWindow(); if (window instanceof TopLevelWindow) { final TopLevelWindow tlw = (TopLevelWindow) event.getWebWindow(); topLevelWindows_.remove(tlw); if (tlw.equals(getCurrentWindow())) { if (topLevelWindows_.isEmpty()) { // Must always have at least window, and there are no top-level windows left; must create one. final TopLevelWindow newWindow = new TopLevelWindow("", WebClient.this); topLevelWindows_.push(newWindow); setCurrentWindow(newWindow); } else { // The current window is now the previous top-level window. setCurrentWindow(topLevelWindows_.peek()); } } } else if (event.getWebWindow() == getCurrentWindow()) { // The current window is now the last top-level window. setCurrentWindow(topLevelWindows_.peek()); } } /**
/** * {@inheritDoc} */ public void webWindowClosed(final WebWindowEvent event) { final WebWindow window = event.getWebWindow(); if (window instanceof TopLevelWindow) { final TopLevelWindow tlw = (TopLevelWindow) event.getWebWindow(); topLevelWindows_.remove(tlw); if (tlw.equals(getCurrentWindow())) { if (topLevelWindows_.isEmpty()) { // Must always have at least window, and there are no top-level windows left; must create one. final TopLevelWindow newWindow = new TopLevelWindow("", WebClient.this); topLevelWindows_.push(newWindow); setCurrentWindow(newWindow); } else { // The current window is now the previous top-level window. setCurrentWindow(topLevelWindows_.peek()); } } } else if (event.getWebWindow() == getCurrentWindow()) { // The current window is now the last top-level window. setCurrentWindow(topLevelWindows_.peek()); } } /**
/** * {@inheritDoc} */ public void webWindowClosed(final WebWindowEvent event) { final WebWindow window = event.getWebWindow(); if (window instanceof TopLevelWindow) { final TopLevelWindow tlw = (TopLevelWindow) event.getWebWindow(); topLevelWindows_.remove(tlw); if (tlw.equals(getCurrentWindow())) { if (topLevelWindows_.isEmpty()) { // Must always have at least window, and there are no top-level windows left; must create one. final TopLevelWindow newWindow = new TopLevelWindow("", WebClient.this); topLevelWindows_.push(newWindow); setCurrentWindow(newWindow); } else { // The current window is now the previous top-level window. setCurrentWindow(topLevelWindows_.peek()); } } } else if (event.getWebWindow() == getCurrentWindow()) { // The current window is now the last top-level window. setCurrentWindow(topLevelWindows_.peek()); } } /**
public void webWindowContentChanged(WebWindowEvent webWindowEvent) { WebWindow window = webWindowEvent.getWebWindow(); if (waitingToLoad) { waitingToLoad = false; webClient.setCurrentWindow(window); } History history = histories.get(window); if (history == null) { history = new History(window); histories.put(window, history); } history.addNewPage(webWindowEvent.getNewPage()); }
/** * Sets the focus to this element. */ @JsxFunction public void focus() { final WebWindow window = getWebWindow(); window.getWebClient().setCurrentWindow(window); }
public WebDriver window(String windowId) { WebWindow window; try { window = webClient.getWebWindowByName(windowId); } catch (WebWindowNotFoundException e) { throw new NoSuchWindowException("Cannot find window: " + windowId); } webClient.setCurrentWindow(window); pickWindow(); return HtmlUnitDriver.this; }
/** * Sets the focus to this element. */ @JsxFunction public void focus() { final WebWindow window = getWebWindow(); window.getWebClient().setCurrentWindow(window); }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public <P extends Page> P click(final Event event, final boolean ignoreVisibility) throws IOException { final boolean ctrl = event.isCtrlKey(); WebWindow oldWebWindow = null; if (ctrl) { oldWebWindow = ((HTMLElement) event.getSrcElement()).getDomNodeOrDie() .getPage().getWebClient().getCurrentWindow(); } P page = super.click(event, ignoreVisibility); if (ctrl) { page.getEnclosingWindow().getWebClient().setCurrentWindow(oldWebWindow); page = (P) oldWebWindow.getEnclosedPage(); } return page; }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public <P extends Page> P click(final Event event, final boolean ignoreVisibility) throws IOException { final boolean ctrl = event.isCtrlKey(); WebWindow oldWebWindow = null; if (ctrl) { oldWebWindow = ((HTMLElement) event.getSrcElement()).getDomNodeOrDie() .getPage().getWebClient().getCurrentWindow(); } P page = super.click(event, ignoreVisibility); if (ctrl) { page.getEnclosingWindow().getWebClient().setCurrentWindow(oldWebWindow); page = (P) oldWebWindow.getEnclosedPage(); } return page; }
webClient_.setCurrentWindow(window);