OverviewSingleDeprecatedPropertiesEventsXSL Parameters

jsx3.html

class Tag

Object
->jsx3.lang.Object
  ->jsx3.html.Tag

Direct Known Subclasses:

jsx3.html.BlockTag, jsx3.html.Text, jsx3.vector.Fill, jsx3.vector.Stroke

class Tag
extends jsx3.lang.Object
Represents an HTML element. Provides an object oriented way of painting to screen.

This class is available only when the Charting add-in is enabled.

Constructor Summary
void
init(strTagNS : String, strTagName : String)
The instance initializer.
Method Summary
void
Sdds a child to the list of this tag's children; may be vetoed by onAppendChild().
Array<jsx3.html.Tag>
Returns the children tags.
String
Returns the cssClass field.
String
Returns the cssClass field.
jsx3.html.Tag
Returns the first child tag of type type.
String
Returns the id field.
jsx3.html.Tag
Returns the parent tag.
String
getProperty(strName : String)
Returns an attribute of this HTML element.
String
getStyle(strName : String)
Returns a style of this HTML element.
String
Returns the namespace of this HTML element.
String
Returns the name of this HTML element, such as "table" or "div".
protected boolean
Called before appending a child.
protected boolean
Called before removing a child.
String
Serializes this HTML element to an HTML string using various overridable methods in this class.
HTMLElement
Prepares this HTML element for insertion into the live browser DOM and returns the underlying native HTML element.
protected void
This method is called on each HTML tag before it is painted to screen.
void
Releases all bi-directional references between this instance and its children.
void
Removes a child from the list of this tag's children; may be vetoed by onRemoveChild().
void
Removes all the children of this tag.
void
removeProperty(strName : String...)
Removes any number of properties from this HTML element.
void
removeStyle(strName : String...)
Removes any number of styles from this HTML element.
void
replaceChild(child : jsx3.html.Tag, oldChild : jsx3.html.Tag)
Replaces a child of this tag.
void
setClassName(cssClass : String)
Sets the cssClass field, the HTML 'class' attribute.
void
setClassName(cssClass : String)
Sets the cssClass field, the HTML 'class' attribute.
void
setExtraStyles(extraStyles : String)
Sets the extraStyles field, this string is prepended as-is to the generated value for the style attribute of the tag.
void
setId(id : String)
Sets the id field.
void
setProperty(strName : String, strValue : String)
Sets an attribute of this HTML element.
void
setStyle(strName : String, strValue : String)
Sets a style of this HTML element.
String
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Constructor Detail

init

void init(strTagNS : String, strTagName : String)
The instance initializer.

Parameters:

strTagNS
strTagName
Method Detail

appendChild

void appendChild(child : jsx3.html.Tag)
Sdds a child to the list of this tag's children; may be vetoed by onAppendChild().

Parameters:

childthe child to add, must not already have a parent

getChildren

Array<jsx3.html.Tag> getChildren()
Returns the children tags.

Returns:

children  

getClassName

String getClassName()
Returns the cssClass field.

Returns:

cssClass  

getClassName

String getClassName()
Returns the cssClass field.

Returns:

cssClass  

getFirstChildOfType

jsx3.html.Tag getFirstChildOfType(type : String | Function)
Returns the first child tag of type type.

Parameters:

typethe fully-qualified class name or the class constructor function.

Returns:

 

getId

String getId()
Returns the id field.

Returns:

id  

getParent

jsx3.html.Tag getParent()
Returns the parent tag.

Returns:

parent  

getProperty

String getProperty(strName : String)
Returns an attribute of this HTML element.

Parameters:

strNamethe name of the attribute.

Returns:

the value of the attribute.  

getStyle

String getStyle(strName : String)
Returns a style of this HTML element.

Parameters:

strNamethe name of the style.

Returns:

the value of the style.  

getTagNS

String getTagNS()
Returns the namespace of this HTML element.

Returns:

the tag name  

getTagName

String getTagName()
Returns the name of this HTML element, such as "table" or "div".

Returns:

the tag name  

onAppendChild

protected boolean onAppendChild(child : jsx3.html.Tag)
Called before appending a child.

Parameters:

child

Returns:

true to allow the append, false to veto. 

onRemoveChild

protected boolean onRemoveChild(child : jsx3.html.Tag)
Called before removing a child.

Parameters:

child

Returns:

true to allow the removal, false to veto. 

paint

String paint()
Serializes this HTML element to an HTML string using various overridable methods in this class. This method is only available in the VML version of this class.

Returns:

this tag serialized to HTML.  

paintDom

HTMLElement paintDom()
Prepares this HTML element for insertion into the live browser DOM and returns the underlying native HTML element. This method is only available in the SVG version of this class.

Returns:

the native browser html element.  

paintUpdate

protected void paintUpdate()
This method is called on each HTML tag before it is painted to screen. Methods in subclasses of this class that override this method should begin with a call to jsxsuper().

release

void release()
Releases all bi-directional references between this instance and its children.

removeChild

void removeChild(child : jsx3.html.Tag)
Removes a child from the list of this tag's children; may be vetoed by onRemoveChild().

Parameters:

childthe child to remove, must exist in the list of children

removeChildren

void removeChildren()
Removes all the children of this tag.

removeProperty

void removeProperty(strName : String...)
Removes any number of properties from this HTML element.

Parameters:

strNamethe names of the attributes.

removeStyle

void removeStyle(strName : String...)
Removes any number of styles from this HTML element.

Parameters:

strNamethe names of the styles.

replaceChild

void replaceChild(child : jsx3.html.Tag, oldChild : jsx3.html.Tag)
Replaces a child of this tag.

Parameters:

childthe new child.
oldChildthe child to replace.

setClassName

void setClassName(cssClass : String)
Sets the cssClass field, the HTML 'class' attribute.

Parameters:

cssClassthe new value for cssClass

setClassName

void setClassName(cssClass : String)
Sets the cssClass field, the HTML 'class' attribute.

Parameters:

cssClassthe new value for cssClass

setExtraStyles

void setExtraStyles(extraStyles : String)
Sets the extraStyles field, this string is prepended as-is to the generated value for the style attribute of the tag.

Parameters:

extraStylesthe new value for extraStyles

setId

void setId(id : String)
Sets the id field.

Parameters:

idthe new value for id

setProperty

void setProperty(strName : String, strValue : String)
Sets an attribute of this HTML element. This method may be called with a variable number of arguments, which are interpreted as name/value pairs, i.e.: tag.setProperty(n1, p1, n2, p2);.

Parameters:

strNamethe name of the attribute.
strValuethe value of the attribute. If null, the attribute is removed.

setStyle

void setStyle(strName : String, strValue : String)
Sets a style of this HTML element. This method may be called with a variable number of arguments, which are interpreted as name/value pairs, i.e.: tag.setStyle(n1, s1, n2, s2);.

Parameters:

strNamethe name of the style.
strValuethe value of the style.

toString

String toString()

Returns:

 

Overrides:

toString in jsx3.lang.Object