Package com.uc4.api.prompt
Class TextElement
java.lang.Object
com.uc4.api.objects.PromptElement
com.uc4.api.prompt.OnChangeResetElement
com.uc4.api.prompt.TextElement
- All Implemented Interfaces:
PromptInterfaces.Caption
,PromptInterfaces.DataReference
,PromptInterfaces.Focus
,PromptInterfaces.Locked
,PromptInterfaces.MultiSelect
,PromptInterfaces.QuoteCharacter
,PromptInterfaces.ValueRequired
,PromptInterfaces.XmlKey
,PromptInterfaces.XPath
public class TextElement
extends OnChangeResetElement
implements PromptInterfaces.Caption, PromptInterfaces.Focus, PromptInterfaces.MultiSelect, PromptInterfaces.XmlKey, PromptInterfaces.XPath, PromptInterfaces.ValueRequired, PromptInterfaces.QuoteCharacter, PromptInterfaces.Locked, PromptInterfaces.DataReference
A prompt element of type text.
-
Field Summary
Fields inherited from class com.uc4.api.objects.PromptElement
aliasMap, list, properties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the mulit select separator character.char
Returns the character for a quote.Returns the Regular expression or an empty String if not set.protected String
Returns the key for XML Variables in the data reference.getXPath()
Returns the XPath expression if XML variables are used as data reference.boolean
hasFocus()
Returnstrue
if the focus is set.boolean
boolean
boolean
isLocked()
Returnstrue
if this Prompt Element is locked.boolean
Returns the value of the multi-line property.boolean
If set, this control shows asterisks instead of the text which was entered.boolean
isUpper()
Returnstrue
if the values should be converted to upper case.boolean
Returnstrue
if the user has to use the default value or enter a value in this field.void
setCaption
(String caption) Sets the caption of this prompt element.void
Sets a UC4 VARA Object which contains a list of valid entries for this prompt element.void
setFocus
(boolean value) Sets the cursor focus: The cursor is placed at this control if the value istrue
.void
setInputAssistance
(boolean value) Enables or disables the input assistance for this field.void
setLocked
(boolean locked) Lock or unlocks this element.void
setMaxLength
(int length) Sets the maximal length for inputs in this text field.void
setMultiline
(boolean value) Enables or disables the multiline property.void
setMultiSelect
(boolean value) Enables or disables multi select.void
Sets the mulit select separator character.void
setQuoteCharacter
(char c) Sets the character for a quote, for example ' or ".void
Sets the Regular expression.void
setShowAsPassword
(boolean value) If set, this control shows asterisks instead of the text which was entered.void
setUpper
(boolean value) Sets the upper cause property.void
setValueRequired
(boolean value) Sets or clears the property which determines if this field requires a value.void
Sets the key in case XML Variables are used as data reference.void
Sets the XPath expression if XML variables are used as data reference.Methods inherited from class com.uc4.api.prompt.OnChangeResetElement
addOnChangeResetElement, getAllOnChangeResetElementIterator, onChangeResetElementIterator, removeAllOnChangeResetElements, removeOnChangeResetElement, resetAllSubValues, sizeOfOnChangeResetElements, storeAdditionalPromptData
Methods inherited from class com.uc4.api.objects.PromptElement
getCustomField, getMessageInsert, getMessageNumber, getMode, getProperty, getTooltip, getValue, getValues, getVariable, hasList, isAltView, listParam, setAltView, setCustomField, setRawValue, setTooltip, setValue, setValues, setVariable, store, storeDefaultValues, toString, updateDefaultValue, validateForExecute, validateId
-
Constructor Details
-
TextElement
- Parameters:
variableName
- Name of the script variablereference
- Reference
-
-
Method Details
-
setXmlKey
Sets the key in case XML Variables are used as data reference.- Specified by:
setXmlKey
in interfacePromptInterfaces.XmlKey
- Parameters:
key
- Key
-
getXmlKey
Returns the key for XML Variables in the data reference.- Specified by:
getXmlKey
in interfacePromptInterfaces.XmlKey
- Returns:
- Key or an empty String if not set.
-
setXPath
Sets the XPath expression if XML variables are used as data reference.- Specified by:
setXPath
in interfacePromptInterfaces.XPath
- Parameters:
xpath
- XPath/Query expression
-
getXPath
Returns the XPath expression if XML variables are used as data reference.- Specified by:
getXPath
in interfacePromptInterfaces.XPath
- Returns:
- XPath/Query expression or an empty String if not set.
-
isLocked
public boolean isLocked()Returnstrue
if this Prompt Element is locked. In this case a user cannot change the default value in the Prompt-Screen.- Specified by:
isLocked
in interfacePromptInterfaces.Locked
- Overrides:
isLocked
in classPromptElement
- Returns:
- true if locked, false if the user can change the value of the Prompt Element
-
setQuoteCharacter
public void setQuoteCharacter(char c) Sets the character for a quote, for example ' or ".- Specified by:
setQuoteCharacter
in interfacePromptInterfaces.QuoteCharacter
- Parameters:
c
- Character
-
getQuoteCharacter
public char getQuoteCharacter()Returns the character for a quote.- Specified by:
getQuoteCharacter
in interfacePromptInterfaces.QuoteCharacter
- Returns:
- for example ' or "
-
setLocked
public void setLocked(boolean locked) Lock or unlocks this element. A user cannot change the default value in the Prompt-Screen if a control is locked.- Specified by:
setLocked
in interfacePromptInterfaces.Locked
- Overrides:
setLocked
in classPromptElement
- Parameters:
locked
- true if locked, false if the user can change the value of the Prompt Element
-
setRegExp
Sets the Regular expression.- Parameters:
regex
- Regular expression
-
getRegExp
Returns the Regular expression or an empty String if not set.- Returns:
- Regular expression
-
hasFocus
public boolean hasFocus()Returnstrue
if the focus is set. The cursor is placed at this control if the value istrue
. It may only be defined for one control in the PromptSet. If this flag is defined for several Controls of a PromptSet the last Control that got the flag wins.- Specified by:
hasFocus
in interfacePromptInterfaces.Focus
- Returns:
- true if the cursor should be set in this Prompt Element, false otherwise
-
setFocus
public void setFocus(boolean value) Sets the cursor focus: The cursor is placed at this control if the value istrue
. It may only be defined for one control in the PromptSet. If this flag is defined for several Controls of a PromptSet the last Control that got the flag wins.- Specified by:
setFocus
in interfacePromptInterfaces.Focus
- Parameters:
value
- true if the cursor should be set in this Prompt Element, false otherwise
-
isUpper
public boolean isUpper()Returnstrue
if the values should be converted to upper case.- Returns:
- true if uppercase
-
setUpper
public void setUpper(boolean value) Sets the upper cause property.- Parameters:
value
- true to enable the conversion to upper case, false to disable it
-
isShowAsPassword
public boolean isShowAsPassword()If set, this control shows asterisks instead of the text which was entered.- Returns:
- true if enabled, false if disabled
-
setShowAsPassword
public void setShowAsPassword(boolean value) If set, this control shows asterisks instead of the text which was entered.- Parameters:
value
- true to enable the password field, false to disable it
-
isValueRequired
public boolean isValueRequired()Returnstrue
if the user has to use the default value or enter a value in this field.- Specified by:
isValueRequired
in interfacePromptInterfaces.ValueRequired
- Returns:
- true if a value is required, false otherwise
-
setValueRequired
public void setValueRequired(boolean value) Sets or clears the property which determines if this field requires a value.- Specified by:
setValueRequired
in interfacePromptInterfaces.ValueRequired
- Parameters:
value
- true if a value is required, false otherwise
-
hasInputAssistance
public boolean hasInputAssistance()- Returns:
true
if input assistance is enabled, false otherwise
-
setInputAssistance
public void setInputAssistance(boolean value) Enables or disables the input assistance for this field.- Parameters:
value
-true
if input assistance should be enabled, false otherwise
-
getCaption
- Specified by:
getCaption
in interfacePromptInterfaces.Caption
- Returns:
- Caption of this prompt element
-
setCaption
Sets the caption of this prompt element.- Specified by:
setCaption
in interfacePromptInterfaces.Caption
- Parameters:
caption
- Caption
-
setDataReference
Sets a UC4 VARA Object which contains a list of valid entries for this prompt element.- Specified by:
setDataReference
in interfacePromptInterfaces.DataReference
- Parameters:
vara
- Name of a Variable Object
-
getDataReference
- Specified by:
getDataReference
in interfacePromptInterfaces.DataReference
- Returns:
- Name of a Variable Object
-
setMultiSelect
public void setMultiSelect(boolean value) Enables or disables multi select.- Specified by:
setMultiSelect
in interfacePromptInterfaces.MultiSelect
- Parameters:
value
- true if mulit select should be enabled
-
hasMultiSelect
public boolean hasMultiSelect()- Specified by:
hasMultiSelect
in interfacePromptInterfaces.MultiSelect
- Returns:
- true if multi select is enabled
-
setMultiline
public void setMultiline(boolean value) Enables or disables the multiline property.- Parameters:
value
- true if this text field should contain more than one line, false if not.
-
isMultiline
public boolean isMultiline()Returns the value of the multi-line property.- Returns:
- true if this text control supports more than one line of data.
-
setMultiSelectSeparator
Sets the mulit select separator character.- Specified by:
setMultiSelectSeparator
in interfacePromptInterfaces.MultiSelect
- Parameters:
sep
- separator character
-
getMultiSelectSeparator
Returns the mulit select separator character.- Specified by:
getMultiSelectSeparator
in interfacePromptInterfaces.MultiSelect
- Returns:
- separator character
-
setMaxLength
public void setMaxLength(int length) Sets the maximal length for inputs in this text field.- Parameters:
length
- Max length
-
getMaxLength
public int getMaxLength()- Returns:
- Maximum length which is allowed in this text field.
-
getTagName
- Specified by:
getTagName
in classPromptElement
-