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

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

public class ComponentTag
extends org.apache.commons.jelly.tags.core.UseBeanTag
implements ContainerTag

This tag creates a Swing component and adds it to its parent tag, optionally declaring this component as a variable if the var attribute is specified.

Version:
$Revision: 1.7 $
Author:
James Strachan

Field Summary
private  Factory factory
          the factory of widgets
private static org.apache.commons.logging.Log log
          The Log to which logging calls will be made.
 
Fields inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
 
Fields inherited from class org.apache.commons.jelly.MapTagSupport
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ComponentTag()
           
ComponentTag(Factory factory)
           
 
Method Summary
 void addChild(java.awt.Component component, java.lang.Object constraints)
          Adds a child component to this parent
 void addFocusListener(java.awt.event.FocusListener listener)
          Adds a FocusListener to this component
 void addKeyListener(java.awt.event.KeyListener listener)
          Adds a KeyListener to this component
 void addWindowListener(java.awt.event.WindowListener listener)
          Adds a WindowListener to this component
protected  java.lang.Class convertToClass(java.lang.Object classObject)
          A class may be specified otherwise the Factory will be used.
 java.awt.Component getComponent()
           
protected  java.lang.Object getConstraint()
           
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 processBean(java.lang.String var, java.lang.Object bean)
          Either defines a variable or adds the current component to the parent
 void setAction(javax.swing.Action action)
          Sets the Action of this component
protected  void setBeanProperties(java.lang.Object bean, java.util.Map attributes)
          Patch to handle wierd properties that don't quite match the Java Beans contract
 void setBorder(javax.swing.border.Border border)
          Sets the Border of this component
 void setFont(java.awt.Font font)
          Sets the Font of this component
 void setLayout(java.awt.LayoutManager layout)
          Sets the LayoutManager of this component
 java.lang.String toString()
           
 
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
doTag, getBean, getDefaultClass, loadClass, 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, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The Log to which logging calls will be made.


factory

private Factory factory
the factory of widgets

Constructor Detail

ComponentTag

public ComponentTag()

ComponentTag

public ComponentTag(Factory factory)
Method Detail

toString

public java.lang.String toString()

setAction

public void setAction(javax.swing.Action action)
               throws org.apache.commons.jelly.JellyTagException
Sets the Action of this component

Throws:
org.apache.commons.jelly.JellyTagException

setFont

public void setFont(java.awt.Font font)
             throws org.apache.commons.jelly.JellyTagException
Sets the Font of this component

Throws:
org.apache.commons.jelly.JellyTagException

setBorder

public void setBorder(javax.swing.border.Border border)
               throws org.apache.commons.jelly.JellyTagException
Sets the Border of this component

Throws:
org.apache.commons.jelly.JellyTagException

setLayout

public void setLayout(java.awt.LayoutManager layout)
               throws org.apache.commons.jelly.JellyTagException
Sets the LayoutManager of this component

Throws:
org.apache.commons.jelly.JellyTagException

addWindowListener

public void addWindowListener(java.awt.event.WindowListener listener)
Adds a WindowListener to this component


addFocusListener

public void addFocusListener(java.awt.event.FocusListener listener)
Adds a FocusListener to this component


addKeyListener

public void addKeyListener(java.awt.event.KeyListener listener)
Adds a KeyListener to this component


getComponent

public java.awt.Component getComponent()
Returns:
the visible component, if there is one.

addChild

public void addChild(java.awt.Component component,
                     java.lang.Object constraints)
Adds a child component to this parent

Specified by:
addChild in interface ContainerTag

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.

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

processBean

protected void processBean(java.lang.String var,
                           java.lang.Object bean)
                    throws org.apache.commons.jelly.JellyTagException
Either defines a variable or adds the current component to the parent

Throws:
org.apache.commons.jelly.JellyTagException

setBeanProperties

protected void setBeanProperties(java.lang.Object bean,
                                 java.util.Map attributes)
                          throws org.apache.commons.jelly.JellyTagException
Patch to handle wierd properties that don't quite match the Java Beans contract

Throws:
org.apache.commons.jelly.JellyTagException

getConstraint

protected java.lang.Object getConstraint()