/** * {@inheritDoc} * @see SubmittableElement#reset() */ public void reset() { setValueAttribute(defaultValue_); }
/** * Sets the default value, optionally also modifying the current value. * @param defaultValue the new default value * @param modifyValue Whether or not to set the current value to the default value */ protected void setDefaultValue(final String defaultValue, final boolean modifyValue) { defaultValue_ = defaultValue; if (modifyValue) { setValueAttribute(defaultValue); } }
/** * Sets the default value, optionally also modifying the current value. * @param defaultValue the new default value * @param modifyValue Whether or not to set the current value to the default value */ protected void setDefaultValue(final String defaultValue, final boolean modifyValue) { defaultValue_ = defaultValue; if (modifyValue) { setValueAttribute(defaultValue); } }
/** * {@inheritDoc} * @see SubmittableElement#reset() */ @Override public void reset() { setValueAttribute(defaultValue_); }
/** * {@inheritDoc} * @see SubmittableElement#reset() */ public void reset() { setValueAttribute(defaultValue_); }
/** * {@inheritDoc} * @see SubmittableElement#reset() */ @Override public void reset() { setValueAttribute(defaultValue_); }
/** * {@inheritDoc} */ @Override public void setValueAttribute(String newValue) { if (StringUtils.isBlank(newValue) && hasFeature(JS_INPUT_SET_VALUE_URL_TRIMMED)) { newValue = ""; } super.setValueAttribute(newValue); }
/** * {@inheritDoc} */ @Override public void setValueAttribute(String newValue) { if (StringUtils.isBlank(newValue) && hasFeature(JS_INPUT_SET_VALUE_EMAIL_TRIMMED)) { newValue = ""; } super.setValueAttribute(newValue); }
/** * {@inheritDoc} */ @Override public void setAttribute(final String attributeName, final String attributeValue) { if ("value".equals(attributeName)) { setValueAttribute(attributeValue); } else { super.setAttribute(attributeName, attributeValue); } }
public void setAttribute(String name, String value) { if ("value".equals(name) && element instanceof HtmlInput) { // for HtmlInputs, we want to run any onChange code if the value changes ((HtmlInput) element).setValueAttribute(value); } else { element.setAttribute(name, value); } }
/** * {@inheritDoc} */ @Override public void setValueAttribute(String newValue) { if (StringUtils.isBlank(newValue) && hasFeature(JS_INPUT_SET_VALUE_URL_TRIMMED)) { newValue = ""; } super.setValueAttribute(newValue); }
/** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { if (hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START) || isValid(newValue)) { super.setValueAttribute(newValue); } }
public void clear() { assertElementNotStale(); if (element instanceof HtmlInput) { ((HtmlInput)element).setValueAttribute(""); } else if (element instanceof HtmlTextArea) { ((HtmlTextArea) element).setText(""); } }
/** * {@inheritDoc} */ @Override public void setValueAttribute(final String newValue) { if (hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START) || isValid(newValue)) { super.setValueAttribute(newValue); } }
/** * Logs in to Hudson. */ public WebClient login(String username, String password) throws Exception { HtmlPage page = goTo("/login"); // page = (HtmlPage) page.getFirstAnchorByText("Login").click(); HtmlForm form = page.getFormByName("login"); form.getInputByName("j_username").setValueAttribute(username); form.getInputByName("j_password").setValueAttribute(password); form.submit(null); return this; }
/** * Logs in to Hudson. */ public WebClient login(String username, String password) throws Exception { HtmlPage page = goTo("/login"); // page = (HtmlPage) page.getFirstAnchorByText("Login").click(); HtmlForm form = page.getFormByName("login"); form.getInputByName("j_username").setValueAttribute(username); form.getInputByName("j_password").setValueAttribute(password); form.submit(null); return this; }
/** * Logs in to Hudson. */ public WebClient login(String username, String password) throws Exception { HtmlPage page = goTo("/login"); // page = (HtmlPage) page.getFirstAnchorByText("Login").click(); HtmlForm form = page.getFormByName("login"); form.getInputByName("j_username").setValueAttribute(username); form.getInputByName("j_password").setValueAttribute(password); form.submit(null); return this; }
public HtmlPage search(String q) throws IOException, SAXException { HtmlPage top = goTo(""); HtmlForm search = top.getFormByName("search"); search.getInputByName("q").setValueAttribute(q); return (HtmlPage)search.submit(null); }
public HtmlPage search(String q) throws IOException, SAXException { HtmlPage top = goTo(""); HtmlForm search = top.getFormByName("search"); search.getInputByName("q").setValueAttribute(q); return (HtmlPage) search.submit(null); }
public void testMainFeature() throws Exception { WebClient wc = new WebClient(); HtmlPage page = wc.getPage(new URL(url, "/form.html")); HtmlForm f = page.getFormByName("main"); f.getInputByName("json").setValueAttribute("{\"first\":\"Kohsuke\",\"last\":\"Kawaguchi\"}"); f.submit(); }