Class PanelTag

  • 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.

    yes
    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.
    textres 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 the borderref 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 Detail

      • PanelTag

        public PanelTag()
        Creates a new instance of PanelTag.
    • 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 class ContainerTag
        Parameters:
        manager - the manager
        create - the create flag
        components - a collection with the container's children
        Returns:
        the newly created container
        Throws:
        FormBuilderException - if an error occurs
        org.apache.commons.jelly.JellyTagException - if the tag is used incorrectly