Class ColumnComponentTag
- 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.SimpleComponentTag
-
- net.sf.jguiraffe.gui.builder.components.tags.ContainerTag
-
- net.sf.jguiraffe.gui.builder.components.tags.table.ColumnComponentTag
-
- All Implemented Interfaces:
Composite
,ConditionalTag
,org.apache.commons.jelly.Tag
- Direct Known Subclasses:
ColumnEditorTag
,ColumnRendererTag
public abstract class ColumnComponentTag extends ContainerTag
An abstract base class for tags that define renderers or editors for the columns of a table.
This tag is a specialized container. By tags in its body a single component can be added (which can be a container component containing arbitrary other data). This component will then be added to either the column's render or edit form (concrete sub classes decide, which form is used).
A concrete sub class has to implement the following functionality:
- It must be able to obtain the correct form from the hosting table tag
that is used for this kind of column component. For this purpose the
getTableForm()
method must be implemented. - The results of the processing of this tag must be passed to the hosting
column tag. This is done in the
initializeColumn()
method.
- Version:
- $Id: ColumnComponentTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ColumnComponentTag()
Creates a new instance ofColumnComponentTag
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addComponents(ComponentManager manager, Object container, Collection<Object[]> comps)
Adds the components defined by nested tags to this container tag.protected Object
createContainer(ComponentManager manager, boolean create, Collection<Object[]> components)
Creates the container represented by this tag.protected abstract Form
getTableForm(TableTag tabTag)
Returns the form of the hosting table that stores the components managed by this tag.TableTag
getTableTag()
Returns a reference to the table tag this tag is nested inside.protected abstract void
initializeColumn(TableColumnTag colTag, Object bodyComponent, Set<String> componentNames)
Initializes the hosting column tag with the information gathered by this tag.protected void
processBeforeBody()
Performs processing before this tag's body is evaluated.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ContainerTag
addComponent, createComponent, getComposite, getContainer, getLayout, setComposite, setLayout
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.SimpleComponentTag
getComponent, process
-
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
-
getTableTag
public TableTag getTableTag()
Returns a reference to the table tag this tag is nested inside.- Returns:
- the hosting table tag
-
processBeforeBody
protected void processBeforeBody() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Performs processing before this tag's body is evaluated. This implementation will do some checks.- Overrides:
processBeforeBody
in classContainerTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occursFormBuilderException
- if the tag is incorrectly used
-
createContainer
protected Object createContainer(ComponentManager manager, boolean create, Collection<Object[]> components) throws FormBuilderException, org.apache.commons.jelly.JellyTagException
Creates the container represented by this tag. For this tag handler we only need a fake implementation because the returned object will never be added into a root container or content will be added to it. So simply a reference to this is returned. This also allows the table tag to check that only valid content is defined in its body.- Specified by:
createContainer
in classContainerTag
- Parameters:
manager
- the component managercreate
- the create flagcomponents
- a collection with the defined child components- Returns:
- a reference to the new container
- Throws:
FormBuilderException
- if an error occursorg.apache.commons.jelly.JellyTagException
- if the tag is incorrectly used
-
addComponents
protected void addComponents(ComponentManager manager, Object container, Collection<Object[]> comps) throws FormBuilderException
Adds the components defined by nested tags to this container tag. This implementation checks whether the tag's content is valid. If this is the case, the hosting column tag will be correctly initialized.- Overrides:
addComponents
in classContainerTag
- Parameters:
manager
- the component managercontainer
- the created containercomps
- the created components- Throws:
FormBuilderException
- if an error occurs
-
getTableForm
protected abstract Form getTableForm(TableTag tabTag)
Returns the form of the hosting table that stores the components managed by this tag. This method is always called when access to this form is needed.- Parameters:
tabTag
- the table tag- Returns:
- the form for storing the components defined in this tag
-
initializeColumn
protected abstract void initializeColumn(TableColumnTag colTag, Object bodyComponent, Set<String> componentNames)
Initializes the hosting column tag with the information gathered by this tag. This method is called once at the end of the processing of this tag. Its purpose is to initialize some of the fields required for the column.- Parameters:
colTag
- a reference to the column tag this tag is nested insidebodyComponent
- the component defined in the body of this tagcomponentNames
- a set with the names of all components referred to by this tag
-
-