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
ActionManagerobject 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 ofMenuTagtags 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 voidaddSeparator()Adds a separator to this container.protected ActionBuildergetActionBuilder()Returns a reference to the currentActionBuilderinstance.protected ActionManagergetActionManager()Convenience method for obtaining a reference to the currentActionManager.ObjectgetContainer()Returns the menu bar container.StringgetName()Returns the name of this menu bar.protected voidprocess()Executes this tag.protected voidprocessBeforeBody()Executes this tag before its body was processed.voidsetName(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, FormBuilderExceptionExecutes this tag before its body was processed. Here the menu bar will be created and stored in an internal field.- Overrides:
processBeforeBodyin 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, FormBuilderExceptionExecutes this tag. This implementation stores the fully initialized menu bar in the Jelly context.- Specified by:
processin 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:
getContainerin 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:
addSeparatorin interfaceActionContainer
-
getActionBuilder
protected ActionBuilder getActionBuilder()
Returns a reference to the currentActionBuilderinstance. 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
-
-