org.apache.commons.jelly.tags.swing
Class GbcTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.DynaTagSupport
org.apache.commons.jelly.MapTagSupport
org.apache.commons.jelly.tags.core.UseBeanTag
org.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:
- either using a
basedOn
attribute which is
supposed to provide a reference to another GbcTag
.
- either using a parent
GbcTag
.
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
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 |
GbcTag
public GbcTag()
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 addconstraints
- 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.