Package com.uc4.api
Class FormItemList
- java.lang.Object
-
- com.uc4.api.AbstractFormItem
-
- com.uc4.api.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 aFormItemList
from the specified XML element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected int
getSelectionIndex()
java.lang.String
getValue()
Returns the current value.boolean
isList()
Returnstrue
if this form item is a list.boolean
isOverwrite()
Returnstrue
if the a new value can be defined.java.util.Iterator<java.lang.String>
iterator()
Returns an iterator over the predefined values.int
listSize()
Returns the number of values in this list.protected void
setSelectionIndex(int selectionIndex)
void
setValue(java.lang.String value)
Sets a new value for this field.-
Methods inherited from class com.uc4.api.AbstractFormItem
getId, getLabel, isFixed, isLabel, isNewLine, isNumber, isRequired, isText, isUppercase, isValid
-
-
-
-
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.
-
isList
public boolean isList()
Description copied from interface:IFormItem
Returnstrue
if this form item is a list. A cast toFormItemList
can be done if this method returnstrue
.- Specified by:
isList
in interfaceIFormItem
- Overrides:
isList
in classAbstractFormItem
- Returns:
- Boolean indicating if this item is a list
-
isOverwrite
public boolean isOverwrite()
Returnstrue
if the a new value can be defined. If the method returnsfalse
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 ajava.lang.String
.- Specified by:
iterator
in interfacejava.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.
-
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.
-
-