Package com.uc4.api

Class FormItemList

All Implemented Interfaces:
IFormItem, Iterable<String>

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

    • FormItemList

      public FormItemList(Element textElement)
      Constructs a FormItemList from the specified XML element.
      Parameters:
      textElement - XML element
  • Method Details

    • getSelectionIndex

      protected int getSelectionIndex()
    • setSelectionIndex

      protected void setSelectionIndex(int selectionIndex)
    • getValue

      public 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 Iterator<String> iterator()
      Returns an iterator over the predefined values. Each value is a java.lang.String.
      Specified by:
      iterator in interface Iterable<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(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 Map<String,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.