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

Number field.
  • Constructor Details

    • NumberElement

      public NumberElement(String variableName, UC4ObjectName reference)
      Creates a new number field.
      Parameters:
      variableName - Name of the script variable
      reference - 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 interface PromptInterfaces.QuoteCharacter
      Parameters:
      c - Character
    • getQuoteCharacter

      public char getQuoteCharacter()
      Returns the character for a quote.
      Specified by:
      getQuoteCharacter in interface PromptInterfaces.QuoteCharacter
      Returns:
      for example ' or "
    • getTagName

      protected String getTagName()
      Specified by:
      getTagName in class PromptElement
    • getTooltip

      public String getTooltip()
      Returns the tooltip of this Prompt Element.
      Overrides:
      getTooltip in class PromptElement
      Returns:
      Tooltip
    • setTooltip

      public void setTooltip(String tooltip)
      Sets the tooltip of this Prompt Element.
      Overrides:
      setTooltip in class PromptElement
      Parameters:
      tooltip - Tooltip text
    • setDataReference

      public void setDataReference(UC4ObjectName vara)
      Sets a UC4 VARA Object which contains a list of valid entries for this prompt element.
      Specified by:
      setDataReference in interface PromptInterfaces.DataReference
      Parameters:
      vara - Name of a Variable Object
    • getDataReference

      public UC4ObjectName getDataReference()
      Specified by:
      getDataReference in interface PromptInterfaces.DataReference
      Returns:
      Name of a Variable Object
    • setMinValue

      public void setMinValue(Integer min)
      Sets the minimum value.
      Specified by:
      setMinValue in interface PromptInterfaces.Constraints<Integer>
      Parameters:
      min - Min value or null to disable the lower limit.
    • getMinValue

      public Integer getMinValue()
      Returns the minimum value.
      Specified by:
      getMinValue in interface PromptInterfaces.Constraints<Integer>
      Returns:
      Min value or null if there is no lower limit.
    • setMinimumValue

      @Deprecated public void setMinimumValue(int min)
      Deprecated.
      Use setMinValue() instead
      Sets the minimum value.
      Parameters:
      min - Min value or -1 to disable the lower limit.
    • getMinimumValue

      @Deprecated public int getMinimumValue()
      Deprecated.
      Use getMinValue() instead
      Returns the minimum value.
      Returns:
      Min value or -1 if there is no lower limit.
    • getCaption

      public String getCaption()
      Specified by:
      getCaption in interface PromptInterfaces.Caption
      Returns:
      Caption of this prompt element
    • setCaption

      public void setCaption(String caption)
      Sets the caption of this prompt element.
      Specified by:
      setCaption in interface PromptInterfaces.Caption
      Parameters:
      caption - Caption
    • isLocked

      public boolean isLocked()
      Returns true if this Prompt Element is locked. In this case a user cannot change the default value in the Prompt-Screen.
      Specified by:
      isLocked in interface PromptInterfaces.Locked
      Overrides:
      isLocked in class PromptElement
      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 interface PromptInterfaces.Locked
      Overrides:
      setLocked in class PromptElement
      Parameters:
      locked - true if locked, false if the user can change the value of the Prompt Element
    • hasFocus

      public boolean hasFocus()
      Returns true if the focus is set. The cursor is placed at this control if the value is true. 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 interface PromptInterfaces.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 is true. 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 interface PromptInterfaces.Focus
      Parameters:
      value - true if the cursor should be set in this Prompt Element, false otherwise
    • setMaxValue

      public void setMaxValue(Integer value)
      Sets the maximum value.
      Specified by:
      setMaxValue in interface PromptInterfaces.Constraints<Integer>
      Parameters:
      value - Max value or null in order to disable the upper limit.
    • setMaximumValue

      @Deprecated public void setMaximumValue(int value)
      Deprecated.
      Use setMaxValue() instead
      Sets the maximum value.
      Parameters:
      value - Max value or -1 in order to disable the upper limit.
    • getMaxValue

      public Integer getMaxValue()
      Returns the maximum value.
      Specified by:
      getMaxValue in interface PromptInterfaces.Constraints<Integer>
      Returns:
      Max value or -1 if no limit is set.
    • getMaximumValue

      @Deprecated public int getMaximumValue()
      Deprecated.
      use getMaxValue() instead
      Returns the maximum value.
      Returns:
      Max value or -1 if no limit is set.
    • listParam

      protected String listParam()
      Overrides:
      listParam in class PromptElement