Package com.uc4.api.prompt
Class NumberElement
java.lang.Object
com.uc4.api.objects.PromptElement
com.uc4.api.prompt.NumberElement
- All Implemented Interfaces:
PromptInterfaces.Caption
,PromptInterfaces.Constraints<Integer>
,PromptInterfaces.DataReference
,PromptInterfaces.Focus
,PromptInterfaces.Locked
,PromptInterfaces.QuoteCharacter
public class NumberElement
extends PromptElement
implements PromptInterfaces.Caption, PromptInterfaces.DataReference, PromptInterfaces.Focus, PromptInterfaces.QuoteCharacter, PromptInterfaces.Locked, PromptInterfaces.Constraints<Integer>
Number field.
-
Field Summary
Fields inherited from class com.uc4.api.objects.PromptElement
aliasMap, list, properties
-
Constructor Summary
ConstructorsConstructorDescriptionNumberElement
(String variableName, UC4ObjectName reference) Creates a new number field. -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.use getMaxValue() insteadReturns the maximum value.int
Deprecated.Use getMinValue() insteadReturns the minimum value.char
Returns the character for a quote.protected String
Returns the tooltip of this Prompt Element.boolean
hasFocus()
Returnstrue
if the focus is set.boolean
isLocked()
Returnstrue
if this Prompt Element is locked.protected String
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
setLocked
(boolean locked) Lock or unlocks this element.void
setMaximumValue
(int value) Deprecated.Use setMaxValue() insteadvoid
setMaxValue
(Integer value) Sets the maximum value.void
setMinimumValue
(int min) Deprecated.Use setMinValue() insteadvoid
setMinValue
(Integer min) Sets the minimum value.void
setQuoteCharacter
(char c) Sets the character for a quote, for example ' or ".void
setTooltip
(String tooltip) Sets the tooltip of this Prompt Element.Methods inherited from class com.uc4.api.objects.PromptElement
getCustomField, getMessageInsert, getMessageNumber, getMode, getProperty, getValue, getValues, getVariable, hasList, isAltView, setAltView, setCustomField, setRawValue, setValue, setValues, setVariable, store, storeAdditionalPromptData, storeDefaultValues, toString, updateDefaultValue, validateForExecute, validateId
-
Constructor Details
-
NumberElement
Creates a new number field.- Parameters:
variableName
- Name of the script variablereference
- Name of the reference variable
-
-
Method Details
-
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 "
-
getTagName
- Specified by:
getTagName
in classPromptElement
-
getTooltip
Returns the tooltip of this Prompt Element.- Overrides:
getTooltip
in classPromptElement
- Returns:
- Tooltip
-
setTooltip
Sets the tooltip of this Prompt Element.- Overrides:
setTooltip
in classPromptElement
- Parameters:
tooltip
- Tooltip text
-
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
-
setMinValue
Sets the minimum value.- Specified by:
setMinValue
in interfacePromptInterfaces.Constraints<Integer>
- Parameters:
min
- Min value ornull
to disable the lower limit.
-
getMinValue
Returns the minimum value.- Specified by:
getMinValue
in interfacePromptInterfaces.Constraints<Integer>
- Returns:
- Min value or
null
if there is no lower limit.
-
setMinimumValue
Deprecated.Use setMinValue() insteadSets the minimum value.- Parameters:
min
- Min value or-1
to disable the lower limit.
-
getMinimumValue
Deprecated.Use getMinValue() insteadReturns the minimum value.- Returns:
- Min value or
-1
if there is no lower limit.
-
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
-
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
-
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
-
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
-
setMaxValue
Sets the maximum value.- Specified by:
setMaxValue
in interfacePromptInterfaces.Constraints<Integer>
- Parameters:
value
- Max value ornull
in order to disable the upper limit.
-
setMaximumValue
Deprecated.Use setMaxValue() insteadSets the maximum value.- Parameters:
value
- Max value or-1
in order to disable the upper limit.
-
getMaxValue
Returns the maximum value.- Specified by:
getMaxValue
in interfacePromptInterfaces.Constraints<Integer>
- Returns:
- Max value or
-1
if no limit is set.
-
getMaximumValue
Deprecated.use getMaxValue() insteadReturns the maximum value.- Returns:
- Max value or
-1
if no limit is set.
-
listParam
- Overrides:
listParam
in classPromptElement
-