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

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.GbcTag
All Implemented Interfaces:
BeanSource, ContainerTag, DynaTag, Tag

public class GbcTag
extends UseBeanTag
implements ContainerTag

This class represents a GridBagConstraints constraints as passed in the second argument of Container#add(Component,Object). It supports inheritence between such tags in the following fashion:

The first version takes precedence. A Grid-bag-constraint inherits from another simply by setting other attributes as is done in GridBagConstraintBean.setBasedOn(org.apache.commons.jelly.tags.swing.impl.GridBagConstraintBean).

In essence, it looks really like nothing else than a bean-class... with getConstraints(). Probably a shorter java-source is do-able.

TODO: this class should probably be extended with special treatment for dimensions using the converter package.

Version:
$Revision: 1.2 $
Author:
Paul Libbrecht

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
GbcTag()
           
 
Method Summary
 void addChild(Component component, Object constraints)
          Adds a child component to this parent
protected  Class convertToClass(Object classObject)
          A class may be specified otherwise the Factory will be used.
static Tag findAncestorWithClass(Tag from, Class tagClass, Tag parent)
           
 GridBagConstraints getConstraints()
           
protected  Object newInstance(Class theClass, Map attributes, XMLOutput output)
          A class may be specified otherwise the Factory will be used.
protected  void setBeanProperties(Object bean, Map attributes)
           
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
doTag, getBean, getDefaultClass, loadClass, processBean, setBean
 
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, isTrim, setBody, setContext, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Constructor Detail

GbcTag

public GbcTag()
Method Detail

getConstraints

public GridBagConstraints getConstraints()

addChild

public void addChild(Component component,
                     Object constraints)
              throws JellyTagException
Adds a child component to this parent

Specified by:
addChild in interface ContainerTag
Parameters:
component - the child to add
constraints - the constraints to use
Throws:
JellyTagException

convertToClass

protected Class convertToClass(Object classObject)
                        throws MissingAttributeException,
                               ClassNotFoundException
A class may be specified otherwise the Factory will be used.

Parameters:
classObject - the object to be converted
Throws:
MissingAttributeException
ClassNotFoundException

newInstance

protected Object newInstance(Class theClass,
                             Map attributes,
                             XMLOutput output)
                      throws JellyTagException
A class may be specified otherwise the Factory will be used.

Throws:
JellyTagException

setBeanProperties

protected void setBeanProperties(Object bean,
                                 Map attributes)
                          throws JellyTagException
Throws:
JellyTagException

findAncestorWithClass

public static Tag findAncestorWithClass(Tag from,
                                        Class tagClass,
                                        Tag parent)


Copyright © 2003 The Xwing Project. All Rights Reserved.