PAJES 3.0.21

org.pajes.html
Class SingleElementContainer

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.TraversableElement
          extended by org.pajes.html.SingleElementContainer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML, Traversable
Direct Known Subclasses:
Anchor, Heading, Legend, ListItem, PreFormatted

public abstract class SingleElementContainer
extends TraversableElement

Creates a container that contains only one other element.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
protected SingleElementContainer(java.lang.String name)
          Creates an empty container.
 
Method Summary
 Traversable add(HTML htmlObject)
          Adds an HTML object to the current container
 Traversable delete(java.lang.Object htmlObject)
          Deletes the specified HTML object from the container.
 HTML get(int position)
          Gets the HTML object from the specified position in the container.
 Traversable set(HTML htmlObject, int position)
          Sets an HTML object at a specified position in the container.
 int size()
          Returns the number of HTML objects contained within this object.
protected  void writeContent(Browser browser)
          Called by the Tag.write(org.pajes.servlet.Browser) method to write any content between the start and end tags.
 
Methods inherited from class org.pajes.html.TraversableElement
dump, dump, getAll, getFieldByName, getFirstFieldByName, getFirstTagByAttribute, getFirstTagByClass, getFirstTagByID, getFirstTagByName, getTagByAttribute, getTagByClass, getTagByID, getTagByName, setWritable
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, addContent, clearAttribute, clearAttributes, clone, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getParent, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, hasAttribute, init, initAttributes, isChildOf, isChildOf, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setContent, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setParent, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pajes.html.Traversable
isWritable
 
Methods inherited from interface org.pajes.html.HTML
addContent, clone, destroy, getContainer, getDocument, getId, getParent, getWritePermission, isChildOf, isChildOf, setContainer, setContent, setParent, setWritePermission, write
 

Constructor Detail

SingleElementContainer

protected SingleElementContainer(java.lang.String name)
Creates an empty container.

Parameters:
name - the tag name.
Method Detail

add

public Traversable add(HTML htmlObject)
Description copied from interface: Traversable
Adds an HTML object to the current container

Parameters:
htmlObject - - the Object to add (eg. doc.add(new htmlBody);)
Returns:
the modified Container object;
See Also:
Traversable.add(org.pajes.html.HTML)

delete

public Traversable delete(java.lang.Object htmlObject)
Description copied from interface: Traversable
Deletes the specified HTML object from the container.

Parameters:
htmlObject - the object to be deleted.
Returns:
the modified Container object.
See Also:
Traversable.delete(java.lang.Object)

get

public HTML get(int position)
Gets the HTML object from the specified position in the container.

Parameters:
position - the position to get the html object
Returns:
the object at the specified location
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the position is not 0 (an Heading can only contain 1 item) or there is no content.

set

public Traversable set(HTML htmlObject,
                       int position)
                throws java.lang.ArrayIndexOutOfBoundsException
Sets an HTML object at a specified position in the container.

Parameters:
htmlObject - the Object to add.
position - the position at which to place the html object.
Returns:
the modified Traversable object.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the position is not 0 (can only contain 1 item).

size

public int size()
Returns the number of HTML objects contained within this object.

Returns:
the number of HTML objects contained within this object.

writeContent

protected void writeContent(Browser browser)
                     throws java.io.IOException
Called by the Tag.write(org.pajes.servlet.Browser) method to write any content between the start and end tags.

Overrides:
writeContent in class Tag
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.
See Also:
Tag.setWriteEndTag(boolean)

PAJES 3.0.21

Copyright © 1998-2007 Viridian Pty Limited. All Rights Reserved.