Class ListModelItemTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.ListModelItemTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
public class ListModelItemTag extends FormBaseTag
A tag handler class that creates an item for a list model.
Tags of this class can appear in the body of a
tag. Each tag defines one item of the model with a mandatory display text (which can be set either directly or through a resource definition) and an optional value. The following table lists all supported attributes:TextListModelTag
Attribute Description Optional text Defines the display text of this model item directly. exactly one of these textres Allows to define the display text of this model item from a resource property. If no resource group is specified, the builder's default resource will be used. resgrp Sets the resource group to use to resolve the resource provided by the textres
attribute.yes value The corresponding value of this list model item. This can be an arbitrary object. yes valueRef Using this attribute the value of the corresponding list item can be specified as a reference. It will be looked up in the current BeanContext
. This way the full power of the dependency injection framework can be used for creating and initializing Java objects. If both thevalue
and thevalueRef
attributes are specified, thevalue
attribute takes precedence.yes - Version:
- $Id: ListModelItemTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ListModelItemTag()
Creates a new instance ofListModelItemTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
fetchValue()
Returns the value of this item.TextData
getTextData()
Returns the text data object with the definition of the display text.Object
getValue()
Returns the value of this list item.String
getValueRef()
Returns the reference to the value.protected void
process()
Executes this tag.void
setResgrp(String s)
Setter method of the resgrp attribute.void
setText(String s)
Setter method of the text attribute.void
setTextres(String s)
Setter method of the textres attribute.void
setValue(Object v)
Setter method of the value attribute.void
setValueRef(String valueRef)
Set method of thevalueRef
attribute-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
canProcess, canProcess, convertToClass, convertToNumberWithUnit, convertToNumberWithUnit, doTag, findContainer, getBuilderData, getBuilderData, getIfName, getResourceText, getResourceText, getUnlessName, processBeforeBody, setIfName, setUnlessName
-
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
-
-
-
Method Detail
-
getTextData
public TextData getTextData()
Returns the text data object with the definition of the display text.- Returns:
- the display text data
-
setText
public void setText(String s)
Setter method of the text attribute.- Parameters:
s
- the attribute value
-
setTextres
public void setTextres(String s)
Setter method of the textres attribute.- Parameters:
s
- the attribute value
-
setResgrp
public void setResgrp(String s)
Setter method of the resgrp attribute.- Parameters:
s
- the attribute value
-
getValue
public Object getValue()
Returns the value of this list item.- Returns:
- the value (can be null )
-
setValue
public void setValue(Object v)
Setter method of the value attribute.- Parameters:
v
- the attribute value
-
getValueRef
public String getValueRef()
Returns the reference to the value.- Returns:
- the reference name of the value bean
-
setValueRef
public void setValueRef(String valueRef)
Set method of thevalueRef
attribute- Parameters:
valueRef
- the attribute value
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException
Executes this tag.- Specified by:
process
in classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if this tag is used incorrectly
-
fetchValue
protected Object fetchValue()
Returns the value of this item. This method is called byprocess()
. It inspects the attributesvalue
andvalueRef
and processes them correspondingly.- Returns:
- the value of this item (can be null if unspecified)
-
-