Class MenuItemTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.AbstractActionDataTag
-
- net.sf.jguiraffe.gui.builder.action.tags.ActionControlTag
-
- net.sf.jguiraffe.gui.builder.action.tags.MenuItemTag
-
- All Implemented Interfaces:
ActionData
,ConditionalTag
,IconSupport
,org.apache.commons.jelly.Tag
public class MenuItemTag extends ActionControlTag
A tag handler class that creates menu items.
With this tag class menu items can be created. The corresponding tags must be nested inside menu tags. A menu item can be defined either by referencing an action or by manually setting the corresponding attributes. Refer also to the documentation of the base class.
In addition to the attributes defined by the base class, this tag handler class does not support own attributes.
- Version:
- $Id: MenuItemTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description MenuItemTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createActionControl(ActionManager manager, FormAction action, Object parent)
Creates a menu item based on an action definition.protected ComponentHandler<?>
createElementHandler(ActionManager manager, ActionData data, Object parent)
Creates a menu item based on an action data object.protected ActionBuilder
getActionBuilder()
Returns a reference to the currentActionBuilder
instance.protected ActionManager
getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.protected Class<?>
getContainerClass()
Returns the container tag handler class this tag must be nested inside.-
Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.ActionControlTag
getActionName, getTask, isChecked, process, setActionName, setChecked
-
Methods inherited from class net.sf.jguiraffe.gui.builder.action.tags.AbstractActionDataTag
checkAttributes, getAccelerator, getAcceleratorDef, getAcceleratorRef, getIcon, getMnemonicKey, getName, getText, getToolTip, processBeforeBody, setAccelerator, setAcceleratorDef, setAcceleratorRef, setIcon, setMnemonic, setMnemonicres, setName, setResgrp, setText, setTextres, setTooltip, setTooltipres
-
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
-
getContainerClass
protected Class<?> getContainerClass()
Returns the container tag handler class this tag must be nested inside. This is theMenuTag
class.- Specified by:
getContainerClass
in classActionControlTag
- Returns:
- the nesting container class
-
createActionControl
protected void createActionControl(ActionManager manager, FormAction action, Object parent) throws FormActionException
Creates a menu item based on an action definition.- Specified by:
createActionControl
in classActionControlTag
- Parameters:
manager
- the action manageraction
- the actionparent
- the parent container (a menu)- Throws:
FormActionException
- if an error occurs
-
createElementHandler
protected ComponentHandler<?> createElementHandler(ActionManager manager, ActionData data, Object parent) throws FormActionException
Creates a menu item based on an action data object.- Specified by:
createElementHandler
in classActionControlTag
- Parameters:
manager
- the action managerdata
- the action data objectparent
- the parent container (a menu)- Returns:
- the component handler for the new menu item
- Throws:
FormActionException
- if an 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
-
-