Package com.uc4.api
Class FormItemList
java.lang.Object
com.uc4.api.AbstractFormItem
com.uc4.api.FormItemList
This class is used for fields which contain a list of predefined values.
-
Constructor Summary
ConstructorsConstructorDescriptionFormItemList
(Element textElement) Constructs aFormItemList
from the specified XML element. -
Method Summary
Modifier and TypeMethodDescriptionReturn the map of Command Parameters in case command is true, else returns an empty map.protected int
getValue()
Returns the current value.boolean
isList()
Returnstrue
if this form item is a list.boolean
Returnstrue
if the a new value can be defined.iterator()
Returns an iterator over the predefined values.int
listSize()
Returns the number of values in this list.protected void
setSelectionIndex
(int selectionIndex) void
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FormItemList
Constructs aFormItemList
from the specified XML element.- Parameters:
textElement
- XML element
-
-
Method Details
-
getSelectionIndex
protected int getSelectionIndex() -
setSelectionIndex
protected void setSelectionIndex(int selectionIndex) -
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
Returns an iterator over the predefined values. Each value is ajava.lang.String
. -
listSize
public int listSize()Returns the number of values in this list.- Returns:
- Number of values in this list
-
setValue
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
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.
-