/** * Returns the value of the <tt>src</tt> attribute. * @return the value of the <tt>src</tt> attribute */ public String jsxGet_src() { final HtmlImage img = (HtmlImage) getDomNodeOrDie(); final String src = img.getSrcAttribute(); if (instantiatedViaJavaScript_ && "".equals(src)) { return src; } try { final HtmlPage page = (HtmlPage) img.getPage(); return page.getFullyQualifiedUrl(src).toExternalForm(); } catch (final MalformedURLException e) { final String msg = "Unable to create fully qualified URL for src attribute of image " + e.getMessage(); throw Context.reportRuntimeError(msg); } }
/** * Returns the value of the <tt>src</tt> attribute. * @return the value of the <tt>src</tt> attribute */ public String jsxGet_src() { final HtmlImage img = (HtmlImage) getDomNodeOrDie(); final String src = img.getSrcAttribute(); if (instantiatedViaJavaScript_ && "".equals(src)) { return src; } try { final HtmlPage page = (HtmlPage) img.getPage(); return page.getFullyQualifiedUrl(src).toExternalForm(); } catch (final MalformedURLException e) { final String msg = "Unable to create fully qualified URL for src attribute of image " + e.getMessage(); throw Context.reportRuntimeError(msg); } }
/** * Returns the value of the <tt>src</tt> attribute. * @return the value of the <tt>src</tt> attribute */ public String jsxGet_src() { final HtmlImage img = (HtmlImage) getDomNodeOrDie(); final String src = img.getSrcAttribute(); if (instantiatedViaJavaScript_ && "".equals(src)) { return src; } try { final HtmlPage page = (HtmlPage) img.getPage(); return page.getFullyQualifiedUrl(src).toExternalForm(); } catch (final MalformedURLException e) { final String msg = "Unable to create fully qualified URL for src attribute of image " + e.getMessage(); throw Context.reportRuntimeError(msg); } }
/** * Returns the value of the {@code src} attribute. * @return the value of the {@code src} attribute */ @JsxGetter public String getSrc() { final HtmlImage img = (HtmlImage) getDomNodeOrDie(); final String src = img.getSrcAttribute(); if ("".equals(src)) { return src; } try { final HtmlPage page = (HtmlPage) img.getPage(); return page.getFullyQualifiedUrl(src).toExternalForm(); } catch (final MalformedURLException e) { final String msg = "Unable to create fully qualified URL for src attribute of image " + e.getMessage(); throw Context.reportRuntimeError(msg); } }
/** * Returns the value of the {@code src} attribute. * @return the value of the {@code src} attribute */ @JsxGetter public String getSrc() { final HtmlImage img = (HtmlImage) getDomNodeOrDie(); final String src = img.getSrcAttribute(); if ("".equals(src)) { return src; } try { final HtmlPage page = (HtmlPage) img.getPage(); return page.getFullyQualifiedUrl(src).toExternalForm(); } catch (final MalformedURLException e) { final String msg = "Unable to create fully qualified URL for src attribute of image " + e.getMessage(); throw Context.reportRuntimeError(msg); } }
final PostponedAction action = new PostponedAction(getPage()) { @Override public void execute() throws Exception {
final PostponedAction action = new PostponedAction(getPage()) { @Override public void execute() throws Exception {
final PostponedAction action = new PostponedAction(getPage()) { @Override public void execute() throws Exception {
final PostponedAction action = new PostponedAction(getPage()) { @Override public void execute() throws Exception {
/** * <span style="color:red">POTENIAL PERFORMANCE KILLER - DOWNLOADS THE IMAGE - USE AT YOUR OWN RISK.</span><br/> * If the image is not already downloaded it triggers a download. Then it stores the image in the HtmlImage * object for later use.<br/> * * Downloads the image specified in the src attribute. * * @throws IOException if an error occurs while downloading the image or if the stream is of an * unsupported content-type */ private void downloadImageIfNeeded() throws IOException { if (!downloaded_) { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient(); final URL url = page.getFullyQualifiedUrl(getSrcAttribute()); final WebRequestSettings request = new WebRequestSettings(url); request.setAdditionalHeader("Referer", page.getWebResponse().getRequestSettings().getUrl().toExternalForm()); imageWebResponse_ = webclient.loadWebResponse(request); downloaded_ = true; } }
if (!"".equals(src) && !(hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) && StringUtils.isBlank(src))) { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient();
/** * <span style="color:red">POTENIAL PERFORMANCE KILLER - DOWNLOADS THE IMAGE - USE AT YOUR OWN RISK.</span><br/> * If the image is not already downloaded it triggers a download. Then it stores the image in the HtmlImage * object for later use.<br/> * * Downloads the image specified in the src attribute. * * @throws IOException if an error occurs while downloading the image or if the stream is of an * unsupported content-type */ private void downloadImageIfNeeded() throws IOException { if (!downloaded_) { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient(); final URL url = page.getFullyQualifiedUrl(getSrcAttribute()); final WebRequestSettings request = new WebRequestSettings(url); request.setAdditionalHeader("Referer", page.getWebResponse().getRequestSettings().getUrl().toExternalForm()); imageWebResponse_ = webclient.loadWebResponse(request); downloaded_ = true; } }
/** * <span style="color:red">POTENIAL PERFORMANCE KILLER - DOWNLOADS THE IMAGE - USE AT YOUR OWN RISK.</span><br/> * If the image is not already downloaded it triggers a download. Then it stores the image in the HtmlImage * object for later use.<br/> * * Downloads the image specified in the src attribute. * * @throws IOException if an error occurs while downloading the image or if the stream is of an * unsupported content-type */ private void downloadImageIfNeeded() throws IOException { if (!downloaded_) { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient(); final URL url = page.getFullyQualifiedUrl(getSrcAttribute()); final WebRequestSettings request = new WebRequestSettings(url); request.setAdditionalHeader("Referer", page.getWebResponse().getRequestSettings().getUrl().toExternalForm()); imageWebResponse_ = webclient.loadWebResponse(request); downloaded_ = true; } }
if (!"".equals(src) && !(hasFeature(HTMLIMAGE_BLANK_SRC_AS_EMPTY) && StringUtils.isBlank(src))) { final HtmlPage page = (HtmlPage) getPage(); final WebClient webclient = page.getWebClient();
final HtmlElement doc = ((HtmlPage) getPage()).getDocumentElement(); final HtmlMap map = doc.getOneHtmlElementByAttribute("map", "name", mapName); for (final DomElement element : map.getChildElements()) {
final HtmlElement doc = ((HtmlPage) getPage()).getDocumentElement(); final HtmlMap map = doc.getOneHtmlElementByAttribute("map", "name", mapName); for (final DomElement element : map.getChildElements()) {
final HtmlElement doc = ((HtmlPage) getPage()).getDocumentElement(); final HtmlMap map = doc.getOneHtmlElementByAttribute("map", "name", mapName); for (final HtmlElement element : map.getChildElements()) {
final HtmlElement doc = ((HtmlPage) getPage()).getDocumentElement(); final HtmlMap map = doc.getOneHtmlElementByAttribute("map", "name", mapName); for (final HtmlElement element : map.getChildElements()) {
final HtmlElement doc = ((HtmlPage) getPage()).getDocumentElement(); final HtmlMap map = doc.getOneHtmlElementByAttribute("map", "name", mapName); for (final HtmlElement element : map.getChildElements()) {