Class RadioGroupTag
- 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.InputComponentTag
-
- net.sf.jguiraffe.gui.builder.components.tags.FieldTag
-
- net.sf.jguiraffe.gui.builder.components.tags.RadioGroupTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
public class RadioGroupTag extends FieldTag
A tag for creating a radio group.
When working with radio buttons it is not enough to insert these components into the generated GUI (by using the corresponding tags), but the groups the radio buttons belong to must also be defined. Without this information the special property of radio buttons - that only one button can be selected - could not be realized.
Because the group a number of radio buttons belong to need not be correlated with the controls' layout, the form builder library treats radio groups as non visible, non GUI components. So they are not themselves added to the generated GUI; they are merely logic elements implementing the radio button functionality. However, they are added as field to the enclosing
Form
, and thus the data of the group can be queried.To define a radio group the same concept as is used for logic component groups is used: A
RadioGroupTag
internally creates a component group analogously to theComponentGroupTag
. Components can be added to this group by either nesting them inside theRadioGroupTag
tag or by specifying the group's name in thegroups
attribute.The main difference between this tag and the
ComponentGroupTag
lies in the fact that this tag calls the component manager'screateRadioGroup()
method at the very end of the building process and ensures that all elements of the group are added to the radio group. It is then in the responsibility of theComponentManager
implementation to provide a suitable implementation of the radio group behavior (e.g. in Swing there is a corresponding non visual object implementing the desired functionality). Though it is a non visible component, the new radio group will be added to the component list of the centralComponentBuilderData
instance.This tag is derived from
FieldTag
and therefore supports the typical attributes of input components. However, in this context only thename
attribute makes sense which also determines the name of the component group created for the radio group. In the body of this tag aComponentHandlerTag
can be placed for specifying a customComponentHandler
. Note that theComponentHandler
specified here must be derived fromCompositeComponentHandler
because the component handlers for the single radio buttons are added to it. If noComponentHandler
is specified, a default component handler for the radio button group is created: an instance of theDefaultRadioButtonHandler
class.- Version:
- $Id: RadioGroupTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description RadioGroupTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
process()
Executes this tag.protected void
processBeforeBody()
Performs processing before the tag's body is evaluated.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FieldTag
createComponentHandler, setComponentHandler
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.InputComponentTag
addToGroups, checkName, createFieldHandler, getComponent, getComponentHandler, getComponentType, getDisplayName, getFieldValidator, getFormValidator, getGroups, getPropertyName, getReadTransformer, getTypeName, getWriteTransformer, handleGroups, insertField, isNoField, setComponentType, setDisplayName, setDisplayNamegrp, setDisplayNameres, setFieldValidator, setFormValidator, setGroups, setNoField, setPropertyName, setReadTransformer, setTypeName, setWriteTransformer
-
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
-
processBeforeBody
protected void processBeforeBody() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Performs processing before the tag's body is evaluated. This implementation sets a defaultComponentHandler
and creates the component group for managing the radio buttons.- Overrides:
processBeforeBody
in classInputComponentTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is used incorrectlyFormBuilderException
- if an error occurs
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Executes this tag. After the processing of the base class this implementation creates and initializes a call back object that will create the radio group at the very end of the building process.- Overrides:
process
in classInputComponentTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is used incorrectlyFormBuilderException
- if an error occurs
-
-