Class FormEventListenerTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.EventListenerTag
-
- net.sf.jguiraffe.gui.builder.action.tags.FormEventListenerTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
- Direct Known Subclasses:
ActionListenerTag
,ChangeListenerTag
,FocusListenerTag
,MouseListenerTag
public class FormEventListenerTag extends EventListenerTag
A base class for event listener tag handler classes that deal with event listeners for form events.
This base class provides functionality for registering event listeners at input components (i.e. the typical form events like action events, focus events, or change events). It performs all necessary steps for locating the input component tag this tag is nested inside and registering the passed in listener object. Because the event listener can only be registered after the affected input component has been created, registration is performed by a
ComponentBuilderCallBack
object.By specifying
EventListenerTypeTag
objects in the body of this tag multiple event listeners for various event types can be added at once. This allows mapping an action to multiple event types. Concrete sub classes only have to provide the initial event listener type in the constructor call.This class can also be used directly as tag handler implementation. In this case there is no default event type. So
EventListenerTypeTag
tags must be placed in the body of this tag.- Version:
- $Id: FormEventListenerTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description FormEventListenerTag()
Creates a new instance ofFormEventListenerTag
.FormEventListenerTag(FormListenerType type)
Creates a new instance ofFormEventListenerTag
and sets the event listener type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ActionBuilder
getActionBuilder()
Returns a reference to the currentActionBuilder
instance.protected ActionManager
getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.protected boolean
registerListener(EventListener listener)
Registers the specified event listener.-
Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.EventListenerTag
addBeanRegistrationCallbacks, addComponentRegistrationCallbacks, addListenerType, addListenerType, createEventListener, createEventListener, fetchAction, fetchFilter, fetchListenerClasses, getActionName, getEventFilter, getTargetBean, getVar, process, processBeforeBody, setActionName, setEventFilter, setTargetBean, setVar
-
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
-
-
-
-
Constructor Detail
-
FormEventListenerTag
public FormEventListenerTag()
Creates a new instance ofFormEventListenerTag
. No event listener type is set. This has to be done by nested tags.
-
FormEventListenerTag
public FormEventListenerTag(FormListenerType type)
Creates a new instance ofFormEventListenerTag
and sets the event listener type.- Parameters:
type
- theFormListenerType
-
-
Method Detail
-
registerListener
protected boolean registerListener(EventListener listener) throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Registers the specified event listener. This implementation checks whether this tag is nested in anInputComponentTag
tag. If this is the case, the listener is registered at the component handler of this component.- Specified by:
registerListener
in classEventListenerTag
- Parameters:
listener
- the listener to be registered- Returns:
- a flag whether registration was possible
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is incorrectly usedFormBuilderException
- if a tag-related error occurs
-
getActionBuilder
protected ActionBuilder getActionBuilder()
Returns a reference to the currentActionBuilder
instance. This instance is expected to be placed in the Jelly context.- Returns:
- the current action builder
-
getActionManager
protected ActionManager getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.- Returns:
- the current action manager
-
-