Class 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 Detail

      • TextAreaTag

        public TextAreaTag()
    • 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 the scrollWidth attribute.
        Parameters:
        s - the attribute's value
      • setScrollHeight

        public void setScrollHeight​(String s)
        Set method of the scrollHeight attribute.
        Parameters:
        s - the attribute's value
      • getPreferredScrollWidth

        public NumberWithUnit getPreferredScrollWidth()
        Returns the preferred scroll width of the represented component as a NumberWithUnit. 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 the scrollWidth property during the processing of this tag.
        Specified by:
        getPreferredScrollWidth in interface ScrollSizeSupport
        Returns:
        the preferred scroll width
      • getPreferredScrollHeight

        public NumberWithUnit getPreferredScrollHeight()
        Returns the preferred scroll height as a NumberWithUnit. 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 the scrollHeight property during the processing of this tag.
        Specified by:
        getPreferredScrollHeight in interface ScrollSizeSupport
        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 class InputComponentTag
        Parameters:
        manager - the component manager
        create - the create flag
        Returns:
        the component handler
        Throws:
        org.apache.commons.jelly.JellyTagException - if the tag is incorrectly used
        FormBuilderException - if an error occurs