wheel.components
Class Component

java.lang.Object
  extended by wheel.components.Component
Direct Known Subclasses:
JSONComponent, RenderableComponent

public abstract class Component
extends java.lang.Object

The main API for Wheel. Contains most of the methods to manipulate the component tree for the page/component.

Author:
Henri Frilund

Constructor Summary
Component(Component parent)
          Minimum constructor for components that have a generated component id.
Component(Component parent, java.lang.String componentId)
          Creates a new component with the given parent component and the given component id.
Component(Component parent, java.lang.String componentId, java.lang.CharSequence renderHint)
          Creates a new component with the given parent component, given component id and given render hint.
Component(java.lang.String componentId)
          Minimum constructor for components that have given id's instead of generated ones.
 
Method Summary
 java.lang.String _applyFormat(java.lang.Object value)
          By overriding this method, its possible to apply some formatting to MVEL-evaluations in the eval() method.
 void _clear()
          Inteded for internal use.
 ActionExpression _getAction()
          Intetnded for internal use.
 java.util.List<ActionExpression> _getActions()
          Intetnded for internal use.
 java.util.List<Component> _getChildren()
          Intended for internal use.
 Form _getForm(boolean returnSelf)
          Intended for internal use.
 java.util.List<RenderableComponent> _getRenderableChildren()
          Intended for internal use.
 java.util.List<java.lang.CharSequence> _getRenderHints()
          Intended for internal use.
 StandaloneComponent _getTopLevelComponent(boolean returnSelf)
          Returns the containing StandaloneComponent.
 Form _getVisibleForm(boolean returnSelf)
           
 java.util.Map<java.lang.String,java.lang.String> _getXhtmlAttributes()
          Intended for internal use.
 boolean _isGeneratedId()
          Returns true if the id for this component was generated.
 void _setComponentId(java.lang.String componentId)
          Intended for internal use.
 void _setGeneratedId(boolean generatedId)
          Inteded for internal use.
 java.lang.String _wrapComponentId(java.lang.String componentId)
           
 Component a()
           
 Component a(java.lang.Object text)
           
 Component abbr()
           
 Component abbr(java.lang.Object text)
           
 Component acronym()
           
 Component acronym(java.lang.Object text)
           
 ActionExpression action(java.lang.String expression)
           
 Component actionBinding(ActionExpression actionExpression)
           
 Component actionBinding(java.lang.String actionExpression)
           
 Component add(Component component)
          Adds the given component to the component tree.
 Component addFirst(Component component)
           
 Component address()
           
 Component address(java.lang.Object text)
           
 void afterAdd()
          A lifecycle method that is called after the component has been added to the component tree.
 Component area(java.lang.String... attributes)
           
 Component attribute(java.lang.String name, java.lang.CharSequence value)
          Adds an xhtml-attribute to the component.
 Component attributes(java.lang.String... attributes)
          Has the same functionality as addAsset(String fileUri) but uses varargs to enable adding multitple attributes at once.
 Component b()
           
 Component b(java.lang.Object text)
          Adds a Label-component to the component tree, sets rendering hint to "b" and returns it.
 Component base(java.lang.CharSequence href)
           
 Component bdo(java.lang.CharSequence dir)
           
 Component big()
           
 Component big(java.lang.Object text)
           
 Component blockquote()
           
 Component br()
          Adds an Any-component to the component tree, sets rendring hint to "br" and returns it.
 Component button()
           
 Component caption()
           
 FormElement checkbox(java.lang.String componentId)
          Adds a Checkbox-component to the component tree and returns it.
 FormElement checkboxGroup(java.lang.String componentId, ISelectModel model, ElExpression binding)
          Adds a CheckboxGroup-component to the component tree and returns it.
 Component cite()
           
 Component cite(java.lang.Object text)
           
 Component clasS(java.lang.CharSequence Class)
           
 Component col()
          Adds a col-element to a surrounding TableBlock-component.
 Component colgroup()
          Adds a colgroup-element to a surrounding Table-component.
 ComponentCreator create()
           
 FormElement dateInput(java.lang.String componentId, java.lang.String datePattern)
          Adds a DateInput component to the component tree and returns it.
 Component dd()
          Adds a Block-component to the component tree, sets rendering hint to "dd" and returns it.
 Component dd(java.lang.Object text)
           
 Component del()
           
 Component del(java.lang.Object text)
           
 Component dfn()
           
 Component dfn(java.lang.Object text)
           
 Component div()
          Adds a Block-component to the component tree, sets rendering hint to "div" and returns it.
 Component dl()
          Adds a Block-component to the component tree, sets rendering hint to "dl" and returns it.
 Component dt()
          Adds a Block-component to the component tree, sets rendering hint to "dt" and returns it.
 Component dt(java.lang.Object text)
           
 ElExpression el(java.lang.String expression)
           
 Component em()
           
 Component em(java.lang.Object text)
           
 java.lang.String encode(java.lang.String string)
          URL-encodes the given string and returns it.
 Component entity(java.lang.String name)
          Adds an XmlEntityRef-component to the component tree and returns it.
 boolean equals(java.lang.Object o)
          Component equality is based on component id.
 java.lang.String eval(java.lang.Object expression)
          Evaluates a String expression.
 Component fieldset()
          Adds a Block-component to the component tree, sets rendering hint to "fieldset" and returns it.
 FormElement fileInput(java.lang.String componentId)
          Adds a FileInput-component to the component tree and returns it.
 FormElement fileInput(java.lang.String componentId, ElExpression metadataBinding)
          Adds a FileInput-component to the component tree and returns it.
 Component find(java.lang.String componentId)
          Finds a component with the given component id.
 java.util.List<Component> findAll(ElExpression expression)
          TODO
 Component form(java.lang.String formId)
           
 Component form(java.lang.String formId, ActionExpression action)
          Adds a Form-component to the component tree and returns it.
 Component frame(java.lang.CharSequence src)
           
 Component frameset()
           
 Component get(java.lang.String componentId)
          Returns the component with the given component id.
 java.lang.String getComponentId()
          Returns the identitfier for this component.
 java.lang.String getComponentName()
          Returns the short classname of the component class.
 java.util.Map<java.lang.String,Component> getComponents()
           
 IEngine getEngine()
          Returns the IEngine instance that is serving this request-cycle.
 StandaloneComponent getPage()
          Returns the surrounding page where this component lives.
 Component getParent()
          Returns the parent for this component.
 Component h1()
          Adds a Block-component to the component tree, sets rendering hint to "h1" and returns it.
 Component h1(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h1" and returns it.
 Component h2()
          Adds a Block-component to the component tree, sets rendering hint to "h2" and returns it.
 Component h2(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h2" and returns it.
 Component h3()
          Adds a Block-component to the component tree, sets rendering hint to "h3" and returns it.
 Component h3(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h3" and returns it.
 Component h4()
          Adds a Block-component to the component tree, sets rendering hint to "h4" and returns it.
 Component h4(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h4" and returns it.
 Component h5()
          Adds a Block-component to the component tree, sets rendering hint to "h5" and returns it.
 Component h5(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h5" and returns it.
 Component h6()
          Adds a Block-component to the component tree, sets rendering hint to "h6" and returns it.
 Component h6(java.lang.Object text)
          Adds a Label-component to the component tree, sets redering hint to "h6" and returns it.
 int hashCode()
           
 Component head()
           
 FormElement hidden(java.lang.String componentId)
          Adds a Hidden-component to the component tree and returns it.
 Component hr()
          Adds an Any-component to the component tree, sets rendering hint to "hr" and returns it.
 Component htmlText(java.lang.Object htmlText)
          Adds a Text-component to the component tree and sets it in html-mode.
 Component i()
           
 Component i(java.lang.Object text)
          Adds a Label-component to the component tree, sets rendering hint to "i" and returns it.
 Component id(java.lang.String componentId)
          Changes the componentId.
 Component iframe()
           
 Component img(java.lang.String url, java.lang.String alt)
          Adds an Image-component to the component tree and returns it.
 Component ins()
           
 Component ins(java.lang.Object text)
           
 Component kbd()
           
 Component kdb(java.lang.Object text)
           
 Component label()
           
 Component label(java.lang.Object text)
           
 Component legend()
           
 Component legend(java.lang.Object text)
           
 Component li()
          Adds a Block-component to the component tree, sets rendering hint to "li" and returns it.
 Component li(java.lang.Object text)
           
 Component link()
           
 Component link(java.lang.String text)
           
 Component map(java.lang.String id)
           
 java.lang.String message(java.lang.String key)
          Returns a locaiized message with the given key.
 java.lang.String message(java.lang.String key, java.lang.Object... params)
          Returns a localized and parametrized message with all {0...n} escapes replaced with values from the given Object array.
 Component meta()
           
 FormElement multiSelect(java.lang.String componentId, ISelectModel model, ElExpression binding)
          Adds a Select-component in multiselect mode to the component tree and returns it.
 Component nbsp()
          Adds a non-breaking-space to the component tree.
 Component noframes()
           
 Component noscript()
           
 FormElement numberInput(java.lang.String componentId)
          Adds a NumberInput-component to the component tree and returns it.
 FormElement numberInput(java.lang.String componentId, java.lang.CharSequence numberFormat)
          Adds a NumberInput-component to the component tree and returns it.
 Component object()
           
 Component ol()
          Adds a Block-component to the component tree, sets rendering hint to "ol" and returns it.
 Component p()
          Adds a Block-component to the component tree, sets rendering hint to "p" and returns it.
 Component p(java.lang.Object text)
          Adds a Label-component to the component tree, sets rendering hint to "p" and returns it.
 Component param(java.lang.CharSequence name)
           
 Block placeholder(java.lang.String placeholderId)
          Creates a placeholder.
 Component pre()
           
 Component pre(java.lang.Object text)
           
 Component q()
           
 Component q(java.lang.Object text)
           
 FormElement radio(java.lang.String componentId)
          Adds a Radio-component to the component tree and returns it.
 FormElement radioGroup(java.lang.String componentId, ISelectModel model, ElExpression binding)
          Adds a RadioGroup-component to the component tree and returns it.
 Component rawText(java.lang.Object rawText)
          Adds a Text-component to the component tree and sets it in cdata-mode causing all the text to be rendered inside a CDATA-section.
 Component remove(Component component)
          Removes a component from the list of children for this componnent.
 Component remove(java.lang.String componentId)
          Removes a component with the given component id from the list of children for this component.
 Component renderHint(java.lang.CharSequence renderHint)
          Adds a rendering hint to this component.
 Component requestFocus()
          Request focus for this component on the browser.
 Component s()
           
 Component s(java.lang.Object text)
           
 Component samp()
           
 Component samp(java.lang.Object text)
           
 Component script()
           
 FormElement select(java.lang.String componentId, ISelectModel model, ElExpression binding)
          Adds a Select-component to the component tree and returns it.
 DynamicSelectModel selectModel()
           
 Component small()
           
 Component small(java.lang.Object text)
           
 Component span()
          Adds a Block-component to the component tree, sets rendering hint to "span" and returns it.
 Component span(java.lang.Object text)
          Adds a Label-component to the component tree, sets rendering hint to "p" and returns it.
 Component strike()
           
 Component strike(java.lang.Object text)
           
 Component strong()
           
 Component strong(java.lang.Object text)
           
 Component style()
           
 Component sub()
           
 Component sub(java.lang.Object text)
           
 FormElement submit(java.lang.String componentId)
          Adds a Submit-component to the component tree and returns it.
 Component sup()
           
 Component sup(java.lang.Object text)
           
 Component table()
          Adds a Table-component to the component tree and returns it.
 Component tbody()
          Adds a tbody-element to a surrounding Table-component.
 Component td()
          Adds a td-element (a column) the a surrounding TableBlock-element.
 Component text(java.lang.Object textS)
          Adds a Text-component to the component tree and returns it.
 FormElement textarea(java.lang.String name)
          Adds a TextArea-component to the component tree and returns it.
 FormElement textInput(java.lang.String componentId)
          Adds a TextInput-component to the component tree and returns it.
 Component tfoot()
          Adds a tfoot-element to a surrounding Table-component.
 Component th()
          Adds a th-element (a header) the a surrounding TableBlock-element.
 Component thead()
          Adds a thead-element to a surrounding Table-component.
 Component title(java.lang.String text)
           
 Component tr()
          Adds a tr-element (a row) the a surrounding TableBlock-element.
 Component u()
           
 Component u(java.lang.Object text)
           
 Component ul()
          Adds a Block-component to the component tree, sets rendering hint to "ul" and returns it.
 Component up()
          Same as getParent().
 Component up(int levels)
          Same as up(), but makes it possible to move more then one level upwards at a time.
 Component var()
           
 Component var(java.lang.Object text)
           
 Component wBlock(java.lang.CharSequence renderHint)
          Adds a Block-component to the component tree and returns it.
 Component wrapSelf()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Component

public Component(java.lang.String componentId)
Minimum constructor for components that have given id's instead of generated ones.

Parameters:
componentId - The identifier for this component.

Component

public Component(Component parent)
Minimum constructor for components that have a generated component id.

Parameters:
parent - The component to which this new component will be added to.

Component

public Component(Component parent,
                 java.lang.String componentId)
Creates a new component with the given parent component and the given component id.

Parameters:
parent - The component to which this new component will be added to.The component to which this new component will be added to.
componentId - The identifier for this component.

Component

public Component(Component parent,
                 java.lang.String componentId,
                 java.lang.CharSequence renderHint)
Creates a new component with the given parent component, given component id and given render hint.

Parameters:
parent - The component to which this new component will be added to.The component to which this new component will be added to.
componentId - The identifier for this component.
renderHint - Instruction on how to render this component.
Method Detail

getComponentId

public java.lang.String getComponentId()
Returns the identitfier for this component. Every component must have a component id, either a given one or a generated one.

Returns:

getComponentName

public java.lang.String getComponentName()
Returns the short classname of the component class. Example: for com.foo.bar.Component2 will return Component2.

Returns:

renderHint

public Component renderHint(java.lang.CharSequence renderHint)
Adds a rendering hint to this component. A rendering hint can be either a css class reference or a xhtml specification tag name. Many rendering hints can be given in one input string. Example: "h1 error" will cause the component to render as <h1 class="error">. Note that the html tag name doesn't have to be first.

Parameters:
renderHint -
Returns:
Will return the component itself to enable method chaining.

attribute

public Component attribute(java.lang.String name,
                           java.lang.CharSequence value)
Adds an xhtml-attribute to the component. No checks are made to ensure the attributes are valid.

Parameters:
name - Name of the attribute
value - Value of the attribute. Can be an el-expression or a message.
Returns:
Will return the component itself to enable method chaining.

attributes

public Component attributes(java.lang.String... attributes)
Has the same functionality as addAsset(String fileUri) but uses varargs to enable adding multitple attributes at once.

Parameters:
attributes - name/value pairs.
Returns:
Will return the component itself to enable method chaining.

_getXhtmlAttributes

public java.util.Map<java.lang.String,java.lang.String> _getXhtmlAttributes()
Intended for internal use. Returns all attributes added to this component with calls to attribute() methods.

Returns:

actionBinding

public Component actionBinding(java.lang.String actionExpression)

actionBinding

public Component actionBinding(ActionExpression actionExpression)

action

public ActionExpression action(java.lang.String expression)

_getActions

public java.util.List<ActionExpression> _getActions()
Intetnded for internal use. Will return all actions added to this component with addAction() method.

Returns:

_getAction

public ActionExpression _getAction()
Intetnded for internal use. Will the first action added to this component with addAction() method.

Returns:

_getChildren

public java.util.List<Component> _getChildren()
Intended for internal use. Will return all child components.

Returns:

_getRenderableChildren

public java.util.List<RenderableComponent> _getRenderableChildren()
Intended for internal use. Will return all children of this component that implement the Renderable interface.

Returns:

create

public ComponentCreator create()

_getRenderHints

public java.util.List<java.lang.CharSequence> _getRenderHints()
Intended for internal use. Will return all rendering hints added to this component.

Returns:

nbsp

public Component nbsp()
Adds a non-breaking-space to the component tree.

Returns:
Will return the component itself to enable method chaining.

remove

public Component remove(Component component)
Removes a component from the list of children for this componnent.

Parameters:
component - The component to remove.
Returns:
Will return the component itself to enable method chaining.

remove

public Component remove(java.lang.String componentId)
Removes a component with the given component id from the list of children for this component.

Parameters:
componentId -
Returns:
Will return the component itself to enable method chaining.

table

public Component table()
Adds a Table-component to the component tree and returns it.

Returns:

caption

public Component caption()

thead

public Component thead()
Adds a thead-element to a surrounding Table-component. If the surrounding element is not a Table, thorws an exception.

Returns:

colgroup

public Component colgroup()
Adds a colgroup-element to a surrounding Table-component. If the surrounding element is not a Table, thorws an exception.

Returns:

col

public Component col()
Adds a col-element to a surrounding TableBlock-component. If the surrounding element is not a TableBlock, thorws an exception.

Returns:

tbody

public Component tbody()
Adds a tbody-element to a surrounding Table-component. If the surrounding element is not a Table, thorws an exception.

Returns:

tfoot

public Component tfoot()
Adds a tfoot-element to a surrounding Table-component. If the surrounding element is not a Table, thorws an exception.

Returns:

tr

public Component tr()
Adds a tr-element (a row) the a surrounding TableBlock-element. If the surrounding elemenent is not a TableBlock, throws an exception.

Returns:

td

public Component td()
Adds a td-element (a column) the a surrounding TableBlock-element. If the surrounding elemenent is not a TableBlock, throws an exception.

Returns:

th

public Component th()
Adds a th-element (a header) the a surrounding TableBlock-element. If the surrounding elemenent is not a TableBlock, throws an exception.

Returns:

link

public Component link(java.lang.String text)

link

public Component link()

meta

public Component meta()

img

public Component img(java.lang.String url,
                     java.lang.String alt)
Adds an Image-component to the component tree and returns it.

Parameters:
url - Either a full http-url or a filepath inside the web application.
alt - Alt text for the image if it can't be loaded or displayed.
Returns:

wBlock

public Component wBlock(java.lang.CharSequence renderHint)
Adds a Block-component to the component tree and returns it.

Parameters:
renderHint -
Returns:

label

public Component label()

label

public Component label(java.lang.Object text)

legend

public Component legend()

legend

public Component legend(java.lang.Object text)

map

public Component map(java.lang.String id)

noframes

public Component noframes()

noscript

public Component noscript()

object

public Component object()

param

public Component param(java.lang.CharSequence name)

pre

public Component pre()

pre

public Component pre(java.lang.Object text)

q

public Component q()

q

public Component q(java.lang.Object text)

s

public Component s()

s

public Component s(java.lang.Object text)

samp

public Component samp()

samp

public Component samp(java.lang.Object text)

small

public Component small()

small

public Component small(java.lang.Object text)

strike

public Component strike()

strike

public Component strike(java.lang.Object text)

style

public Component style()

sub

public Component sub()

sub

public Component sub(java.lang.Object text)

sup

public Component sup()

sup

public Component sup(java.lang.Object text)

u

public Component u()

u

public Component u(java.lang.Object text)

var

public Component var()

var

public Component var(java.lang.Object text)

text

public Component text(java.lang.Object textS)
Adds a Text-component to the component tree and returns it. Use this method to add text that might contain entity references like <copy> etc.

Parameters:
textS -
Returns:

entity

public Component entity(java.lang.String name)
Adds an XmlEntityRef-component to the component tree and returns it.

Parameters:
name - Name of the entity without & or ;. Example: entity("copy") will produce &copy; when rendered.
Returns:

dateInput

public FormElement dateInput(java.lang.String componentId,
                             java.lang.String datePattern)
Adds a DateInput component to the component tree and returns it.

Parameters:
componentId -
datePattern - Use the same pattern as in @see java.text.SimpleDateFormat
Returns:

numberInput

public FormElement numberInput(java.lang.String componentId)
Adds a NumberInput-component to the component tree and returns it. This method uses the default number format pattern for the default locale.

Parameters:
componentId -
Returns:

numberInput

public FormElement numberInput(java.lang.String componentId,
                               java.lang.CharSequence numberFormat)
Adds a NumberInput-component to the component tree and returns it.

Parameters:
componentId -
numberFormat - Use the same pattern as in
Returns:
See Also:
DecimalFormat

select

public FormElement select(java.lang.String componentId,
                          ISelectModel model,
                          ElExpression binding)
Adds a Select-component to the component tree and returns it.

Parameters:
componentId -
model - @see ISelectModel
Returns:

multiSelect

public FormElement multiSelect(java.lang.String componentId,
                               ISelectModel model,
                               ElExpression binding)
Adds a Select-component in multiselect mode to the component tree and returns it.

Parameters:
componentId -
model -
binding -
Returns:

head

public Component head()

title

public Component title(java.lang.String text)

hidden

public FormElement hidden(java.lang.String componentId)
Adds a Hidden-component to the component tree and returns it.

Parameters:
componentId -
Returns:

checkbox

public FormElement checkbox(java.lang.String componentId)
Adds a Checkbox-component to the component tree and returns it.

Parameters:
componentId -
Returns:

checkboxGroup

public FormElement checkboxGroup(java.lang.String componentId,
                                 ISelectModel model,
                                 ElExpression binding)
Adds a CheckboxGroup-component to the component tree and returns it.

Parameters:
componentId -
model -
Returns:

submit

public FormElement submit(java.lang.String componentId)
Adds a Submit-component to the component tree and returns it.

Parameters:
componentId -
Returns:

radio

public FormElement radio(java.lang.String componentId)
Adds a Radio-component to the component tree and returns it.

Parameters:
componentId -
Returns:

radioGroup

public FormElement radioGroup(java.lang.String componentId,
                              ISelectModel model,
                              ElExpression binding)
Adds a RadioGroup-component to the component tree and returns it.

Parameters:
componentId -
model -
binding -
Returns:

textInput

public FormElement textInput(java.lang.String componentId)
Adds a TextInput-component to the component tree and returns it.

Parameters:
componentId -
Returns:

fileInput

public FormElement fileInput(java.lang.String componentId)
Adds a FileInput-component to the component tree and returns it.

Parameters:
componentId -
Returns:

fileInput

public FormElement fileInput(java.lang.String componentId,
                             ElExpression metadataBinding)
Adds a FileInput-component to the component tree and returns it. Also sets metadata from uploaded file to the given metadataBinding. The bound field must be of type wheel.util.FileUploadMetadata.

Parameters:
componentId -
metadataBinding -
Returns:

textarea

public FormElement textarea(java.lang.String name)
Adds a TextArea-component to the component tree and returns it.

Returns:

form

public Component form(java.lang.String formId,
                      ActionExpression action)
Adds a Form-component to the component tree and returns it.

Parameters:
formId -
action - What action-method to call on form submit. Use Whee's URL action format here.
Returns:

form

public Component form(java.lang.String formId)

h1

public Component h1(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h1" and returns it.

Parameters:
text -
Returns:

h1

public Component h1()
Adds a Block-component to the component tree, sets rendering hint to "h1" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

h2

public Component h2(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h2" and returns it.

Parameters:
text -
Returns:

h2

public Component h2()
Adds a Block-component to the component tree, sets rendering hint to "h2" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

h3

public Component h3(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h3" and returns it.

Parameters:
text -
Returns:

h3

public Component h3()
Adds a Block-component to the component tree, sets rendering hint to "h3" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

h4

public Component h4(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h4" and returns it.

Parameters:
text -
Returns:

h4

public Component h4()
Adds a Block-component to the component tree, sets rendering hint to "h4" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

h5

public Component h5(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h5" and returns it.

Parameters:
text -
Returns:

h5

public Component h5()
Adds a Block-component to the component tree, sets rendering hint to "h5" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

h6

public Component h6(java.lang.Object text)
Adds a Label-component to the component tree, sets redering hint to "h6" and returns it.

Parameters:
text -
Returns:

h6

public Component h6()
Adds a Block-component to the component tree, sets rendering hint to "h6" and returns it. Use when you need to add some other tags inside a <h*> tag.

Returns:

b

public Component b(java.lang.Object text)
Adds a Label-component to the component tree, sets rendering hint to "b" and returns it.

Parameters:
text -
Returns:

b

public Component b()

i

public Component i(java.lang.Object text)
Adds a Label-component to the component tree, sets rendering hint to "i" and returns it.

Parameters:
text -
Returns:

i

public Component i()

script

public Component script()

abbr

public Component abbr()

abbr

public Component abbr(java.lang.Object text)

acronym

public Component acronym()

acronym

public Component acronym(java.lang.Object text)

address

public Component address()

address

public Component address(java.lang.Object text)

area

public Component area(java.lang.String... attributes)

base

public Component base(java.lang.CharSequence href)

bdo

public Component bdo(java.lang.CharSequence dir)

big

public Component big()

big

public Component big(java.lang.Object text)

blockquote

public Component blockquote()

button

public Component button()

cite

public Component cite()

cite

public Component cite(java.lang.Object text)

del

public Component del()

del

public Component del(java.lang.Object text)

dfn

public Component dfn()

dfn

public Component dfn(java.lang.Object text)

frame

public Component frame(java.lang.CharSequence src)

frameset

public Component frameset()

iframe

public Component iframe()

ins

public Component ins()

ins

public Component ins(java.lang.Object text)

kbd

public Component kbd()

kdb

public Component kdb(java.lang.Object text)

hr

public Component hr()
Adds an Any-component to the component tree, sets rendering hint to "hr" and returns it.

Returns:

div

public Component div()
Adds a Block-component to the component tree, sets rendering hint to "div" and returns it.

Returns:

ul

public Component ul()
Adds a Block-component to the component tree, sets rendering hint to "ul" and returns it.

Returns:

li

public Component li()
Adds a Block-component to the component tree, sets rendering hint to "li" and returns it.

Returns:

li

public Component li(java.lang.Object text)

dl

public Component dl()
Adds a Block-component to the component tree, sets rendering hint to "dl" and returns it.

Returns:

dd

public Component dd()
Adds a Block-component to the component tree, sets rendering hint to "dd" and returns it.

Returns:

dd

public Component dd(java.lang.Object text)

dt

public Component dt()
Adds a Block-component to the component tree, sets rendering hint to "dt" and returns it.

Returns:

dt

public Component dt(java.lang.Object text)

ol

public Component ol()
Adds a Block-component to the component tree, sets rendering hint to "ol" and returns it.

Returns:

p

public Component p()
Adds a Block-component to the component tree, sets rendering hint to "p" and returns it.

Returns:

p

public Component p(java.lang.Object text)
Adds a Label-component to the component tree, sets rendering hint to "p" and returns it.

Returns:

span

public Component span()
Adds a Block-component to the component tree, sets rendering hint to "span" and returns it.

Returns:

span

public Component span(java.lang.Object text)
Adds a Label-component to the component tree, sets rendering hint to "p" and returns it.

Returns:

fieldset

public Component fieldset()
Adds a Block-component to the component tree, sets rendering hint to "fieldset" and returns it.

Returns:

rawText

public Component rawText(java.lang.Object rawText)
Adds a Text-component to the component tree and sets it in cdata-mode causing all the text to be rendered inside a CDATA-section. Useful if you need to output for example javascript-code.

Parameters:
rawText -
Returns:

htmlText

public Component htmlText(java.lang.Object htmlText)
Adds a Text-component to the component tree and sets it in html-mode. In html-mode the Text-component will treat the text as html-code and retain all the html-tags.

Parameters:
htmlText -
Returns:

id

public Component id(java.lang.String componentId)
Changes the componentId.

Parameters:
componentId - New component id.
Returns:

_setComponentId

public void _setComponentId(java.lang.String componentId)
Intended for internal use. Sets the component id directly bypassing all checks and wrappings.

Parameters:
componentId -

getParent

public Component getParent()
Returns the parent for this component. If the component is an instance of Page, will return null.

Returns:

_getForm

public Form _getForm(boolean returnSelf)
Intended for internal use. Returns the Form-component (if any) surrounding this component.

Parameters:
returnSelf - If true, will return this component if this instanceof Form.
Returns:

_getVisibleForm

public Form _getVisibleForm(boolean returnSelf)

_getTopLevelComponent

public StandaloneComponent _getTopLevelComponent(boolean returnSelf)
Returns the containing StandaloneComponent. Usually this will return the same objext as getPage(), but for components living inside complex components, this will not return the page.

Parameters:
returnSelf - If true, will return self if this component is the top level component itself, otherwise will return the surrounding complex component.
Returns:

getPage

public StandaloneComponent getPage()
Returns the surrounding page where this component lives.

Returns:

getComponents

public java.util.Map<java.lang.String,Component> getComponents()
Returns:

addFirst

public Component addFirst(Component component)

add

public Component add(Component component)
Adds the given component to the component tree.

Parameters:
component -
Returns:
Will return the component itself to enable method chaining.

_clear

public void _clear()
Inteded for internal use. Clears all attributes and child components.


equals

public boolean equals(java.lang.Object o)
Component equality is based on component id.

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

br

public Component br()
Adds an Any-component to the component tree, sets rendring hint to "br" and returns it.

Returns:

up

public Component up()
Same as getParent(). Moves the "pointer" one level up. Useful when you want to do complex component trees using chained method calls.

Returns:

up

public Component up(int levels)
Same as up(), but makes it possible to move more then one level upwards at a time.

Parameters:
levels - How many levels to move upwards.
Returns:

get

public Component get(java.lang.String componentId)
Returns the component with the given component id. Note that this only works inside a StandaloneComponent so that you can access only components that are created in same buildComponent() / buildComponent() method. Useful for example for recalling previously created placeholders.

Parameters:
componentId -
Returns:

find

public Component find(java.lang.String componentId)
Finds a component with the given component id.

Parameters:
componentId -
Returns:
Throws:
WheelException - if no component was found.

findAll

public java.util.List<Component> findAll(ElExpression expression)
TODO

Parameters:
expression -
Returns:

_setGeneratedId

public void _setGeneratedId(boolean generatedId)
Inteded for internal use. Sets the status of the component id. When true, means that the id for this component was generated.

Parameters:
generatedId -

_isGeneratedId

public boolean _isGeneratedId()
Returns true if the id for this component was generated.

Returns:

_wrapComponentId

public java.lang.String _wrapComponentId(java.lang.String componentId)

eval

public java.lang.String eval(java.lang.Object expression)
Evaluates a String expression. Three different types are supported:

Parameters:
expression -
Returns:
Result of the evaluation.

_applyFormat

public java.lang.String _applyFormat(java.lang.Object value)
By overriding this method, its possible to apply some formatting to MVEL-evaluations in the eval() method.

Parameters:
value - The result of an MVEL-evaluation.
Returns:
A formattetd String based on the input Object.

getEngine

public IEngine getEngine()
Returns the IEngine instance that is serving this request-cycle.

Returns:

requestFocus

public Component requestFocus()
Request focus for this component on the browser. Note that only one component on a html page can have focus and it will be the last component to call this method before the page is rendered.

Returns:

encode

public java.lang.String encode(java.lang.String string)
URL-encodes the given string and returns it.

Parameters:
string -
Returns:

wrapSelf

public Component wrapSelf()

message

public java.lang.String message(java.lang.String key)
Returns a locaiized message with the given key.

Parameters:
key -
Returns:
See Also:
Messages

message

public java.lang.String message(java.lang.String key,
                                java.lang.Object... params)
Returns a localized and parametrized message with all {0...n} escapes replaced with values from the given Object array.

Parameters:
key -
params -
Returns:
See Also:
Messages

clasS

public Component clasS(java.lang.CharSequence Class)

a

public Component a(java.lang.Object text)

a

public Component a()

em

public Component em()

em

public Component em(java.lang.Object text)

strong

public Component strong()

strong

public Component strong(java.lang.Object text)

afterAdd

public void afterAdd()
A lifecycle method that is called after the component has been added to the component tree. When overriding this method, always call super.afterAdd();!!


placeholder

public Block placeholder(java.lang.String placeholderId)
Creates a placeholder. A placeholder is a Block-component that will not render itself. This makes it possible to leave behind placeholders in the component tree. These placeholders can be passed around for later use. Placeholders can also be accessed with the get() method.

Parameters:
placeholderId - Identifier for the placeholder.
Returns:

el

public ElExpression el(java.lang.String expression)

selectModel

public DynamicSelectModel selectModel()


Copyright 2007-2008. All Rights Reserved.