Class 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 of MenuTag 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 Detail

      • MenuBarTag

        public MenuBarTag()
    • 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 class FormBaseTag
        Throws:
        org.apache.commons.jelly.JellyTagException - if the tag is not correctly used
        FormBuilderException - 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 class FormBaseTag
        Throws:
        org.apache.commons.jelly.JellyTagException - if the tag is not correctly used
        FormBuilderException - if an error occurs
      • 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 interface ActionContainer
      • getActionBuilder

        protected ActionBuilder getActionBuilder()
        Returns a reference to the current ActionBuilder 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 current ActionManager.
        Returns:
        the current action manager