name
HtmlElement
import prohtml.*;

HtmlElement table;

void setup(){
  table = new HtmlElement("table",null);
  table.addAttribute("width","200");

  HtmlElement tr1 = new HtmlElement("tr",table);
  HtmlElement td1 = new HtmlElement("td",tr1);
  HtmlElement td2 = new HtmlElement("td",tr1);

  td1.addChild(new TextElement("1",td1));
  td2.addChild(new TextElement("2",td2));
  tr1.addChild(td1);
  tr1.addChild(td2);
  table.addChild(tr1);

  HtmlElement tr2 = new HtmlElement("tr",table);
  HtmlElement td3 = new HtmlElement("td",tr2);
  HtmlElement td4 = new HtmlElement("td",tr2);

  td3.addChild(new TextElement("3",td3));
  td4.addChild(new TextElement("4",td4));
  tr2.addChild(td3);
  tr2.addChild(td4);
  table.addChild(tr2);

  table.printElementTree(". ");
}
description
HtmlElement respresent n element of a HTML page having further children Elements. It extends StandAloneElment and uses its methods to manage attributes. HtmlElemt Elemt makes it possible to add further Elements as Children.
constructors
HtmlElement(kindOfElement, attributes, children, parent);
HtmlElement(kindOfElement, parent);
HtmlElement(kindOfElement, children, parent);
HtmlElement(kindOfElement, attributes, parent);
StandAloneElement(kindOfElement, attributes, parent);
StandAloneElement(kindOfElement, parent);
LetterElement(kindOfElement);
parameters
kindOfElement
String, the kind of the element
attributes
HashMap, holds the attributes for the Element
children
List, holds the children of the Element
attributes
HashMap, holds the attributes as key value pairs
parent
HtmlElement, the parent element
kindOfElement
String
kindOfElement
String, the letter for the element
fields
String holding the kind of the Element. For a LetterElement it keeps a single letter.
methods
Use this method to add an attribute to the element.
Adds an Element to the Children of the Element at the given position
Method for counting the descendants of the element.
Use this method to get the value of a given attribute of an element.
Use this method to get the keys of all available attributes of an element.
Method for getting the children of an element.
Method for getting the maximum depth of an Element
Gives back the parent of this Element.
Use this method to get a list with elements of the given kind being decendents of this Element.
Use this method to see if an element has a given attribute.
Use this method to see if an element has attributes.
This method looks if the element has Children
This method prints the treestrucure of this element and its decendents.
Method for counting the descendants of the element.
Method for counting the descendants of the element.
usage
Web & Application
related