Class TabTag

  • All Implemented Interfaces:
    Composite, ConditionalTag, IconSupport, org.apache.commons.jelly.Tag

    public class TabTag
    extends ContainerTag
    implements IconSupport

    A tag handler class for creating register tab pages of a tabbed pane.

    Instances of this class can be placed in the body of a TabbedPaneTag. Each tag defines exactly one tab page. For this purpose a bunch of attributes can be used:

    Attribute Description Optional
    title Defines the title of this register as a string constant. Yes
    titleres Defines the title of this register as a resource ID. Yes
    resgrp Defines the resource group for resolving resource IDs. This attribute is only evaluated if one of the other text attributes is specified using a resource ID. In this case the corresponding resource group is obtained from this value. If no resource group is specified, the default resource group will be used. Yes
    tooltip Allows to specify a tool tip for this register. Yes
    tooltipres Allows to specify a tool tip for this register as a resource ID. Yes
    mnemonic With this attribute a mnemonic key can be defined for this register. Yes
    mnemonicres Allows to specifiy a mnemonic key that is obtained from a resource. Yes

    In addition to these attributes in the body of this tag an IconTag can be placed to define an icon for the register to create.

    The content of the register is defined by a component that must also be defined in the tag's body. This is done by placing one of the component tags in this tag's body. Note that only a single component is supported. If multiple components are necessary, they must be placed inside a container tag, e.g. a PanelTag.

    Version:
    $Id: TabTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • TabTag

        public TabTag()
        Creates a new instance of TabTag.
    • Method Detail

      • setTitle

        public void setTitle​(String v)
        Set method for the title attribute.
        Parameters:
        v - the attribute's value
      • setTitleres

        public void setTitleres​(String v)
        Set method for the titleres attribute.
        Parameters:
        v - the attribute's value
      • setResgrp

        public void setResgrp​(String v)
        Set method for the titlegrp attribute.
        Parameters:
        v - the attribute's value
      • setTooltip

        public void setTooltip​(String v)
        Set method for the tooltip attribute.
        Overrides:
        setTooltip in class ComponentBaseTag
        Parameters:
        v - the attribute's value
      • setTooltipres

        public void setTooltipres​(String v)
        Set method for the tooltipres attribute.
        Overrides:
        setTooltipres in class ComponentBaseTag
        Parameters:
        v - the attribute's value
      • setMnemonic

        public void setMnemonic​(String v)
        Set method for the mnemonic attribute.
        Parameters:
        v - the attribute's value
      • setMnemonicres

        public void setMnemonicres​(String v)
        Set method for the mnemonicres attribute.
        Parameters:
        v - the attribute's value
      • setIcon

        public void setIcon​(Object icon)
        Allows to set an icon for this tab. This method will be called by nested IconTag tags.
        Specified by:
        setIcon in interface IconSupport
        Parameters:
        icon - the icon for this tab
      • createContainer

        protected Object createContainer​(ComponentManager manager,
                                         boolean create,
                                         Collection<Object[]> components)
                                  throws FormBuilderException,
                                         org.apache.commons.jelly.MissingAttributeException
        Creates the container object. This implementation is a bit different: It will create an instance of the TabData inner class of TabbedPaneTag. This TabData object will be initialized with the component object that was added to this container tag (only one or zero child elements are allowed). This causes the data object to be added to the enclosing TabbedPaneTag tag.
        Specified by:
        createContainer in class ContainerTag
        Parameters:
        manager - the component manager
        create - the create flag
        components - a collection with the child elements of this container
        Returns:
        the container object
        Throws:
        FormBuilderException - if the tag is not correctly used
        org.apache.commons.jelly.MissingAttributeException - if a required attribute is missing
      • addComponents

        protected void addComponents​(ComponentManager manager,
                                     Object container,
                                     Collection<Object[]> comps)
        Adds the child elements to the represented container. For this specific tag this is not needed because the children are already processed in the createContainer() method. So this is just a dummy.
        Overrides:
        addComponents in class ContainerTag
        Parameters:
        manager - the component manager
        container - the newly created container object
        comps - a collection with the child elements