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:
org.apache.commons.jelly.impl.BeanSource, ContainerTag, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.Tag

public class GbcTag
extends org.apache.commons.jelly.tags.core.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: 155420 $
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(java.awt.Component component, java.lang.Object constraints)
          Adds a child component to this parent
protected  java.lang.Class convertToClass(java.lang.Object classObject)
          A class may be specified otherwise the Factory will be used.
static org.apache.commons.jelly.Tag findAncestorWithClass(org.apache.commons.jelly.Tag from, java.lang.Class tagClass, org.apache.commons.jelly.Tag parent)
           
 java.awt.GridBagConstraints getConstraints()
           
protected  java.lang.Object newInstance(java.lang.Class theClass, java.util.Map attributes, org.apache.commons.jelly.XMLOutput output)
          A class may be specified otherwise the Factory will be used.
protected  void setBeanProperties(java.lang.Object bean, java.util.Map attributes)
           
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, doTag, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, processBean, 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, 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 java.awt.GridBagConstraints getConstraints()

addChild

public void addChild(java.awt.Component component,
                     java.lang.Object constraints)
              throws org.apache.commons.jelly.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:
org.apache.commons.jelly.JellyTagException

convertToClass

protected java.lang.Class convertToClass(java.lang.Object classObject)
                                  throws org.apache.commons.jelly.MissingAttributeException,
                                         java.lang.ClassNotFoundException
A class may be specified otherwise the Factory will be used.

Parameters:
classObject - the object to be converted
Throws:
org.apache.commons.jelly.MissingAttributeException
java.lang.ClassNotFoundException

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
A class may be specified otherwise the Factory will be used.

Throws:
org.apache.commons.jelly.JellyTagException

setBeanProperties

protected void setBeanProperties(java.lang.Object bean,
                                 java.util.Map attributes)
                          throws org.apache.commons.jelly.JellyTagException
Throws:
org.apache.commons.jelly.JellyTagException

findAncestorWithClass

public static org.apache.commons.jelly.Tag findAncestorWithClass(org.apache.commons.jelly.Tag from,
                                                                 java.lang.Class tagClass,
                                                                 org.apache.commons.jelly.Tag parent)


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