Interface Attributes


public interface Attributes
Attribute name constants
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Trigger for BUTTON_ACTION.
    static final String
    If item tooltips use advanced tooltips.
    static final String
    Button action, executed when a ButtonElement button element is clicked.
    static final String
    Class list attribute.
    static final String
    Name of the linked java class in a JavaObjectElement
    static final String
    Defer attribute for delaying script execution until the DOM has finished loading
    static final String
    Enabled/disabled state attribute, used by <button> elements.
    static final String
    Attribute for defining the height in pixels of a canvas element.
    static final String
    ID attribute.
    static final String
    Item tooltip hide state attribute, used by <item> elements to determine whether the item tooltip should be hidden or not.
    static final String
    Option name attribute, used during parsing by the <option> element.
    static final String
    Used to specify the placeholder on an InputElement
    static final String
    Attribute for defining an Input element's input prompt
    static final String
    Attribute for defining the role of an element.
    static final String
    Source attribute, used by <script>, <style> and <item> elements.
    static final String
    Inline style attribute.
    static final String
    Attribute which defines the behaviour of a tooltip.
    static final String
    Attribute which defines the delay before a tooltip becomes visible.
    static final String
    Type attribute.
    static final String
    Key attribute, used during parsing by the <option> element.
    static final String
    Attribute for defining the width in pixels of a canvas element.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static boolean
    boolAttribute(@Nullable String value, boolean fallback)
     
    floatAttribute(String value, float min, float max)
    Parses a float attribute value.
    static int
    intAttribute(String value, int min, int max, int fb)
    Parses an attribute's string value into an integer.
  • Field Details

    • ID

      static final String ID
      ID attribute.
      See Also:
    • CLASS

      static final String CLASS
      Class list attribute.
      See Also:
    • STYLE

      static final String STYLE
      Inline style attribute.
      See Also:
    • SOURCE

      static final String SOURCE
      Source attribute, used by <script>, <style> and <item> elements.
      See Also:
    • NAME

      static final String NAME
      Option name attribute, used during parsing by the <option> element.
      See Also:
    • VALUE

      static final String VALUE
      Key attribute, used during parsing by the <option> element.
      See Also:
    • ENABLED

      static final String ENABLED
      Enabled/disabled state attribute, used by <button> elements.
      See Also:
    • ITEM_TOOLTIP_HIDE

      static final String ITEM_TOOLTIP_HIDE
      Item tooltip hide state attribute, used by <item> elements to determine whether the item tooltip should be hidden or not.
      See Also:
    • ADVANCED_ITEM_TOOLTIPS

      static final String ADVANCED_ITEM_TOOLTIPS
      If item tooltips use advanced tooltips. (Including the F3+H debug information).

      This attribute overrides the Options.ADVANCED_ITEM_TOOLTIPS option, if it is set.

      See Also:
    • BUTTON_ACTION

      static final String BUTTON_ACTION
      Button action, executed when a ButtonElement button element is clicked. Only works on button elements.
      Valid value patterns
      Pattern Description Example
      close Closes the page "close"
      cmd: <command> Runs a command as console. You can use %player% as a placeholder for the player's name "cmd: msg %player% Hello, world!
      player-cmd: <command> Runs a command as the player. You can use %player% as a placeholder for the player's name "player-cmd: msg %player% Hello, me!
      See Also:
    • ACTION_TRIGGER

      static final String ACTION_TRIGGER
      Trigger for BUTTON_ACTION.
      Supported values
      Value Triggers
      left When button is left-clicked
      right When button is right-clicked
      See Also:
    • CLASS_NAME

      static final String CLASS_NAME
      Name of the linked java class in a JavaObjectElement
      See Also:
    • TYPE

      static final String TYPE
      Type attribute.

      Used in multiple places:

      • On ComponentElements to specify what syntax to use when loading component data.
      • On InputElements to specify what type of input they accept
      See Also:
    • PLACEHOLDER

      static final String PLACEHOLDER
      Used to specify the placeholder on an InputElement
      See Also:
    • DEFER

      static final String DEFER
      Defer attribute for delaying script execution until the DOM has finished loading
      See Also:
    • WIDTH

      static final String WIDTH
      Attribute for defining the width in pixels of a canvas element.
      See Also:
    • HEIGHT

      static final String HEIGHT
      Attribute for defining the height in pixels of a canvas element.
      See Also:
    • PROMPT

      static final String PROMPT
      Attribute for defining an Input element's input prompt
      See Also:
    • ROLE

      static final String ROLE
      Attribute for defining the role of an element.

      When Delphi is loading a page from XML, this attribute is used in some special cases.

      Supported values
      Value Usage
      tooltip The element is set as its parent tooltip element (With Element.setTitleNode(Element))
      See Also:
    • TOOLTIP_DELAY

      static final String TOOLTIP_DELAY
      Attribute which defines the delay before a tooltip becomes visible.

      Values are specified as numbers, optionally followed by one of the following units:

      • seconds, or just s
      • millis, milliseconds or just ms
      • ticks or just t
      If the attribute's value cannot be parsed, a negative value was set, or if an invalid unit was used, then the tooltip's delay will default to 0.

      Examples:

      • 0.5seconds
      • 500ms
      • 10t
      See Also:
    • TOOLTIP_BEHAVIOUR

      static final String TOOLTIP_BEHAVIOUR
      Attribute which defines the behaviour of a tooltip.

      Accepts one of the following values:

      cursor-sticky
      Tooltip will follow the cursor
      cursor
      Tooltip will appear where the element hovered over the element, but will not move until the element itself is unhovered.
      left
      Tooltip will appear on the left side of the element.
      right
      Tooltip will appear on the right side of the element.
      above
      Tooltip will appear on top of the element.
      below
      Tooltip will appear on below the element.
      See Also:
  • Method Details

    • floatAttribute

      static Result<Float,String> floatAttribute(String value, float min, float max)
      Parses a float attribute value.

      If the specified value cannot be parsed into a float, an erroneous result with the error "Invalid number" is returned.

      If the number is parsed successfully, then it is clamped according to the min and max parameters.

      Parameters:
      value - Value to parse from
      min - Minimum value
      max - Maximum value
      Returns:
      Parsed float result
    • intAttribute

      static int intAttribute(String value, int min, int max, int fb)
      Parses an attribute's string value into an integer.
      Parameters:
      value - Attribute value
      min - Minimum parsed value
      max - Maximum parsed value
      fb - Fallback value if attribute value is empty or null
      Returns:
      Clamped parsed value, or fallback
    • boolAttribute

      static boolean boolAttribute(@Nullable @Nullable String value, boolean fallback)