Interface Attributes
public interface Attributes
Attribute name constants
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Trigger forBUTTON_ACTION
.static final String
If item tooltips use advanced tooltips.static final String
Button action, executed when aButtonElement
button element is clicked.static final String
Class list attribute.static final String
Name of the linked java class in aJavaObjectElement
static final String
Defer attribute for delaying script execution until the DOM has finished loadingstatic 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 anInputElement
static final String
Attribute for defining an Input element's input promptstatic final String
Source attribute, used by<script>
,<style>
and<item>
elements.static final String
Inline style attribute.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 MethodsModifier and TypeMethodDescriptionstatic 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
-
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+H
debug information).This attribute overrides the
Options.ADVANCED_ITEM_TOOLTIPS
option, if it is set.- See Also:
-
BUTTON_ACTION
Button action, executed when aButtonElement
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
Trigger forBUTTON_ACTION
.Supported values Value Triggers left
When button is left-clicked right
When button is right-clicked - See Also:
-
CLASS_NAME
-
TYPE
Type attribute.Used in multiple places:
- On
ComponentElement
s to specify what syntax to use when loading component data. - On
InputElement
s 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
-
-
Method Details
-
floatAttribute
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
andmax
parameters.- 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
-