Class PercentCellGroupTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.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 attributesidx1andidx2can be used, which take the index of a column or row belonging to the group. For more complex group theindicesattribute 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
CellGroupobject. 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 Summary
Constructors Constructor Description PercentCellGroupTag()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddGroup(PercentLayoutTag parent, CellGroup g)Adds the newly created cell group object to the corresponding percent layout tag.protected CellGroupcreateGroup()Creates the cell group object based on the attribute values.intgetIdx1()Returns the index of the first cell that belongs to this group.intgetIdx2()Returns the index of the second cell that belongs to this group.StringgetIndices()Returns the indices of the cells of this group as string.protected voidprocess()Executes this tag.voidsetIdx1(int idx1)Setter method for the idx1 attribute.voidsetIdx2(int idx2)Setter method for the idx2 attribute.voidsetIndices(String indices)Setter method for the indices 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
-
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.JellyTagExceptionExecutes this tag. Creates a new cell group object and then callsaddGroup()to pass this object to the percent layout tag this tag belongs to.- Specified by:
processin classFormBaseTag- 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 tagg- the group to add
-
-