Class WindowListenerTag
- 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.window.tags.WindowListenerTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
public class WindowListenerTag extends EventListenerTag
A specialized event listener tag that can be used to register window listeners.
With this tag it is possible to link events triggered by a window to an action. The name of the action to be invoked must be specified as parameter. Optionally an event filter can be specified; the action is then only invoked if the window event is matched by the filter. There are no additional attributes other than the ones defined by the base class.
Tags of this type must be nested inside a window tag or alternatively specify the
targetBean
attribute. The listener is registered at the window created by this window tag or at the target bean.- Version:
- $Id: WindowListenerTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description WindowListenerTag()
Creates a new instance ofWindowListenerTag
.
-
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 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
-
-
-
-
Method Detail
-
registerListener
protected boolean registerListener(EventListener listener) throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Registers the event listener. This method is called during execution of this tag with the listener object created by theEventListenerTag.createEventListener()
method. Its task is to perform tag-specific listener registration (this base class already takes about registration of the event listener at a bean that may be specified using thetargetBean
attribute). The return value indicates whether a registration was possible. If it is false and notargetBean
attribute is defined, tag execution throws an exception because no target could be determined. This implementation checks whether this tag is nested inside aWindowBaseTag
. If this is the case, the window created by this tag is obtained, and the listener is registered at this window.- Specified by:
registerListener
in classEventListenerTag
- Parameters:
listener
- the listener to be registered- Returns:
- a flag whether registration was successful
- Throws:
org.apache.commons.jelly.JellyTagException
- if an error occursFormBuilderException
- if the tag is incorrectly used
-
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
-
-