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 aFormItemListfrom 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 intgetSelectionIndex()java.lang.StringgetValue()Returns the current value.booleanisList()Returnstrueif this form item is a list.booleanisOverwrite()Returnstrueif the a new value can be defined.java.util.Iterator<java.lang.String>iterator()Returns an iterator over the predefined values.intlistSize()Returns the number of values in this list.protected voidsetSelectionIndex(int selectionIndex)voidsetValue(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:IFormItemReturns 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:IFormItemReturnstrueif this form item is a list. A cast toFormItemListcan be done if this method returnstrue.- Specified by:
isListin interfaceIFormItem- Overrides:
isListin classAbstractFormItem- Returns:
- Boolean indicating if this item is a list
-
isOverwrite
public boolean isOverwrite()
Returnstrueif the a new value can be defined. If the method returnsfalseonly 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:
iteratorin 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:IFormItemSets 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.
-
-