Package org.w3c.dom.html

Examples of org.w3c.dom.html.HTMLElement


    }


    public synchronized String getTitle()
    {
        HTMLElement head;
        NodeList    list;
        Node        title;

        // Get the HEAD element and look for the TITLE element within.
        // When found, make sure the TITLE is a direct child of HEAD,
        // and return the title's text (the Text node contained within).
        head = getHead();
        title = head.getElementsByTagName( "TITLE" ).item( 0 );
        list = head.getElementsByTagName( "TITLE" );
        if ( list.getLength() > 0 ) {
            title = list.item( 0 );
            return ( (HTMLTitleElement) title ).getText();
        }
        // No TITLE found, return an empty string.
View Full Code Here


    }


    public synchronized void setTitle( String newTitle )
    {
        HTMLElement head;
        NodeList    list;
        Node        title;

        // Get the HEAD element and look for the TITLE element within.
        // When found, make sure the TITLE is a direct child of HEAD,
        // and set the title's text (the Text node contained within).
        head = getHead();
        list = head.getElementsByTagName( "TITLE" );
        if ( list.getLength() > 0 ) {
            title = list.item( 0 );
            if ( title.getParentNode() != head )
                head.appendChild( title );
            ( (HTMLTitleElement) title ).setText( newTitle );
        }
        else
        {
            // No TITLE found, create a new element and place it at the end
            // of the HEAD element.
            title = new HTMLTitleElementImpl( this, "TITLE" );
            ( (HTMLTitleElement) title ).setText( newTitle );
            head.appendChild( title );
        }
    }
View Full Code Here

 
    public HTMLElement insertCell( int index )
    {
        Node        child;
        HTMLElement    newCell;
       
        newCell = new HTMLTableCellElementImpl( (HTMLDocumentImpl) getOwnerDocument(), "TD" );
        child = getFirstChild();
        while ( child != null )
        {
View Full Code Here

    }
   
   
    public synchronized HTMLElement createCaption()
    {
        HTMLElement    section;
       
        section = getCaption();
        if ( section != null )
            return section;
        section = new HTMLTableCaptionElementImpl( (HTMLDocumentImpl) getOwnerDocument(), "CAPTION" );
View Full Code Here

    }
   
   
    public synchronized HTMLElement createTHead()
    {
        HTMLElement    section;
       
        section = getTHead();
        if ( section != null )
            return section;
        section = new HTMLTableSectionElementImpl( (HTMLDocumentImpl) getOwnerDocument(), "THEAD" );
View Full Code Here

    }
   
   
    public synchronized HTMLElement createTFoot()
    {
        HTMLElement    section;
       
        section = getTFoot();
        if ( section != null )
            return section;
        section = new HTMLTableSectionElementImpl( (HTMLDocumentImpl) getOwnerDocument(), "TFOOT" );
View Full Code Here

            if (localObject2 == null)
              break;
          }
          while (localObject2 != localObject1);
        }
        HTMLElement localHTMLElement = (HTMLElement)localObject1;
        return localHTMLElement;
      }
      localObject1 = new HTMLHeadElementImpl(this, "HEAD");
      localElement1.insertBefore((Node)localObject1, localElement1.getFirstChild());
    }
View Full Code Here

    return (HTMLElement)(HTMLElement)(HTMLElement)localObject1;
  }

  public synchronized String getTitle()
  {
    HTMLElement localHTMLElement = getHead();
    NodeList localNodeList = localHTMLElement.getElementsByTagName("TITLE");
    if (localNodeList.getLength() > 0)
    {
      Node localNode = localNodeList.item(0);
      return ((HTMLTitleElement)localNode).getText();
    }
View Full Code Here

    return "";
  }

  public synchronized void setTitle(String paramString)
  {
    HTMLElement localHTMLElement = getHead();
    NodeList localNodeList = localHTMLElement.getElementsByTagName("TITLE");
    Object localObject;
    if (localNodeList.getLength() > 0)
    {
      localObject = localNodeList.item(0);
      if (((Node)localObject).getParentNode() != localHTMLElement)
        localHTMLElement.appendChild((Node)localObject);
      ((HTMLTitleElement)localObject).setText(paramString);
    }
    else
    {
      localObject = new HTMLTitleElementImpl(this, "TITLE");
      ((HTMLTitleElement)localObject).setText(paramString);
      localHTMLElement.appendChild((Node)localObject);
    }
  }
View Full Code Here

  }

  public synchronized HTMLElement getBody()
  {
    Element localElement1 = getDocumentElement();
    HTMLElement localHTMLElement1 = getHead();
    Object localObject1;
    synchronized (localElement1)
    {
      for (localObject1 = localHTMLElement1.getNextSibling(); (localObject1 != null) && (!(localObject1 instanceof HTMLBodyElement)) && (!(localObject1 instanceof HTMLFrameSetElement)); localObject1 = ((Node)localObject1).getNextSibling());
      if (localObject1 != null)
      {
        synchronized (localObject1)
        {
          Object localObject2 = localHTMLElement1.getNextSibling();
          do
          {
            Node localNode = ((Node)localObject2).getNextSibling();
            ((Node)localObject1).insertBefore((Node)localObject2, ((Node)localObject1).getFirstChild());
            localObject2 = localNode;
            if (localObject2 == null)
              break;
          }
          while (localObject2 != localObject1);
        }
        HTMLElement localHTMLElement2 = (HTMLElement)localObject1;
        return localHTMLElement2;
      }
      localObject1 = new HTMLBodyElementImpl(this, "BODY");
      localElement1.appendChild((Node)localObject1);
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.html.HTMLElement

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.