Class SimpleComponentTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.ComponentBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.SimpleComponentTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
- Direct Known Subclasses:
ContainerTag
,TextIconTag
,ToolbarTag
public abstract class SimpleComponentTag extends ComponentBaseTag
An abstract base class for tags that create simple GUI components.
This base class is intended to be used for components that are not inserted into a
Form
object. Derived tag classes create a component of a specific type. This class ensures that the new component is added to the next enclosing container element.Simple GUI component can be assigned a name using the
name
attribute. If this is done, they are stored in the component store of the current builder operation. This makes it possible to obtain aWidgetHandler
and manipulate some of their properties later.- Version:
- $Id: SimpleComponentTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description SimpleComponentTag()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Object
createComponent(ComponentManager manager, boolean create)
Creates a specific component.Object
getComponent()
Returns the component that was created by this tag.protected void
process()
Executes this tag.protected void
processBeforeBody()
Callback before processing of the tag's body.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ComponentBaseTag
getBackColor, getBackgroundColor, getConstraints, getFont, getFontRef, getForeColor, getForegroundColor, getName, getToolTipData, insertComponent, setBackColor, setConstraints, setFont, setFontRef, setForeColor, setName, setTooltip, setTooltipres, setTooltipresgrp
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
canProcess, canProcess, convertToClass, convertToNumberWithUnit, convertToNumberWithUnit, doTag, findContainer, getBuilderData, getBuilderData, getIfName, getResourceText, getResourceText, getUnlessName, setIfName, setUnlessName
-
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
-
-
-
-
Method Detail
-
getComponent
public Object getComponent()
Returns the component that was created by this tag.- Specified by:
getComponent
in classComponentBaseTag
- Returns:
- the component created by this tag
-
processBeforeBody
protected void processBeforeBody() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Callback before processing of the tag's body. Calls#createComponent(ComponentManager)
for the first time with thecreate
parameter set to true.- Overrides:
processBeforeBody
in classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if a script related error occursFormBuilderException
- if an error occurs
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Executes this tag. Calls
for the second time with the boolean parameter#createComponent(ComponentManager)
create
set to false . The new component is then added to the nesting container element.- Overrides:
process
in classComponentBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if a script related error occursFormBuilderException
- if an error occurs
-
createComponent
protected abstract Object createComponent(ComponentManager manager, boolean create) throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Creates a specific component. This method must be implemented in derived classes. An implementation may use the passed in component manager to create an instance of a concrete GUI widget class. Note that this method is called twice during execution of this tag: Once before the tag's body is processed and once after that. The boolean argument can be used to distinguish between the two phases. This allows concrete implementations of theComponentManager
interface to use various strategies for creating a component hierarchy.- Parameters:
manager
- the component managercreate
- a flag whether the component should be newly created- Returns:
- the new GUI component
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is incorrectly usedFormBuilderException
- if an error occurs creating the component
-
-