Class TabTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- 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
. Each tag defines exactly one tab page. For this purpose a bunch of attributes can be used:TabbedPaneTag
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
can be placed to define an icon for the register to create.IconTag
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 Summary
Constructors Constructor Description TabTag()
Creates a new instance ofTabTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addComponents(ComponentManager manager, Object container, Collection<Object[]> comps)
Adds the child elements to the represented container.protected Object
createContainer(ComponentManager manager, boolean create, Collection<Object[]> components)
Creates the container object.void
setIcon(Object icon)
Allows to set an icon for this tab.void
setMnemonic(String v)
Set method for the mnemonic attribute.void
setMnemonicres(String v)
Set method for the mnemonicres attribute.void
setResgrp(String v)
Set method for the titlegrp attribute.void
setTitle(String v)
Set method for the title attribute.void
setTitleres(String v)
Set method for the titleres attribute.void
setTooltip(String v)
Set method for the tooltip attribute.void
setTooltipres(String v)
Set method for the tooltipres attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ContainerTag
addComponent, createComponent, getComposite, getContainer, getLayout, processBeforeBody, setComposite, setLayout
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.SimpleComponentTag
getComponent, process
-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ComponentBaseTag
getBackColor, getBackgroundColor, getConstraints, getFont, getFontRef, getForeColor, getForegroundColor, getName, getToolTipData, insertComponent, setBackColor, setConstraints, setFont, setFontRef, setForeColor, setName, setTooltipresgrp
-
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
-
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 classComponentBaseTag
- Parameters:
v
- the attribute's value
-
setTooltipres
public void setTooltipres(String v)
Set method for the tooltipres attribute.- Overrides:
setTooltipres
in classComponentBaseTag
- 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
tags.IconTag
- Specified by:
setIcon
in interfaceIconSupport
- 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 theTabData
inner class ofTabbedPaneTag
. ThisTabData
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 enclosingTabbedPaneTag
tag.- Specified by:
createContainer
in classContainerTag
- Parameters:
manager
- the component managercreate
- the create flagcomponents
- a collection with the child elements of this container- Returns:
- the container object
- Throws:
FormBuilderException
- if the tag is not correctly usedorg.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 thecreateContainer()
method. So this is just a dummy.- Overrides:
addComponents
in classContainerTag
- Parameters:
manager
- the component managercontainer
- the newly created container objectcomps
- a collection with the child elements
-
-