Class ProgressBarTag

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

    public class ProgressBarTag
    extends InputComponentTag

    A special input component tag that defines a progress bar.

    A progress bar can be used to give the user a visual feedback about a longer lasting operation. This tag supports the typical properties of such a GUI element. The following tables displays the allowed attributes:

    Attribute Description Optional
    min Defines the minimum value of the progress bar. The default is set to 0. Yes
    max Defines the maximum value of the progress bar. The value can be set between the specified minimum and maximum values. If no maximum value is set, the default value 100 is used. Yes
    value With this attribute the current value of the progress bar can be set. Usually this property will be set during run time to display the progress of the associated operation. Yes
    allowText With this boolean property it can be determined whether the component should support a display text. If this is supported by the underlying GUI library (which may not be the case), the text will be displayed over the progress bar. The content of the text can be set using the text or textres attributes, or at runtime through the component handler. Yes
    text Defines the text of this component. This attribute has only effect if the allowText attribute is set to true. In this case the initial text can be set. Typically a text that corresponds to the current value (e.g. a percent label) will be set during runtime. Yes
    textres Allows to define the component's text as a resource identifier. Yes
    resgrp If the text of the component is specified using a resource identifier, with this attribute the corresponding resource group can be specified. If undefined, the application's default resource group will be used. Yes
    noField Though a progress bar is an input component, it is typically not used for gathering user input. Because of that it will no be added to a Form object per default. If this default behavior is not desired, this attribute must be manually set to false. Yes

    The component handler that will be created for this component is of type ProgressBarHandler. Through the methods defined in this interface the most important properties can be set at runtime.

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

      • ProgressBarTag

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

      • getMax

        public Integer getMax()
        Returns the maximum value of the progress bar.
        Returns:
        the maximum value
      • setMax

        public void setMax​(Integer max)
        Set method for the max attribute.
        Parameters:
        max - the attribute's value
      • getMin

        public Integer getMin()
        Returns the minimum value of the progress bar.
        Returns:
        the minimum value
      • setMin

        public void setMin​(Integer min)
        Set method for the min attribute.
        Parameters:
        min - the attribute's value
      • getValue

        public Integer getValue()
        Returns the current value of the progress bar.
        Returns:
        the current value
      • setValue

        public void setValue​(Integer value)
        Set method for the value attribute.
        Parameters:
        value - the attribute's value
      • getProgressTextData

        public TextData getProgressTextData()
        Returns the data object that defines the progress text of this progress bar.
        Returns:
        data about the progress text
      • setText

        public void setText​(String s)
        Set method for the text attribute.
        Parameters:
        s - the attribute's value
      • setTextres

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

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

        public boolean isAllowText()
        Returns a flag whether text is allowed for this progress bar.
        Returns:
        the text allowed flag
      • setAllowText

        public void setAllowText​(boolean allowText)
        Set method for the allowText attribute.
        Parameters:
        allowText - the attribute's value
      • createComponentHandler

        protected ComponentHandler<?> createComponentHandler​(ComponentManager manager,
                                                             boolean create)
                                                      throws FormBuilderException,
                                                             org.apache.commons.jelly.JellyTagException
        Creates a component handler for the represented component. This implementation will ask the specified component manager to create a handler for a progress bar.
        Specified by:
        createComponentHandler in class InputComponentTag
        Parameters:
        manager - the component manager
        create - the create flag
        Returns:
        the component handler for the newly created component
        Throws:
        FormBuilderException - if an error occurs
        org.apache.commons.jelly.JellyTagException - if the tag is incorrectly used