org.jboss.gravel.common.renderer
Interface Element<C extends javax.faces.component.UIComponent>


public interface Element<C extends javax.faces.component.UIComponent>


Method Summary
 Element<C> addClass(String className)
          Add a CSS style class to the current element.
 Element<C> addClass(StringCycler stringCycler)
          Add a CSS style class to the current element from the current string of a string cycler.
 Element<C> addStyle(String style)
          Add a CSS style to the current element.
 void close()
          Close out this element.
 Element<C> doEncode()
          Encode the element's component.
 C getComponent()
          Get the component associated with this element.
 javax.faces.context.FacesContext getFacesContext()
          Get the faces context associated with this element.
 Element<C> writeAttribute(String attribute, boolean value)
          Write out an attriubte on this element.
 Element<C> writeAttribute(String attribute, int value)
          Write out an attriubte on this element.
 Element<C> writeAttribute(String attribute, String value)
          Write out an attriubte on this element.
 Element<C> writeClass()
          Write the class attribute, if any style classes have been added.
 Element<C> writeElement(String name)
          Create a nested element for the same component.
<I extends javax.faces.component.UIComponent>
Element<I>
writeElement(String name, I component)
          Create a nested element for a different component.
 Element<C> writeId()
          Write ID to the id attribute, only if it was specified.
 Element<C> writeId(String attribute, boolean onlyIfSpecified)
          Write the ID to the specified attribute.
 Element<C> writeStyle()
          Write the style attribute, if any styles have been added.
 

Method Detail

writeId

Element<C> writeId()
                                                             throws IOException
Write ID to the id attribute, only if it was specified.

Returns:
this element
Throws:
IOException - if an error occurs

writeId

Element<C> writeId(String attribute,
                   boolean onlyIfSpecified)
                                                             throws IOException
Write the ID to the specified attribute.

Parameters:
attribute - the attribute
onlyIfSpecified - true if it should only be written if specified
Returns:
this element
Throws:
IOException - if an error occurs

addClass

Element<C> addClass(String className)
Add a CSS style class to the current element.

Parameters:
className - the style class name
Returns:
this element

addClass

Element<C> addClass(StringCycler stringCycler)
Add a CSS style class to the current element from the current string of a string cycler.

Parameters:
stringCycler - the string cycler
Returns:
this element

addStyle

Element<C> addStyle(String style)
Add a CSS style to the current element.

Parameters:
style - the style to add
Returns:
this element

writeClass

Element<C> writeClass()
                                                                throws IOException
Write the class attribute, if any style classes have been added.

Returns:
this element
Throws:
IOException - if an error occurs

writeStyle

Element<C> writeStyle()
                                                                throws IOException
Write the style attribute, if any styles have been added.

Returns:
this element
Throws:
IOException - if an error occurs

writeAttribute

Element<C> writeAttribute(String attribute,
                          String value)
                                                                    throws IOException
Write out an attriubte on this element.

Parameters:
attribute - the attribute
value - the value
Returns:
this element
Throws:
IOException - if an error occurs

writeAttribute

Element<C> writeAttribute(String attribute,
                          int value)
                                                                    throws IOException
Write out an attriubte on this element.

Parameters:
attribute - the attribute
value - the value
Returns:
this element
Throws:
IOException - if an error occurs

writeAttribute

Element<C> writeAttribute(String attribute,
                          boolean value)
                                                                    throws IOException
Write out an attriubte on this element. If value is false, no attribute is written.

Parameters:
attribute - the attribute
value - the value
Returns:
this element
Throws:
IOException - if an error occurs

doEncode

Element<C> doEncode()
                                                              throws IOException
Encode the element's component.

Returns:
this element
Throws:
IOException - if an error occurs

close

void close()
           throws IOException
Close out this element. Renders the close tag.

Throws:
IOException - if an error occurs

writeElement

Element<C> writeElement(String name)
                                                                  throws IOException
Create a nested element for the same component.

Parameters:
name - the name of the element
Returns:
the new element
Throws:
IOException - if an error occurs

writeElement

<I extends javax.faces.component.UIComponent> Element<I> writeElement(String name,
                                                                      I component)
                                                                  throws IOException
Create a nested element for a different component.

Parameters:
name - the name of the element
component - the associated component
Returns:
the new element
Throws:
IOException - if an error occurs

getComponent

C getComponent()
Get the component associated with this element.

Returns:
the component

getFacesContext

javax.faces.context.FacesContext getFacesContext()
Get the faces context associated with this element.

Returns:
the faces context