Class EventListenerTypeTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.EventListenerTypeTag
-
- All Implemented Interfaces:
ConditionalTag,org.apache.commons.jelly.Tag
public class EventListenerTypeTag extends FormBaseTag
A specialized tag handler implementation that allows adding another event listener type to a
FormEventListenerTag.Per default, tags derived from
FormEventListenerTagsupport only a single event listener interface. The tag implemented by this handler class can be placed in the body of aFormEventListenerTagto add another listener interface. The event listener produced by the outer tag will then support this new listener interface, too. This is useful if multiple event types fired by a component should be mapped to a single action.This tag handler class can deal with both standard and non-standard events. For non-standard events the class of the event listener interface must be specified. The following attributes are supported:
Attribute Description Optional type Defines the name of the event listener type. This can be the name of a standard type (e.g. change or mouse - case is irrelevant) or a non-standard type. In the latter case the naming conventions used by the FormEventManagerclass apply.No listenerClass Here the class of the event listener interface can be provided. This is only needed for non-standard listener types. If the typeattribute contains the name of a standard event type, this attribute is ignored.Yes The following example shows how this tag can be used to add an additional tree expansion listener to a change listener for a tree:
<f:tree name="myTree" model="myTreeModel"> <a:changeListener actionName="myAction"> <a:listenerType type="Expansion" listenerClass="net.sf.jguiraffe.gui.builder.components.model.TreeExpansionLitener"/> </a:changeListener> </f:tree>- Version:
- $Id: EventListenerTypeTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description EventListenerTypeTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetListenerClass()Returns the event listener class as an object.StringgetType()Returns the event listener type as a string.protected voidprocess()Executes this tag.voidsetListenerClass(Object listenerClass)Set method of thelistenerClassattribute.voidsetType(String type)Set method of thetypeattribute.-
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, processBeforeBody, 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
-
getType
public String getType()
Returns the event listener type as a string.- Returns:
- the event listener type
-
setType
public void setType(String type)
Set method of thetypeattribute.- Parameters:
type- the attribute's value
-
getListenerClass
public Object getListenerClass()
Returns the event listener class as an object. This attribute accepts either a class object or the fully-qualified name of a class.- Returns:
- the event listener class
-
setListenerClass
public void setListenerClass(Object listenerClass)
Set method of thelistenerClassattribute.- Parameters:
listenerClass- the attribute's value
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException, FormBuilderExceptionExecutes this tag. This implementation checks whether the tag is contained in the body of aFormEventListenerTag. If this is the case, an additional event listener type is added to the parent tag. Otherwise, an exception is thrown.- Specified by:
processin classFormBaseTag- Throws:
org.apache.commons.jelly.JellyTagException- if the tag is used incorrectlyFormBuilderException- if an error occurs
-
-