|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.ComponentTag
public class ComponentTag
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.
This tag clears the reference to it's bean after doTag runs. This means that child tags can access the component (bean) normally during execution but should not hold a reference to this tag after their doTag completes.
Field Summary | |
---|---|
private org.apache.commons.jelly.XMLOutput |
currentOutput
|
private static DebugGraphicsConverter |
debugGraphicsConverter
This is a converter that might normally be used through the BeanUtils product. |
private Factory |
factory
the factory of widgets |
private static org.apache.commons.logging.Log |
log
The Log to which logging calls will be made. |
private java.lang.String |
tagName
|
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 void |
clearBean()
Sets the bean to null, to prevent it from sticking around in the event that this tag instance is cached. |
protected java.lang.Class |
convertToClass(java.lang.Object classObject)
A class may be specified otherwise the Factory will be used. |
void |
doTag(org.apache.commons.jelly.XMLOutput output)
Overrides the default UseBean functionality to clear the bean after the tag runs. |
void |
doTag(org.apache.commons.jelly.XMLOutput output,
boolean resetBean)
|
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 |
rerun()
Runs the body of this script again after clearing the content of this component. |
void |
setAction(javax.swing.Action action)
Sets the Action of this component |
protected void |
setBeanProperties(java.lang.Object bean,
java.util.Map attributes)
Handles 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 |
void |
setTagName(java.lang.String name)
Puts this tag into the context under the given name allowing later calls to rerun() . |
java.lang.String |
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 |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static final DebugGraphicsConverter debugGraphicsConverter
private Factory factory
private java.lang.String tagName
private org.apache.commons.jelly.XMLOutput currentOutput
Constructor Detail |
---|
public ComponentTag()
public ComponentTag(Factory factory)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void setAction(javax.swing.Action action) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void setFont(java.awt.Font font) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void setBorder(javax.swing.border.Border border) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void setLayout(java.awt.LayoutManager layout) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void setTagName(java.lang.String name)
rerun()
.
For example, it makes sense to use ${myTag.rerun()} as a child
of an action
element.
the
- name to be usedpublic void rerun() throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
- if anythingpublic void addWindowListener(java.awt.event.WindowListener listener) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void addFocusListener(java.awt.event.FocusListener listener) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public void addKeyListener(java.awt.event.KeyListener listener) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
public java.awt.Component getComponent()
public void addChild(java.awt.Component component, java.lang.Object constraints) throws org.apache.commons.jelly.JellyTagException
addChild
in interface ContainerTag
org.apache.commons.jelly.JellyTagException
protected java.lang.Class convertToClass(java.lang.Object classObject) throws org.apache.commons.jelly.MissingAttributeException, java.lang.ClassNotFoundException
convertToClass
in class org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.MissingAttributeException
java.lang.ClassNotFoundException
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
newInstance
in class org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.JellyTagException
protected void processBean(java.lang.String var, java.lang.Object bean) throws org.apache.commons.jelly.JellyTagException
processBean
in class org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.JellyTagException
protected void setBeanProperties(java.lang.Object bean, java.util.Map attributes) throws org.apache.commons.jelly.JellyTagException
setBeanProperties
in class org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.JellyTagException
protected java.lang.Object getConstraint()
public void doTag(org.apache.commons.jelly.XMLOutput output) throws org.apache.commons.jelly.JellyTagException
doTag
in interface org.apache.commons.jelly.Tag
doTag
in class org.apache.commons.jelly.tags.core.UseBeanTag
org.apache.commons.jelly.JellyTagException
Tag.doTag(org.apache.commons.jelly.XMLOutput)
public void doTag(org.apache.commons.jelly.XMLOutput output, boolean resetBean) throws org.apache.commons.jelly.JellyTagException
org.apache.commons.jelly.JellyTagException
protected void clearBean()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |