org.apache.commons.jelly.tags.swing
Class ButtonGroupTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.DynaTagSupport
          extended byorg.apache.commons.jelly.MapTagSupport
              extended byorg.apache.commons.jelly.tags.core.UseBeanTag
                  extended byorg.apache.commons.jelly.tags.swing.ComponentTag
                      extended byorg.apache.commons.jelly.tags.swing.ButtonGroupTag
All Implemented Interfaces:
org.apache.commons.jelly.impl.BeanSource, ContainerTag, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag

public class ButtonGroupTag
extends ComponentTag

Implements a ButtonGroup. This tag acts like a Swing component except that adding a component other than an AbstractButton, will be passed through to the parent tag. This is meant to make the buttonGroup easier to use like this:

 <panel>
  <buttonGroup>
      <panel>
          <radioButton/>
      </panel>
      <panel>
          <radioButton/>
      </panel>
  </buttonGroup>
 </panel>
 

Note that the following construct will silently fail, and shame on s/he who even tried it:

 <panel>
  <buttonGroup>
      <font .../>
      <panel>
          <radioButton/>
      </panel>
      <panel>
          <radioButton/>
      </panel>
  </buttonGroup>
 </panel>
 

Author:
Hans Gilde

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ButtonGroupTag()
           
 
Method Summary
 void addChild(java.awt.Component component, java.lang.Object constraints)
          If the child is an AbstractButton, add it to the button group.
protected  javax.swing.ButtonGroup getButtonGroup()
           
protected  java.lang.Object newInstance(java.lang.Class theClass, java.util.Map attributes, org.apache.commons.jelly.XMLOutput output)
          Creates a new buttonGroup.
 
Methods inherited from class org.apache.commons.jelly.tags.swing.ComponentTag
addFocusListener, addKeyListener, addWindowListener, clearBean, convertToClass, doTag, getComponent, getConstraint, processBean, setAction, setBeanProperties, setBorder, setFont, setLayout, setTagName, toString
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, setBean, setIgnoreUnknownProperties, validateBeanProperties
 
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes, setAttribute
 
Methods inherited from class org.apache.commons.jelly.DynaTagSupport
getAttributeType
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Constructor Detail

ButtonGroupTag

public ButtonGroupTag()
Method Detail

addChild

public void addChild(java.awt.Component component,
                     java.lang.Object constraints)
              throws org.apache.commons.jelly.JellyTagException
If the child is an AbstractButton, add it to the button group. Otherwise, pass through to the parent component tag.

Specified by:
addChild in interface ContainerTag
Overrides:
addChild in class ComponentTag
Throws:
org.apache.commons.jelly.JellyTagException
See Also:
ContainerTag.addChild(java.awt.Component, java.lang.Object)

newInstance

protected java.lang.Object newInstance(java.lang.Class theClass,
                                       java.util.Map attributes,
                                       org.apache.commons.jelly.XMLOutput output)
                                throws org.apache.commons.jelly.JellyTagException
Creates a new buttonGroup.

Overrides:
newInstance in class ComponentTag
Throws:
org.apache.commons.jelly.JellyTagException
See Also:
UseBeanTag.newInstance(java.lang.Class, java.util.Map, org.apache.commons.jelly.XMLOutput)

getButtonGroup

protected javax.swing.ButtonGroup getButtonGroup()


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.