Package com.uc4.api

Class FormItemList

  • All Implemented Interfaces:
    IFormItem, java.lang.Iterable<java.lang.String>

    public class FormItemList
    extends AbstractFormItem
    implements java.lang.Iterable<java.lang.String>
    This class is used for fields which contain a list of predefined values.
    • Constructor Summary

      Constructors 
      Constructor Description
      FormItemList​(org.w3c.dom.Element textElement)
      Constructs a FormItemList from the specified XML element.
    • Constructor Detail

      • FormItemList

        public FormItemList​(org.w3c.dom.Element textElement)
        Constructs a FormItemList from the specified XML element.
        Parameters:
        textElement - XML element
    • Method Detail

      • getSelectionIndex

        protected int getSelectionIndex()
      • setSelectionIndex

        protected void setSelectionIndex​(int selectionIndex)
      • getValue

        public java.lang.String getValue()
        Description copied from interface: IFormItem
        Returns the current value. If a default value is set this method can be used to read the default value.
        Specified by:
        getValue in interface IFormItem
        Returns:
        Value of this field
      • isList

        public boolean isList()
        Description copied from interface: IFormItem
        Returns true if this form item is a list. A cast to FormItemList can be done if this method returns true.
        Specified by:
        isList in interface IFormItem
        Overrides:
        isList in class AbstractFormItem
        Returns:
        Boolean indicating if this item is a list
      • isOverwrite

        public boolean isOverwrite()
        Returns true if the a new value can be defined. If the method returns false only one of the predefined values is allowed.
        Returns:
        Boolean which is set to true if a new value can be defined
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Returns an iterator over the predefined values. Each value is a java.lang.String.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
        Returns:
        Iterator over selectable values
      • listSize

        public int listSize()
        Returns the number of values in this list.
        Returns:
        Number of values in this list
      • setValue

        public void setValue​(java.lang.String value)
        Description copied from interface: IFormItem
        Sets a new value for this field. This method can throw an exception if the input is not valid.
        Specified by:
        setValue in interface IFormItem
        Parameters:
        value - New value
      • getCommandParameters

        public java.util.Map<java.lang.String,​java.lang.String> getCommandParameters()
        Return the map of Command Parameters in case command is true, else returns an empty map. This is useful when the XML do not gets the list of values needed instead gets the parameters for a new XRequest. Example: Combo box for Agent/Host types.
        Returns:
        Command parameter map.