DhDocument.add

Overview | Methods | This Package | All Packages

DhDocument.add

Adds an element into this container.

Syntax

public void add( DhElement element )

public void add( DhElement element, int insertFlag )

public void add( DhElement element, DhElement relativeTo, int insertFlag )

public void add( DhStyle newStyle )

Parameters

element

The element to add to the end of the flow of this container.

insertFlag

One of the applicable insert constants from DhInsertOptions. The valid values for insertFlag are END, BEGINNING, BEFORE, and AFTER.

relativeTo

An element to which the insertFlags parameter relates (this can be null depending on the value of insertFlags).

newStyle

The DhStyle object to add to this document. You usually do not need to call this form of the DhDocument.add method; when you call DhElement.setStyle, the document style is set automatically.

Remarks

The form of this method without the insertFlag parameter adds the element following all other elements. The forms with the insertFlag parameter are used to add the element either at the beginning or at the end of this container. Use the form of this method that includes relativeTo to add an element before or after another element.

For information on this method and other available add methods, see DhForm.add.