wheel.components
Class RenderableComponent

java.lang.Object
  extended by wheel.components.Component
      extended by wheel.components.RenderableComponent
Direct Known Subclasses:
Any, Block, Form, FormElement, Image, Label, Link, StandaloneComponent, Table, Text, XmlEntityRef

public abstract class RenderableComponent
extends Component

Base class for all components that will render themselves as xhtml-tags. Other, more specialized components may want to implement the IRenderable interface directly. Has some basic support methods for rendering components.
Rendering hints:
Rendering hints

Author:
Henri Frilund

Constructor Summary
protected RenderableComponent(Component parent)
           
protected RenderableComponent(Component parent, java.lang.String componentId)
           
protected RenderableComponent(Component parent, java.lang.String componentId, java.lang.CharSequence renderHint)
           
protected RenderableComponent(java.lang.String componentId)
           
 
Method Summary
 java.lang.String _classReferenceFromHints()
          Resolves the contents of the class-attribute for this tag from rendering hints.
 void _clear()
          Inteded for internal use.
 java.util.List<RenderableComponent> _getRenderAfterMe()
           
 java.util.List<RenderableComponent> _getRenderBeforeMe()
           
 void _render(org.xmlpull.v1.XmlSerializer serializer)
          Default implementation.
 void _renderActions(org.xmlpull.v1.XmlSerializer serializer)
           
 void _renderClassReferenceFromHints(org.xmlpull.v1.XmlSerializer serializer)
          Renders the class-attribute for this tag based on rendering hints.
 java.lang.String _renderTagStart(org.xmlpull.v1.XmlSerializer serializer)
          Renders the tag start based on the rendering hints.
 void _renderXhtmlAttributes(org.xmlpull.v1.XmlSerializer serializer)
          Renders all xhtml-attributes (given with calls to attribute() and attributes() methods).
 Component addRenderAfter(RenderableComponent renderable)
          All renderables added y calling this method will be rendered after the component itself but the renderables will not be added to the component tree.
 Component addRenderBefore(RenderableComponent renderable)
          All renderables added y calling this method will be rendered before the component itself but the renderables will not be added to the component tree.
 RenderableComponentConfiguration config()
           
protected  java.lang.String defaultDomEvent()
           
abstract  java.lang.String defaultTagName()
          Subclasses must implement this.
 java.lang.String getTagName()
          Resolves tag name for this component based on rendering hints.
 void renderComponent(org.xmlpull.v1.XmlSerializer serializer)
          Default implementation that will render all renderable child components that this component has.
 java.lang.String toString()
           
 
Methods inherited from class wheel.components.Component
_applyFormat, _getAction, _getActions, _getChildren, _getForm, _getRenderableChildren, _getRenderHints, _getTopLevelComponent, _getVisibleForm, _getXhtmlAttributes, _isGeneratedId, _setComponentId, _setGeneratedId, _wrapComponentId, a, a, abbr, abbr, acronym, acronym, action, actionBinding, actionBinding, add, addFirst, address, address, afterAdd, area, attribute, attributes, b, b, base, bdo, big, big, blockquote, br, button, caption, checkbox, checkboxGroup, cite, cite, clasS, col, colgroup, create, dateInput, dd, dd, del, del, dfn, dfn, div, dl, dt, dt, el, em, em, encode, entity, equals, eval, fieldset, fileInput, fileInput, find, findAll, form, form, frame, frameset, get, getComponentId, getComponentName, getComponents, getEngine, getPage, getParent, h1, h1, h2, h2, h3, h3, h4, h4, h5, h5, h6, h6, hashCode, head, hidden, hr, htmlText, i, i, id, iframe, img, ins, ins, kbd, kdb, label, label, legend, legend, li, li, link, link, map, message, message, meta, multiSelect, nbsp, noframes, noscript, numberInput, numberInput, object, ol, p, p, param, placeholder, pre, pre, q, q, radio, radioGroup, rawText, remove, remove, renderHint, requestFocus, s, s, samp, samp, script, select, selectModel, small, small, span, span, strike, strike, strong, strong, style, sub, sub, submit, sup, sup, table, tbody, td, text, textarea, textInput, tfoot, th, thead, title, tr, u, u, ul, up, up, var, var, wBlock, wrapSelf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderableComponent

protected RenderableComponent(java.lang.String componentId)

RenderableComponent

protected RenderableComponent(Component parent)

RenderableComponent

protected RenderableComponent(Component parent,
                              java.lang.String componentId)

RenderableComponent

protected RenderableComponent(Component parent,
                              java.lang.String componentId,
                              java.lang.CharSequence renderHint)
Method Detail

addRenderBefore

public Component addRenderBefore(RenderableComponent renderable)
All renderables added y calling this method will be rendered before the component itself but the renderables will not be added to the component tree.

Parameters:
renderable -
Returns:

addRenderAfter

public Component addRenderAfter(RenderableComponent renderable)
All renderables added y calling this method will be rendered after the component itself but the renderables will not be added to the component tree.

Parameters:
renderable -
Returns:

_getRenderBeforeMe

public java.util.List<RenderableComponent> _getRenderBeforeMe()

_getRenderAfterMe

public java.util.List<RenderableComponent> _getRenderAfterMe()

_render

public void _render(org.xmlpull.v1.XmlSerializer serializer)
             throws java.io.IOException
Default implementation. Handles render before/after logic. Will first figure out the xhtml tag to use from rendering hints, then delegates to renderComponent(). Subclasses should override renderComponent() rather than this method.

Parameters:
serializer -
Throws:
java.io.IOException

defaultTagName

public abstract java.lang.String defaultTagName()
Subclasses must implement this. If no xhtml tagname can be resolved from rendering hints, will default to value returned by this method.

Returns:

renderComponent

public void renderComponent(org.xmlpull.v1.XmlSerializer serializer)
                     throws java.io.IOException
Default implementation that will render all renderable child components that this component has. Subclasses should override this method if necessary.

Parameters:
serializer -
Throws:
java.io.IOException

_renderTagStart

public java.lang.String _renderTagStart(org.xmlpull.v1.XmlSerializer serializer)
                                 throws java.io.IOException
Renders the tag start based on the rendering hints.

Parameters:
serializer -
Returns:
The tagname that was rendered.
Throws:
java.io.IOException

_classReferenceFromHints

public java.lang.String _classReferenceFromHints()
Resolves the contents of the class-attribute for this tag from rendering hints.

Returns:

_renderClassReferenceFromHints

public void _renderClassReferenceFromHints(org.xmlpull.v1.XmlSerializer serializer)
                                    throws java.io.IOException
Renders the class-attribute for this tag based on rendering hints.

Parameters:
serializer -
Throws:
java.io.IOException

getTagName

public java.lang.String getTagName()
Resolves tag name for this component based on rendering hints.

Returns:

_renderXhtmlAttributes

public void _renderXhtmlAttributes(org.xmlpull.v1.XmlSerializer serializer)
                            throws java.io.IOException
Renders all xhtml-attributes (given with calls to attribute() and attributes() methods).

Parameters:
serializer -
Throws:
java.io.IOException

_renderActions

public void _renderActions(org.xmlpull.v1.XmlSerializer serializer)
                    throws java.io.IOException
Throws:
java.io.IOException

defaultDomEvent

protected java.lang.String defaultDomEvent()

_clear

public void _clear()
Description copied from class: Component
Inteded for internal use. Clears all attributes and child components.

Overrides:
_clear in class Component

config

public RenderableComponentConfiguration config()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007-2008. All Rights Reserved.