Interface Attributes
public interface Attributes
Attribute name constants
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTrigger forBUTTON_ACTION.static final StringIf item tooltips use advanced tooltips.static final StringButton action, executed when aButtonElementbutton element is clicked.static final StringClass list attribute.static final StringName of the linked java class in aJavaObjectElementstatic final StringDefer attribute for delaying script execution until the DOM has finished loadingstatic final StringEnabled/disabled state attribute, used by<button>elements.static final StringAttribute for defining the height in pixels of a canvas element.static final StringID attribute.static final StringItem tooltip hide state attribute, used by<item>elements to determine whether the item tooltip should be hidden or not.static final StringOption name attribute, used during parsing by the<option>element.static final StringUsed to specify the placeholder on anInputElementstatic final StringAttribute for defining an Input element's input promptstatic final StringAttribute for defining the role of an element.static final StringSource attribute, used by<script>,<style>and<item>elements.static final StringInline style attribute.static final StringAttribute which defines the behaviour of a tooltip.static final StringAttribute which defines the delay before a tooltip becomes visible.static final StringType attribute.static final StringKey attribute, used during parsing by the<option>element.static final StringAttribute for defining the width in pixels of a canvas element. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic booleanboolAttribute(@Nullable String value, boolean fallback) floatAttribute(String value, float min, float max) Parses a float attribute value.static intintAttribute(String value, int min, int max, int fb) Parses an attribute's string value into an integer.
-
Field Details
-
ID
-
CLASS
-
STYLE
-
SOURCE
Source attribute, used by<script>,<style>and<item>elements.- See Also:
-
NAME
Option name attribute, used during parsing by the<option>element.- See Also:
-
VALUE
-
ENABLED
-
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
If item tooltips use advanced tooltips. (Including theF3+Hdebug information).This attribute overrides the
Options.ADVANCED_ITEM_TOOLTIPSoption, if it is set.- See Also:
-
BUTTON_ACTION
Button action, executed when aButtonElementbutton element is clicked. Only works on button elements.
Valid value patterns Pattern Description Example closeCloses 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
Trigger forBUTTON_ACTION.Supported values Value Triggers leftWhen button is left-clicked rightWhen button is right-clicked - See Also:
-
CLASS_NAME
-
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:
- On
-
PLACEHOLDER
-
DEFER
Defer attribute for delaying script execution until the DOM has finished loading- See Also:
-
WIDTH
-
HEIGHT
Attribute for defining the height in pixels of a canvas element.- See Also:
-
PROMPT
-
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 tooltipThe element is set as its parent tooltip element (With Element.setTitleNode(Element))- See Also:
-
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 justsmillis,millisecondsor justmsticksor justt
0.Examples:
0.5seconds500ms10t
- See Also:
-
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
Parses a float attribute value.If the specified
valuecannot 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
minandmaxparameters.- Parameters:
value- Value to parse frommin- Minimum valuemax- Maximum value- Returns:
- Parsed float result
-
intAttribute
Parses an attribute's string value into an integer.- Parameters:
value- Attribute valuemin- Minimum parsed valuemax- Maximum parsed valuefb- Fallback value if attribute value is empty or null- Returns:
- Clamped parsed value, or fallback
-
boolAttribute
-