Class PanelTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- All Implemented Interfaces:
Composite
,ConditionalTag
,org.apache.commons.jelly.Tag
public class PanelTag extends ContainerTag
A specific container tag implementation that creates a panel.
This container tag will create the most simple container. The following table lists the attributes that are provided in addition to the ones supported for simple components.
Attribute Description Optional text Defines a text for the panel. This text will be displayed as a caption over the elements that are contained in the panel. yestextres Allows to specify the panel's text as a resource. yes resgrp Allows to define a special resource group for resolving the text resource. If undefined, the default resource group for the form builder will be used. yes textColor With this attribute a color for the text can be set. It allows color definitions in a format supported by the ColorHelper
class. Note that not all builder implementations may support a colored title text.yes textFontRef This attribute can be used to define the font for the panel's text. A font with this name must exist in the Jelly context. Note that not all builder implementations will support a font for the panel's text. yes border This is a boolean attribute that allows to draw a border around the panel. Note that if a text is specified, a border will always be drawn. yes borderref If the border
attribute is set to true or a text is defined, a default border will be painted for this panel. There are some GUI libraries (especially Swing), which support a rich set of different border types. To allow an application to make use of this specific borders theborderref
attribute can be set to the name of a border object that has been placed in the Jelly context. A builder implementation that supports this mechanism will then retrieve this specified border and use it.yes - Version:
- $Id: PanelTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description PanelTag()
Creates a new instance ofPanelTag
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
createContainer(ComponentManager manager, boolean create, Collection<Object[]> components)
Creates the concrete container widget.String
getBorderref()
Returns the name of a predefined border to use.Color
getColor()
Returns the color for the title text.TextData
getTextData()
Returns the text data object for this tag.Object
getTitleFont()
Returns the font for the panel's text (the title).boolean
isBorder()
Returns a flag whether this panel should have a border.void
setBorder(boolean border)
Setter method of the border attribute.void
setBorderref(String borderref)
Setter method of the borderref attribute.void
setResgrp(String s)
Setter method for the resgrp attribute.void
setText(String s)
Setter method for the text attribute.void
setTextColor(String textColor)
Setter method of the textColor attribute.void
setTextFontRef(String textFontRef)
Setter method of the textFontRef attribute.void
setTextres(String s)
Setter method for the textres attribute.void
setTitleFont(Object font)
Allows to specify the font for the panel's text (the title).-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.ContainerTag
addComponent, addComponents, 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, setTooltip, setTooltipres, 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
-
getTextData
public TextData getTextData()
Returns the text data object for this tag.- Returns:
- the text data for the panel's text
-
setText
public void setText(String s)
Setter method for the text attribute.- Parameters:
s
- the attribute value
-
setTextres
public void setTextres(String s)
Setter method for the textres attribute.- Parameters:
s
- the attribute value
-
setResgrp
public void setResgrp(String s)
Setter method for the resgrp attribute.- Parameters:
s
- the attribute value
-
isBorder
public boolean isBorder()
Returns a flag whether this panel should have a border.- Returns:
- the border flag
-
setBorder
public void setBorder(boolean border)
Setter method of the border attribute.- Parameters:
border
- the attribute value
-
getBorderref
public String getBorderref()
Returns the name of a predefined border to use.- Returns:
- a border reference in the Jelly context
-
setBorderref
public void setBorderref(String borderref)
Setter method of the borderref attribute.- Parameters:
borderref
- the attribute value
-
getTitleFont
public Object getTitleFont()
Returns the font for the panel's text (the title).- Returns:
- the font for the title
-
setTitleFont
public void setTitleFont(Object font)
Allows to specify the font for the panel's text (the title).- Parameters:
font
- the title font
-
getColor
public Color getColor()
Returns the color for the title text.- Returns:
- the text color
-
setTextColor
public void setTextColor(String textColor)
Setter method of the textColor attribute.- Parameters:
textColor
- the attribute value
-
setTextFontRef
public void setTextFontRef(String textFontRef)
Setter method of the textFontRef attribute.- Parameters:
textFontRef
- the attribute value
-
createContainer
protected Object createContainer(ComponentManager manager, boolean create, Collection<Object[]> components) throws FormBuilderException, org.apache.commons.jelly.JellyTagException
Creates the concrete container widget. This implementation creates a panel using the component manager object.- Specified by:
createContainer
in classContainerTag
- Parameters:
manager
- the managercreate
- the create flagcomponents
- a collection with the container's children- Returns:
- the newly created container
- Throws:
FormBuilderException
- if an error occursorg.apache.commons.jelly.JellyTagException
- if the tag is used incorrectly
-
-