echopoint.ui.util
Class NoNameElement

java.lang.Object
  extended by nextapp.echoservlet.html.Element
      extended by echopoint.ui.util.NoNameElement
All Implemented Interfaces:
java.io.Serializable, Renderable

public class NoNameElement
extends Element

The NoNameElement class is used to contain other elements however it does not generate an HTML element itself. It can be used when you need an element parent but dont need a corresponding HTML parent tag

For example the JspTemplate code needs a "dummy" element into which it can render its children. However its does not need an parent HTML DIV element to do this. Rather it uses a NoNameElement to "contain" the child components output.

So instead of "<div> some content inside </div>" it would just generate "some content inside".

This component also allows you to "reach" into the element and extract child Renderable objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface nextapp.echoservlet.html.Renderable
INDENT_STRING
 
Constructor Summary
NoNameElement()
           
 
Method Summary
 void add(int index, Renderable child)
          Adds a renderable object to the element at a specified index.
 void add(Renderable child)
          Adds a renderable object to the element.
 void addHtml(int index, java.lang.String html)
          Adds raw HTML to the body of the element at a specified index.
 void addHtml(java.lang.String html)
          Adds raw HTML to the body of the element.
 void addText(int index, java.lang.String text, boolean encodeNewLines)
          Adds plain text to the body of the element at a specified index.
 void addText(java.lang.String text)
          Adds plain text to the body of the element.
 void addText(java.lang.String text, boolean encodeNewLines)
          Adds plain text to the body of the element.
 Renderable getChild(int index)
          Returns the Renderable child at index
 ElementContent getContents()
           
 int indexOf(java.lang.Object child)
          Returns the index of the specified object if it is a child of this Element.
 void render(java.io.PrintWriter pw, int depth, boolean parentWhitespaceRelevant)
          Renders this element and its children to a PrintWriter.
 java.util.Iterator renderables()
          Returns an iterator of all the Renderable objects within this NoNameElement.
 
Methods inherited from class nextapp.echoservlet.html.Element
addAttribute, addAttribute, addAttribute, addElement, addElement, addElementContent, addElementContent, allocate, allocate, getAttribute, getCreationCount, getName, isSticky, releaseElements, removeAttribute, render, renderAsStyleAttribute, reset, setClosingTagRequired, setSticky, setWhitespaceRelevant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoNameElement

public NoNameElement()
Method Detail

add

public void add(int index,
                Renderable child)
Description copied from class: Element
Adds a renderable object to the element at a specified index.

Overrides:
add in class Element
Parameters:
index - The index at which to add the renderable.
child - The renderable object to add to the element.
See Also:
Element.add(int, nextapp.echoservlet.html.Renderable)

add

public void add(Renderable child)
Description copied from class: Element
Adds a renderable object to the element.

Overrides:
add in class Element
Parameters:
child - The renderable object to add to the element.
See Also:
Element.add(nextapp.echoservlet.html.Renderable)

addHtml

public void addHtml(int index,
                    java.lang.String html)
Description copied from class: Element
Adds raw HTML to the body of the element at a specified index. The given HTML string will not be encoded.

Overrides:
addHtml in class Element
Parameters:
index - The index at which to add the HTML.
html - Encoded HTML content to be added to this element.
See Also:
Element.addHtml(int, java.lang.String)

addHtml

public void addHtml(java.lang.String html)
Description copied from class: Element
Adds raw HTML to the body of the element. The given HTML string will not be encoded.

Overrides:
addHtml in class Element
Parameters:
html - Encoded HTML content to be added to this element.
See Also:
Element.addHtml(java.lang.String)

addText

public void addText(int index,
                    java.lang.String text,
                    boolean encodeNewLines)
Description copied from class: Element
Adds plain text to the body of the element at a specified index. This text will automatically be encoded into valid HTML.

Overrides:
addText in class Element
Parameters:
index - The index at which to add the text.
text - Unencoded text to be added as HTML to the body of the element.
encodeNewLines - A flag indicating if new line characters should be translated to <BR>s.
See Also:
Element.addText(int, java.lang.String, boolean)

addText

public void addText(java.lang.String text)
Description copied from class: Element
Adds plain text to the body of the element. This text will automatically be encoded into valid HTML.

Overrides:
addText in class Element
See Also:
Element.addText(java.lang.String)

addText

public void addText(java.lang.String text,
                    boolean encodeNewLines)
Description copied from class: Element
Adds plain text to the body of the element. This text will automatically be encoded into valid HTML.

Overrides:
addText in class Element
Parameters:
text - Unencoded text to be added as HTML to the body of the element.
encodeNewLines - A flag indicating if new line characters should be translated to <BR>s.
See Also:
Element.addText(java.lang.String, boolean)

render

public void render(java.io.PrintWriter pw,
                   int depth,
                   boolean parentWhitespaceRelevant)
Description copied from class: Element
Renders this element and its children to a PrintWriter. The element will be indented to the specified depth, and its children will be indented to the specified depth + 1. If white space is relevant (whitespaceRelevant==true), then no white space will be left between this element's opening and closing tags.

Specified by:
render in interface Renderable
Overrides:
render in class Element
Parameters:
pw - The print writer to render the element to.
depth - The indentation depth to indent the element to.
parentWhitespaceRelevant - A flag indicating whether the parent element had the WhitespaceRelevant property set.
See Also:
Renderable.render(java.io.PrintWriter, int, boolean)

renderables

public java.util.Iterator renderables()
Returns an iterator of all the Renderable objects within this NoNameElement.

Returns:
an iterator if renderables

getChild

public Renderable getChild(int index)
Returns the Renderable child at index

Parameters:
index - - the index to look at
Returns:
the Renderable child at index

indexOf

public int indexOf(java.lang.Object child)
Description copied from class: Element
Returns the index of the specified object if it is a child of this Element. If the object is not found, -1 is returned.

Overrides:
indexOf in class Element
Parameters:
child - The child object whose index is desired.
Returns:
The index of the specified object.
See Also:
Element.indexOf(java.lang.Object)

getContents

public ElementContent getContents()
Overrides:
getContents in class Element