|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.html.Element | +--org.mortbay.html.Composite
HTML Composite Element.
This class is can be used a either an abstract or concrete holder of other HTML elements. Used directly, it allow multiple HTML Elements to be added which are produced sequentially. Derived used of Composite may wrap each contain Element in special purpose HTML tags (e.g. list).
Notes
Elements are added to the Composite either as HTML Elements or as
Strings. Other objects added to the Composite are converted to Strings
Element
Field Summary |
Fields inherited from class org.mortbay.html.Element |
ALIGN, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, noAttributes, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH |
Constructor Summary | |
Composite()
Default constructor. |
|
Composite(java.lang.String attributes)
Default constructor. |
Method Summary | |
Composite |
add(java.lang.Object o)
Add an Object to the Composite by converting it to a Element or. |
java.lang.String |
contents()
Contents of the composite. |
Composite |
nest(Composite c)
Nest a Composite within a Composite. |
boolean |
replace(java.lang.Object oldObj,
java.lang.Object newObj)
Replace an object within the composite. |
Composite |
reset()
Empty the contents of this Composite . |
Composite |
setNest(Composite c)
Explicit set of the Nested component. |
int |
size()
The number of Elements in this Composite. |
Composite |
unnest()
Recursively unnest the composites. |
void |
write(java.io.Writer out)
Write the composite. |
Methods inherited from class org.mortbay.html.Element |
attribute, attribute, attribute, attributes, attributes, bgColor, bottom, center, color, cssClass, cssID, height, height, height, left, middle, right, setAttributesFrom, size, size, style, top, toString, width, width, width, write, write |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Composite()
public Composite(java.lang.String attributes)
Method Detail |
public Composite add(java.lang.Object o)
o
- The Object to add. If it is a String or Element, it is
added directly, otherwise toString() is called.
public Composite nest(Composite c)
public Composite setNest(Composite c)
public Composite unnest()
public int size()
size
in class Element
public void write(java.io.Writer out) throws java.io.IOException
write
in class Element
out
- Writer to write the element to.
java.io.IOException
public java.lang.String contents()
public Composite reset()
public boolean replace(java.lang.Object oldObj, java.lang.Object newObj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |