Package org.w3c.dom.html2

Examples of org.w3c.dom.html2.HTMLCollection


    this.htmlDocument = document;
  }
 
  @Override
  public void jsConstructor(Object ob) {
    final HTMLDocument d = (HTMLDocument) Context.jsToJava(ob, HTMLDocument.class);
    this.htmlDocument = d;
    this.document = d;
    setNode(d);
    setDocumentJS(this);
  }
View Full Code Here


    final IHTMLParseResult htmlResult = response.getParsedHTML();
    if(htmlResult == null) {
      return null;
    }
    final Context cx = Context.getCurrentContext();
    final HTMLDocument domDocument = htmlResult.getDOMDocument();
    final Scriptable scope = ScriptableObject.getTopLevelScope(this);
    final Object docOb = Context.javaToJS(domDocument, scope);
    final Object[] args = { docOb };
    return cx.newObject(scope, "HTMLDocument", args);
  }
View Full Code Here

     * @see org.w3c.dom.html.HTMLSelectElement#setSelectedIndex(int)
     */
    public void setSelectedIndex(int selectedIndex) {
      NodeList nl = getElementsByTagName("option");
      for (int i=0;i<nl.getLength();i++) {
        HTMLOptionElement elem = (HTMLOptionElement)nl.item(i);
        elem.setSelected(false);
        if (selectedIndex == i)
            elem.setSelected(true);
      }
    }
View Full Code Here

     * @see org.w3c.dom.html.HTMLSelectElement#getValue()
     */
    public String getValue() {
      NodeList nl = getElementsByTagName("option");
      for (int i=0;i<nl.getLength();i++) {
        HTMLOptionElement elem = (HTMLOptionElement)nl.item(i);
        if (elem.getSelected()) return elem.getValue();
      }
        return "";
    }
View Full Code Here

     * @see org.w3c.dom.html.HTMLSelectElement#setValue(java.lang.String)
     */
    public void setValue(String value) {
      NodeList nl = getElementsByTagName("option");
      for (int i=0;i<nl.getLength();i++) {
        HTMLOptionElement elem = (HTMLOptionElement)nl.item(i);
        elem.setSelected(false);
        if (value.equals(elem.getValue())) {
            elem.setSelected(true);
        }
      }
    }
View Full Code Here

   *            DOCUMENT ME!
   */
  public void setTitle(final String title) {
    if (this.isHTMLDocument) {
      NodeList nl = this.getElementsByTagName("title");
      HTMLTitleElement nTitle = null;

      if (nl.getLength() > 0) {
        nTitle = (HTMLTitleElement) nl.item(0);
        nTitle.setTitle(title);
      } // end if
      else {
        nTitle = new CHTMLTitleElement(this);
        nTitle.setTitle(title);
        nl = this.getElementsByTagName("head");

        HTMLHeadElement head = null;

        if (nl.getLength() > 0) {
View Full Code Here

TOP

Related Classes of org.w3c.dom.html2.HTMLCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.