Class TextAreaTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.ComponentBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.InputComponentTag
-
- net.sf.jguiraffe.gui.builder.components.tags.TextAreaTag
-
- All Implemented Interfaces:
ConditionalTag
,ScrollSizeSupport
,org.apache.commons.jelly.Tag
public class TextAreaTag extends InputComponentTag implements ScrollSizeSupport
A specific component tag that constructs a text area component.
A text area is closely related to a text field. In addition it can display multiple lines of text and has some additional properties. The following attributes are supported by this tag:
Attribute Description Optional columns Defines the number of columns the text field should have. This value acts as a hint for the width of this component. yes rows Defines the number of rows the text field should have. This value acts as a hint for the height of this component. yes maxlength Allows to define a maximum length for text the user can type into this text field. yes wrap This boolean attribute controls whether the text area should support word wrapping. yes scrollWidth Here the preferred width of the scroll pane enclosing the text area can be specified as a number with unit (e.g. "1.5cm"). If specified, the scroll pane will have exactly this preferred width. Otherwise, the width is determined by the preferred width of the text area. In this case it is recommended to set the columns
attribute.yes scrollHeight Here the preferred height of the scroll pane enclosing the text area can be specified as a number with unit (e.g. "10dlu"). If specified, the scroll pane will have exactly this preferred height. Otherwise, the height is determined by the preferred height of the text area. In this case it is recommended to set the rows
attribute.yes - Version:
- $Id: TextAreaTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description TextAreaTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComponentHandler<?>
createComponentHandler(ComponentManager manager, boolean create)
Creates a component handler for the text area defined by this tag.int
getColumns()
Returns the number of columns of this text area.int
getMaxlength()
Returns the maximum number of characters this text field will accept.NumberWithUnit
getPreferredScrollHeight()
Returns the preferred scroll height as aNumberWithUnit
.NumberWithUnit
getPreferredScrollWidth()
Returns the preferred scroll width of the represented component as aNumberWithUnit
.int
getRows()
Returns the number of rows of this text area.boolean
isWrap()
Returns a flag whether this text area should automatically wrap long lines.void
setColumns(int columns)
Setter method of the columns attribute.void
setMaxlength(int maxlength)
Setter method of the maxlength attribute.void
setRows(int rows)
Setter method of the rows attribute.void
setScrollHeight(String s)
Set method of thescrollHeight
attribute.void
setScrollWidth(String s)
Set method of thescrollWidth
attribute.void
setWrap(boolean wrap)
Setter method of the wrap attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.InputComponentTag
addToGroups, checkName, createFieldHandler, getComponent, getComponentHandler, getComponentType, getDisplayName, getFieldValidator, getFormValidator, getGroups, getPropertyName, getReadTransformer, getTypeName, getWriteTransformer, handleGroups, insertField, isNoField, process, processBeforeBody, setComponentType, setDisplayName, setDisplayNamegrp, setDisplayNameres, setFieldValidator, setFormValidator, setGroups, setNoField, setPropertyName, setReadTransformer, setTypeName, setWriteTransformer
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ComponentBaseTag
getBackColor, getBackgroundColor, getConstraints, getFont, getFontRef, getForeColor, getForegroundColor, getName, getToolTipData, insertComponent, setBackColor, setConstraints, setFont, setFontRef, setForeColor, setName, setTooltip, setTooltipres, setTooltipresgrp
-
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, 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
-
getColumns
public int getColumns()
Returns the number of columns of this text area.- Returns:
- the number of columns
-
setColumns
public void setColumns(int columns)
Setter method of the columns attribute.- Parameters:
columns
- the attribute value
-
getMaxlength
public int getMaxlength()
Returns the maximum number of characters this text field will accept.- Returns:
- the maximum text length
-
setMaxlength
public void setMaxlength(int maxlength)
Setter method of the maxlength attribute.- Parameters:
maxlength
- the attribute value
-
getRows
public int getRows()
Returns the number of rows of this text area.- Returns:
- the number of rows
-
setRows
public void setRows(int rows)
Setter method of the rows attribute.- Parameters:
rows
- the attribute value
-
isWrap
public boolean isWrap()
Returns a flag whether this text area should automatically wrap long lines.- Returns:
- the wrapping flag
-
setWrap
public void setWrap(boolean wrap)
Setter method of the wrap attribute.- Parameters:
wrap
- the attribute value
-
setScrollWidth
public void setScrollWidth(String s)
Set method of thescrollWidth
attribute.- Parameters:
s
- the attribute's value
-
setScrollHeight
public void setScrollHeight(String s)
Set method of thescrollHeight
attribute.- Parameters:
s
- the attribute's value
-
getPreferredScrollWidth
public NumberWithUnit getPreferredScrollWidth()
Returns the preferred scroll width of the represented component as aNumberWithUnit
. Typically, this value is determined during processing of this tag. An implementation should never return null. If no scroll width has been specified, a value of 0 or negative should be returned. This implementation obtains the preferred scroll width from the value of thescrollWidth
property during the processing of this tag.- Specified by:
getPreferredScrollWidth
in interfaceScrollSizeSupport
- Returns:
- the preferred scroll width
-
getPreferredScrollHeight
public NumberWithUnit getPreferredScrollHeight()
Returns the preferred scroll height as aNumberWithUnit
. Typically, this value is determined during processing of this tag. An implementation should never return null. If no scroll height has been specified, a value of 0 or negative should be returned. This implementation obtains the preferred scroll width from the value of thescrollHeight
property during the processing of this tag.- Specified by:
getPreferredScrollHeight
in interfaceScrollSizeSupport
- Returns:
- the preferred scroll height
-
createComponentHandler
protected ComponentHandler<?> createComponentHandler(ComponentManager manager, boolean create) throws FormBuilderException, org.apache.commons.jelly.JellyTagException
Creates a component handler for the text area defined by this tag.- Specified by:
createComponentHandler
in classInputComponentTag
- Parameters:
manager
- the component managercreate
- the create flag- Returns:
- the component handler
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is incorrectly usedFormBuilderException
- if an error occurs
-
-