/** * Returns the form which contains this element. If this element is not inside a form, this method * throws an {@link IllegalStateException}. * @return the form which contains this element */ public HtmlForm getEnclosingFormOrDie() { final HtmlForm form = getEnclosingForm(); if (form == null) { throw new IllegalStateException("Element is not contained within a form: " + this); } return form; }
/** * Returns the form which contains this element. If this element is not inside a form, this method * throws an {@link IllegalStateException}. * @return the form which contains this element */ public HtmlForm getEnclosingFormOrDie() { final HtmlForm form = getEnclosingForm(); if (form == null) { throw new IllegalStateException("Element is not contained within a form: " + this); } return form; }
/** * Returns the form which contains this element. If this element is not inside a form, this method * throws an {@link IllegalStateException}. * @return the form which contains this element * @throws IllegalStateException if the element is not inside a form */ public HtmlForm getEnclosingFormOrDie() throws IllegalStateException { final HtmlForm form = getEnclosingForm(); if (form == null) { throw new IllegalStateException("Element is not contained within a form: " + this); } return form; }
/** * Returns the form which contains this element. If this element is not inside a form, this method * throws an {@link IllegalStateException}. * @return the form which contains this element * @throws IllegalStateException if the element is not inside a form */ public HtmlForm getEnclosingFormOrDie() throws IllegalStateException { final HtmlForm form = getEnclosingForm(); if (form == null) { throw new IllegalStateException("Element is not contained within a form: " + this); } return form; }
/** * Returns the form which contains this element. If this element is not inside a form, this method * throws an {@link IllegalStateException}. * @return the form which contains this element * @throws IllegalStateException if the element is not inside a form */ public HtmlForm getEnclosingFormOrDie() throws IllegalStateException { final HtmlForm form = getEnclosingForm(); if (form == null) { throw new IllegalStateException("Element is not contained within a form: " + this); } return form; }
@Override protected boolean isAccepted(final DomNode node) { if (node instanceof HtmlForm) { filterChildrenOfNestedForms_ = true; return false; } final boolean accepted = super.isAccepted(node); if (accepted && filterChildrenOfNestedForms_) { return ((HtmlElement) node).getEnclosingForm() == HtmlForm.this; } return accepted; } };
/** * Returns the value of the JavaScript <tt>form</tt> attribute. * * @return the value of the JavaScript <tt>form</tt> attribute */ public HTMLFormElement jsxGet_form() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
/** * Returns the value of the JavaScript <tt>form</tt> attribute. * * @return the value of the JavaScript <tt>form</tt> attribute */ public HTMLFormElement jsxGet_form() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
/** * Returns the value of the JavaScript <tt>form</tt> attribute. * * @return the value of the JavaScript <tt>form</tt> attribute */ public HTMLFormElement jsxGet_form() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
@Override public boolean hasFormParameterNamed(String paramName) { for (HtmlElement e : getCurrentPage().getHtmlElementDescendants()) { if (e.getAttribute("name").equals(paramName)) { // set the working form if none has been set if (e.getEnclosingForm() != null && getWorkingForm() == null) { setWorkingForm(e.getEnclosingForm()); } return true; } } return false; }
/** * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) * @param domNode the DOM node */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); if (form != null) { setParentScope(getScriptableFor(form)); } }
/** * Returns the value of the JavaScript {@code form} attribute. * * @return the value of the JavaScript {@code form} attribute */ @JsxGetter public HTMLFormElement getForm() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
/** * Returns the value of the JavaScript {@code form} attribute. * * @return the value of the JavaScript {@code form} attribute */ @JsxGetter public HTMLFormElement getForm() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
/** * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) * @param domNode the DOM node */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); if (form != null) { setParentScope(getScriptableFor(form)); } }
/** * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) * @param domNode the DOM node */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); if (form != null) { setParentScope(getScriptableFor(form)); } }
/** * Returns the value of the JavaScript {@code form} attribute. * * @return the value of the JavaScript {@code form} attribute */ @JsxGetter public HTMLFormElement getForm() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); }
/** * Returns the value of the JavaScript {@code form} attribute. * * @return the value of the JavaScript {@code form} attribute */ @JsxGetter public HTMLFormElement getForm() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); } }
/** * Returns the value of the JavaScript {@code form} attribute. * * @return the value of the JavaScript {@code form} attribute */ @JsxGetter public HTMLFormElement getForm() { final HtmlForm form = getDomNodeOrDie().getEnclosingForm(); if (form == null) { return null; } return (HTMLFormElement) getScriptableFor(form); } }
/** * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) * @param domNode the DOM node */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); if (form != null) { setParentScope(getScriptableFor(form)); } }
/** * Sets the associated DOM node and sets the enclosing form as parent scope of the current element. * @see com.gargoylesoftware.htmlunit.javascript.SimpleScriptable#setDomNode(DomNode) * @param domNode the DOM node */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); final HtmlForm form = ((HtmlElement) domNode).getEnclosingForm(); if (form != null) { setParentScope(getScriptableFor(form)); } }