|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wheel.components.Component
public abstract class Component
The main API for Wheel. Contains most of the methods to manipulate the component tree for the page/component.
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 |
---|
public Component(java.lang.String componentId)
componentId
- The identifier for this component.public Component(Component parent)
parent
- The component to which this new component will be added to.public Component(Component parent, java.lang.String componentId)
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.public Component(Component parent, java.lang.String componentId, java.lang.CharSequence renderHint)
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 |
---|
public java.lang.String getComponentId()
public java.lang.String getComponentName()
public Component renderHint(java.lang.CharSequence renderHint)
renderHint
-
public Component attribute(java.lang.String name, java.lang.CharSequence value)
name
- Name of the attributevalue
- Value of the attribute. Can be an el-expression or a message.
public Component attributes(java.lang.String... attributes)
attributes
- name/value pairs.
public java.util.Map<java.lang.String,java.lang.String> _getXhtmlAttributes()
public Component actionBinding(java.lang.String actionExpression)
public Component actionBinding(ActionExpression actionExpression)
public ActionExpression action(java.lang.String expression)
public java.util.List<ActionExpression> _getActions()
public ActionExpression _getAction()
public java.util.List<Component> _getChildren()
public java.util.List<RenderableComponent> _getRenderableChildren()
public ComponentCreator create()
public java.util.List<java.lang.CharSequence> _getRenderHints()
public Component nbsp()
public Component remove(Component component)
component
- The component to remove.
public Component remove(java.lang.String componentId)
componentId
-
public Component table()
public Component caption()
public Component thead()
public Component colgroup()
public Component col()
public Component tbody()
public Component tfoot()
public Component tr()
public Component td()
public Component th()
public Component link(java.lang.String text)
public Component link()
public Component meta()
public Component img(java.lang.String url, java.lang.String alt)
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.
public Component wBlock(java.lang.CharSequence renderHint)
renderHint
-
public Component label()
public Component label(java.lang.Object text)
public Component legend()
public Component legend(java.lang.Object text)
public Component map(java.lang.String id)
public Component noframes()
public Component noscript()
public Component object()
public Component param(java.lang.CharSequence name)
public Component pre()
public Component pre(java.lang.Object text)
public Component q()
public Component q(java.lang.Object text)
public Component s()
public Component s(java.lang.Object text)
public Component samp()
public Component samp(java.lang.Object text)
public Component small()
public Component small(java.lang.Object text)
public Component strike()
public Component strike(java.lang.Object text)
public Component style()
public Component sub()
public Component sub(java.lang.Object text)
public Component sup()
public Component sup(java.lang.Object text)
public Component u()
public Component u(java.lang.Object text)
public Component var()
public Component var(java.lang.Object text)
public Component text(java.lang.Object textS)
textS
-
public Component entity(java.lang.String name)
name
- Name of the entity without & or ;. Example: entity("copy") will produce © when rendered.
public FormElement dateInput(java.lang.String componentId, java.lang.String datePattern)
componentId
- datePattern
- Use the same pattern as in @see java.text.SimpleDateFormat
public FormElement numberInput(java.lang.String componentId)
componentId
-
public FormElement numberInput(java.lang.String componentId, java.lang.CharSequence numberFormat)
componentId
- numberFormat
- Use the same pattern as in
DecimalFormat
public FormElement select(java.lang.String componentId, ISelectModel model, ElExpression binding)
componentId
- model
- @see ISelectModel
public FormElement multiSelect(java.lang.String componentId, ISelectModel model, ElExpression binding)
componentId
- model
- binding
-
public Component head()
public Component title(java.lang.String text)
public FormElement hidden(java.lang.String componentId)
componentId
-
public FormElement checkbox(java.lang.String componentId)
componentId
-
public FormElement checkboxGroup(java.lang.String componentId, ISelectModel model, ElExpression binding)
componentId
- model
-
public FormElement submit(java.lang.String componentId)
componentId
-
public FormElement radio(java.lang.String componentId)
componentId
-
public FormElement radioGroup(java.lang.String componentId, ISelectModel model, ElExpression binding)
componentId
- model
- binding
-
public FormElement textInput(java.lang.String componentId)
componentId
-
public FormElement fileInput(java.lang.String componentId)
componentId
-
public FormElement fileInput(java.lang.String componentId, ElExpression metadataBinding)
componentId
- metadataBinding
-
public FormElement textarea(java.lang.String name)
public Component form(java.lang.String formId, ActionExpression action)
formId
- action
- What action-method to call on form submit. Use Whee's URL action format here.
public Component form(java.lang.String formId)
public Component h1(java.lang.Object text)
text
-
public Component h1()
public Component h2(java.lang.Object text)
text
-
public Component h2()
public Component h3(java.lang.Object text)
text
-
public Component h3()
public Component h4(java.lang.Object text)
text
-
public Component h4()
public Component h5(java.lang.Object text)
text
-
public Component h5()
public Component h6(java.lang.Object text)
text
-
public Component h6()
public Component b(java.lang.Object text)
text
-
public Component b()
public Component i(java.lang.Object text)
text
-
public Component i()
public Component script()
public Component abbr()
public Component abbr(java.lang.Object text)
public Component acronym()
public Component acronym(java.lang.Object text)
public Component address()
public Component address(java.lang.Object text)
public Component area(java.lang.String... attributes)
public Component base(java.lang.CharSequence href)
public Component bdo(java.lang.CharSequence dir)
public Component big()
public Component big(java.lang.Object text)
public Component blockquote()
public Component button()
public Component cite()
public Component cite(java.lang.Object text)
public Component del()
public Component del(java.lang.Object text)
public Component dfn()
public Component dfn(java.lang.Object text)
public Component frame(java.lang.CharSequence src)
public Component frameset()
public Component iframe()
public Component ins()
public Component ins(java.lang.Object text)
public Component kbd()
public Component kdb(java.lang.Object text)
public Component hr()
public Component div()
public Component ul()
public Component li()
public Component li(java.lang.Object text)
public Component dl()
public Component dd()
public Component dd(java.lang.Object text)
public Component dt()
public Component dt(java.lang.Object text)
public Component ol()
public Component p()
public Component p(java.lang.Object text)
public Component span()
public Component span(java.lang.Object text)
public Component fieldset()
public Component rawText(java.lang.Object rawText)
rawText
-
public Component htmlText(java.lang.Object htmlText)
htmlText
-
public Component id(java.lang.String componentId)
componentId
- New component id.
public void _setComponentId(java.lang.String componentId)
componentId
- public Component getParent()
public Form _getForm(boolean returnSelf)
returnSelf
- If true, will return this component if this instanceof Form.
public Form _getVisibleForm(boolean returnSelf)
public StandaloneComponent _getTopLevelComponent(boolean returnSelf)
returnSelf
- If true, will return self if this component is the top level component itself, otherwise will return the surrounding complex component.
public StandaloneComponent getPage()
public java.util.Map<java.lang.String,Component> getComponents()
public Component addFirst(Component component)
public Component add(Component component)
component
-
public void _clear()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
-
public int hashCode()
hashCode
in class java.lang.Object
public Component br()
public Component up()
public Component up(int levels)
levels
- How many levels to move upwards.
public Component get(java.lang.String componentId)
componentId
-
public Component find(java.lang.String componentId)
componentId
-
WheelException
- if no component was found.public java.util.List<Component> findAll(ElExpression expression)
expression
-
public void _setGeneratedId(boolean generatedId)
generatedId
- public boolean _isGeneratedId()
public java.lang.String _wrapComponentId(java.lang.String componentId)
public java.lang.String eval(java.lang.Object expression)
expression
-
public java.lang.String _applyFormat(java.lang.Object value)
value
- The result of an MVEL-evaluation.
public IEngine getEngine()
public Component requestFocus()
public java.lang.String encode(java.lang.String string)
string
-
public Component wrapSelf()
public java.lang.String message(java.lang.String key)
key
-
Messages
public java.lang.String message(java.lang.String key, java.lang.Object... params)
key
- params
-
Messages
public Component clasS(java.lang.CharSequence Class)
public Component a(java.lang.Object text)
public Component a()
public Component em()
public Component em(java.lang.Object text)
public Component strong()
public Component strong(java.lang.Object text)
public void afterAdd()
public Block placeholder(java.lang.String placeholderId)
placeholderId
- Identifier for the placeholder.
public ElExpression el(java.lang.String expression)
public DynamicSelectModel selectModel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |