Class PopupHandlerTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- org.apache.commons.jelly.DynaTagSupport
-
- org.apache.commons.jelly.MapTagSupport
-
- org.apache.commons.jelly.tags.core.UseBeanTag
-
- net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.PopupHandlerTag
-
- All Implemented Interfaces:
ConditionalTag
,PropertySupport
,org.apache.commons.jelly.DynaTag
,org.apache.commons.jelly.impl.BeanSource
,org.apache.commons.jelly.Tag
public class PopupHandlerTag extends UseBeanBaseTag
A tag handler class that allows registering a handler for a popup menu at a component.
Tags of this type can be placed in the body of arbitrary component tags (i.e. tags derived from
). They fetch theComponentBaseTag
specified by the attributes and call thePopupMenuHandler
'sActionManager
method. (Implementation note: This is done at the end of the builder operation because it cannot be guaranteed that the component is fully initialized at an earlier point of time.)ActionManager#registerPopupMenuHandler(Object, PopupMenuHandler)
By inheriting from
the typical ways of defining beans are available; especially the dependency injection framework can be used. Refer to the documentation of the base class for a full list of supported configuration options.UseBeanBaseTag
The following example fragment shows how this tag can be used for assigning a context menu to a tree component. We expect that the bean for the context menu handler is defined somewhere else:
<f:tree name="myTree" model="treeModel"> <a:popup beanName="myPopupHandler"/> </f:tree>
- Version:
- $Id: PopupHandlerTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Field Summary
-
Fields inherited from class net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
ATTR_BEAN_CLASS, ATTR_BEAN_NAME, ATTR_CLASS, ATTR_IF_NAME, ATTR_REF, ATTR_UNLESS_NAME, ATTR_VAR
-
-
Constructor Summary
Constructors Constructor Description PopupHandlerTag()
Creates a new instance ofPopupHandlerTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComponentBuilderCallBack
createCallBack(ComponentBaseTag componentTag, PopupMenuHandler handler)
Creates the call back object for actually registering the popup menu handler.protected boolean
passResults(Object bean)
Processes the bean managed by this tag.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.UseBeanBaseTag
addIgnoreProperties, doTag, fetchBean, getAdditionalProperties, getAttributeStr, getBaseClass, getIfName, getUnlessName, isOptional, processBean, setBaseClass, setProperty, useExistingBean
-
Methods inherited from class org.apache.commons.jelly.tags.core.UseBeanTag
addIgnoreProperty, convertToClass, getBean, getDefaultClass, getIgnorePropertySet, isIgnoreUnknownProperties, loadClass, newInstance, setBean, setBeanProperties, setIgnoreUnknownProperties, validateBeanProperties
-
Methods inherited from class org.apache.commons.jelly.MapTagSupport
createAttributes, getAttributes, setAttribute
-
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
-
passResults
protected boolean passResults(Object bean) throws org.apache.commons.jelly.JellyTagException
Processes the bean managed by this tag. This implementation checks whether the parent tag is derived from
. If this is the case, a call back object will be created, which registers the handler bean at the component managed by the parent tag.ComponentBaseTag
- Overrides:
passResults
in classUseBeanBaseTag
- Parameters:
bean
- the menu handler bean- Returns:
- a flag whether the bean could be processed
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is incorrectly used
-
createCallBack
protected ComponentBuilderCallBack createCallBack(ComponentBaseTag componentTag, PopupMenuHandler handler)
Creates the call back object for actually registering the popup menu handler. This object will be added at the
object to be invoked at the end of the builder operation.ComponentBuilderData
- Parameters:
componentTag
- the parent component tag managing the component where to register the handlerhandler
- the handler- Returns:
- the call back, which performs the registration
-
-