private ConfigsBean parsePage(HtmlPage page,int id){ DomNode font = page.getElementById("font"+id); if (font == null || !font.asText().equals("可用")){ return null; } DomNode host = page.getElementById("host"+id); DomNode port = page.getElementById("port"+id); DomNode pass = page.getElementById("pass"+id); DomNode encrypt = page.getElementById("encrypt"+id); ConfigsBean configsBean = new ConfigsBean(); configsBean.setRemarks(host.asText()); configsBean.setServer(configsBean.getRemarks()); configsBean.setServer_port(Integer.parseInt(port.asText())); configsBean.setMethod(encrypt.asText()); configsBean.setPassword(pass.asText()); configsBean.setObfs("plain"); configsBean.setId(ModelUtil.generateId()); return configsBean; }
private String asString() { final Object resultObj = result_.get(0); if (resultObj instanceof DomAttr) { return ((DomAttr) resultObj).getValue(); } if (resultObj instanceof DomNode) { return ((DomNode) resultObj).asText(); } return resultObj.toString(); } }
private String asString() { final Object resultObj = result_.get(0); if (resultObj instanceof DomAttr) { return ((DomAttr) resultObj).getValue(); } if (resultObj instanceof DomNode) { return ((DomNode) resultObj).asText(); } return resultObj.toString(); } }
/** * Returns the {@code text} attribute. * @return the {@code text} attribute */ @JsxGetter public String getText() { final DomNode htmlElement = getDomNodeOrDie(); return htmlElement.asText(); }
/** * Returns the {@code text} attribute. * @return the {@code text} attribute */ @JsxGetter public String getText() { final DomNode htmlElement = getDomNodeOrDie(); return htmlElement.asText(); }
public String getResultText() { return testResultLink.getNextSibling().asText(); } public T assertNoTests() {
|| node instanceof HtmlButtonInput || node instanceof HtmlButton || node instanceof HtmlFileInput) { final String text = node.asText();
|| node instanceof HtmlButtonInput || node instanceof HtmlButton || node instanceof HtmlFileInput) { final String text = node.asText();
defaultHeight = getBrowserVersion().getFontHeight(getFontSize()); if (node instanceof HtmlDivision) { defaultHeight *= StringUtils.countMatches(node.asText(), '\n') + 1;
defaultHeight = getBrowserVersion().getFontHeight(getFontSize()); if (node instanceof HtmlDivision) { defaultHeight *= StringUtils.countMatches(node.asText(), '\n') + 1;
/** * Gets the associated sheet. * @see <a href="http://www.xulplanet.com/references/objref/HTMLStyleElement.html">Mozilla doc</a> * @return the sheet */ public Stylesheet jsxGet_sheet() { if (sheet_ != null) { return sheet_; } String css = ""; final HtmlStyle style = (HtmlStyle) getDomNodeOrDie(); if (style.getFirstChild() != null) { css = style.getFirstChild().asText(); } final Cache cache = getWindow().getWebWindow().getWebClient().getCache(); final CSSStyleSheet cached = cache.getCachedStyleSheet(css); final String uri = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings() .getUrl().toExternalForm(); if (cached != null) { sheet_ = new Stylesheet(this, cached, uri); } else { final InputSource source = new InputSource(new StringReader(css)); sheet_ = new Stylesheet(this, source, uri); cache.cache(css, sheet_.getWrappedSheet()); } return sheet_; }
/** * Gets the associated sheet. * @see <a href="http://www.xulplanet.com/references/objref/HTMLStyleElement.html">Mozilla doc</a> * @return the sheet */ public Stylesheet jsxGet_sheet() { if (sheet_ != null) { return sheet_; } String css = ""; final HtmlStyle style = (HtmlStyle) getDomNodeOrDie(); if (style.getFirstChild() != null) { css = style.getFirstChild().asText(); } final Cache cache = getWindow().getWebWindow().getWebClient().getCache(); final CSSStyleSheet cached = cache.getCachedStyleSheet(css); final String uri = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings() .getUrl().toExternalForm(); if (cached != null) { sheet_ = new Stylesheet(this, cached, uri); } else { final InputSource source = new InputSource(new StringReader(css)); sheet_ = new Stylesheet(this, source, uri); cache.cache(css, sheet_.getWrappedSheet()); } return sheet_; }
/** * Gets the associated sheet. * @see <a href="http://www.xulplanet.com/references/objref/HTMLStyleElement.html">Mozilla doc</a> * @return the sheet */ public Stylesheet jsxGet_sheet() { if (sheet_ != null) { return sheet_; } String css = ""; final HtmlStyle style = (HtmlStyle) getDomNodeOrDie(); if (style.getFirstChild() != null) { css = style.getFirstChild().asText(); } final Cache cache = getWindow().getWebWindow().getWebClient().getCache(); final CSSStyleSheet cached = cache.getCachedStyleSheet(css); final String uri = getDomNodeOrDie().getPage().getWebResponse().getRequestSettings() .getUrl().toExternalForm(); if (cached != null) { sheet_ = new Stylesheet(this, cached, uri); } else { final InputSource source = new InputSource(new StringReader(css)); sheet_ = new Stylesheet(this, source, uri); cache.cache(css, sheet_.getWrappedSheet()); } return sheet_; }