Class PercentConstraintsTag

  • All Implemented Interfaces:
    ConditionalTag, org.apache.commons.jelly.Tag

    public class PercentConstraintsTag
    extends ConstraintsTag

    A specific layout constraints tag that creates a PercentData object, i.e. layout constraints for the PercentLayout class.

    The following attributes are supported by this tag:

    Attribute Description Optional
    col Defines the number of the column in the layout grid. no
    row Defines the number of the row in the layout grid. no
    spanx Defines the number of columns occupied by the component. Defaults to 1. yes
    spany Defines the number of rows occupied by the component. Defaults to 1. yes
    colconstr Allows to define column constraints. If this feature is used, a string must be specified that can be parsed by the cell constraints class. yes
    rowconstr Allows to define row constraints. If this feature is used, a string must be specified that can be parsed by the cell constraints class. yes
    targetCol Defines the target column. This is important only if the component spans multiple columns. yes
    targetRow Defines the target row. This is important only if the component spans multiple rows. yes

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

      • PercentConstraintsTag

        public PercentConstraintsTag()
    • Method Detail

      • getCol

        public int getCol()
        Returns the column number in the layout grid.
        Returns:
        the column number
      • setCol

        public void setCol​(int col)
        Setter method for the col attribute.
        Parameters:
        col - the attribute value
      • getColconstr

        public String getColconstr()
        Returns the column constraints as string.
        Returns:
        the column constraints
      • setColconstr

        public void setColconstr​(String colconstr)
        Setter method for the colconstr attribute.
        Parameters:
        colconstr - the attribute value
      • getRow

        public int getRow()
        Returns the row number in the layout grid.
        Returns:
        the row number
      • setRow

        public void setRow​(int row)
        Setter method for the row attribute.
        Parameters:
        row - the attribute value
      • getRowconstr

        public String getRowconstr()
        Returns the row constraints as string.
        Returns:
        the row constraints
      • setRowconstr

        public void setRowconstr​(String rowconstr)
        Setter method for the rowconstr attribute.
        Parameters:
        rowconstr - the attribute value
      • getSpanx

        public int getSpanx()
        Returns the number of occupied columns.
        Returns:
        the column span
      • setSpanx

        public void setSpanx​(int spanx)
        Setter method for the spanx attribute.
        Parameters:
        spanx - the attribute value
      • getSpany

        public int getSpany()
        Returns the number of occupied rows.
        Returns:
        the row span
      • setSpany

        public void setSpany​(int spany)
        Setter method for the spany attribute.
        Parameters:
        spany - the attribute value
      • getTargetCol

        public int getTargetCol()
        Returns the target column.
        Returns:
        the target column
      • setTargetCol

        public void setTargetCol​(int targetCol)
        Sets the target column.
        Parameters:
        targetCol - the target column
      • getTargetRow

        public int getTargetRow()
        Returns the target row.
        Returns:
        the target row
      • setTargetRow

        public void setTargetRow​(int targetRow)
        Sets the target row.
        Parameters:
        targetRow - the target row
      • createConstraints

        protected Object createConstraints​(ComponentManager manager)
                                    throws FormBuilderException,
                                           org.apache.commons.jelly.MissingAttributeException
        Creates the constraints object. This implementation creates an instance of the PercentData class.
        Specified by:
        createConstraints in class ConstraintsTag
        Parameters:
        manager - the component manager (not used)
        Returns:
        the new constraints
        Throws:
        FormBuilderException - if an error occurs
        org.apache.commons.jelly.MissingAttributeException - if a required attribute is missing