Class PercentCellGroupTag

  • All Implemented Interfaces:
    ConditionalTag, org.apache.commons.jelly.Tag
    Direct Known Subclasses:
    PercentColGroupTag, PercentRowGroupTag

    public abstract class PercentCellGroupTag
    extends FormBaseTag

    A tag handler base class for tags that define cell groups for a percent layout.

    Tags of this type can appear in the body of a PercentLayoutTag. Each tag defines a single cell group. For simple groups that contain only two elements the attributes idx1 and idx2 can be used, which take the index of a column or row belonging to the group. For more complex group the indices attribute is appropriate, which takes a string with the comma separated list of cell indices.

    This base class already implements the evaluation of the attributes and the creation of the CellGroup object. Concrete sub classes only have to ensure that the correct setter method on the percent layout tag is called.

    Version:
    $Id: PercentCellGroupTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • PercentCellGroupTag

        public PercentCellGroupTag()
    • Method Detail

      • getIdx1

        public int getIdx1()
        Returns the index of the first cell that belongs to this group.
        Returns:
        the index of the first cell
      • setIdx1

        public void setIdx1​(int idx1)
        Setter method for the idx1 attribute.
        Parameters:
        idx1 - the attribute value
      • getIdx2

        public int getIdx2()
        Returns the index of the second cell that belongs to this group.
        Returns:
        the index of the second cell
      • setIdx2

        public void setIdx2​(int idx2)
        Setter method for the idx2 attribute.
        Parameters:
        idx2 - the attribute value
      • getIndices

        public String getIndices()
        Returns the indices of the cells of this group as string.
        Returns:
        the indices of the cells
      • setIndices

        public void setIndices​(String indices)
        Setter method for the indices attribute.
        Parameters:
        indices - the attribute value
      • process

        protected void process()
                        throws org.apache.commons.jelly.JellyTagException
        Executes this tag. Creates a new cell group object and then calls addGroup() to pass this object to the percent layout tag this tag belongs to.
        Specified by:
        process in class FormBaseTag
        Throws:
        org.apache.commons.jelly.JellyTagException - if no percent layout tag can be found
      • createGroup

        protected CellGroup createGroup()
                                 throws org.apache.commons.jelly.MissingAttributeException
        Creates the cell group object based on the attribute values.
        Returns:
        the cell group object
        Throws:
        org.apache.commons.jelly.MissingAttributeException - if required attributes are missing
      • addGroup

        protected abstract void addGroup​(PercentLayoutTag parent,
                                         CellGroup g)
        Adds the newly created cell group object to the corresponding percent layout tag. This method must be defined by concrete sub classes to call the correct setter method.
        Parameters:
        parent - the percent layout tag
        g - the group to add