Class MenuBarTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.action.tags.MenuBarTag
-
- All Implemented Interfaces:
ActionContainer
,ConditionalTag
,org.apache.commons.jelly.Tag
public class MenuBarTag extends FormBaseTag implements ActionContainer
A tag handler class for creating menu bars.
This tag handler class uses the current
ActionManager
object to create a menu bar. This menu bar will be stored in the Jelly context under the specified name. It can be accessed by other tags creating components that support menu bars (e.g. frames or dialogs). In the tag's body an arbitrary number ofMenuTag
tags can occur defining the menu bar's content.The following table lists all supported attributes:
Attribute Description Optional name The name under which the menu bar is stored in the Jelly context. no - Version:
- $Id: MenuBarTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description MenuBarTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSeparator()
Adds a separator to this container.protected ActionBuilder
getActionBuilder()
Returns a reference to the currentActionBuilder
instance.protected ActionManager
getActionManager()
Convenience method for obtaining a reference to the currentActionManager
.Object
getContainer()
Returns the menu bar container.String
getName()
Returns the name of this menu bar.protected void
process()
Executes this tag.protected void
processBeforeBody()
Executes this tag before its body was processed.void
setName(String name)
Setter method for the name attribute.-
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
-
getName
public String getName()
Returns the name of this menu bar.- Returns:
- the name
-
setName
public void setName(String name)
Setter method for the name attribute.- Parameters:
name
- the attribute value
-
processBeforeBody
protected void processBeforeBody() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Executes this tag before its body was processed. Here the menu bar will be created and stored in an internal field.- Overrides:
processBeforeBody
in classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is not correctly usedFormBuilderException
- if an error occurs
-
process
protected void process() throws org.apache.commons.jelly.JellyTagException, FormBuilderException
Executes this tag. This implementation stores the fully initialized menu bar in the Jelly context.- Specified by:
process
in classFormBaseTag
- Throws:
org.apache.commons.jelly.JellyTagException
- if the tag is not correctly usedFormBuilderException
- if an error occurs
-
getContainer
public Object getContainer()
Returns the menu bar container.- Specified by:
getContainer
in interfaceActionContainer
- Returns:
- the menu bar
-
addSeparator
public void addSeparator()
Adds a separator to this container. This will throw an exception because menu bars do not support separators.- Specified by:
addSeparator
in interfaceActionContainer
-
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
-
-