Interface ItemElement
- All Superinterfaces:
DomQueryable
,Element
,EventTarget
,Node
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get whether the shown item's tooltip shows the advancedF3+H
information.@Nullable org.bukkit.inventory.ItemStack
Gets the element's item stackGets the element's tooltip.boolean
Get whether the element shows the automatically generated tooltip when hovered over or not.void
setAdvancedTooltip
(boolean advancedTooltip) Set whether the shown item's tooltip shows the advancedF3+H
information.void
setItemStack
(@Nullable org.bukkit.inventory.ItemStack stack) Sets the element's item stack.void
setTooltipHidden
(boolean tooltipShown) Set whether the element shows the automatically generated tooltip when hovered over.Methods inherited from interface com.juliewoolie.dom.DomQueryable
getElementsByClassName, getElementsByTagName, querySelector, querySelectorAll
Methods inherited from interface com.juliewoolie.dom.Element
appendChild, appendElement, appendText, canHaveChildren, clearChildren, firstChild, forEachDescendant, getAttribute, getAttributeEntries, getAttributeNames, getChild, getChildCount, getChildren, getClassList, getClassName, getCurrentStyle, getId, getInlineStyle, getTagName, getTextContent, getTitleNode, hasAttribute, hasChild, hasChildren, indexOf, insertAfter, insertBefore, isDescendant, lastChild, matches, prependChild, removeAttribute, removeChild, removeChild, removeMatchingChildren, replaceChild, replaceChild, setAttribute, setClassName, setId, setTextContent, setTitleNode
Methods inherited from interface com.juliewoolie.dom.event.EventTarget
addEventListener, dispatchEvent, getOnAddAttribute, getOnAddOption, getOnAppendChild, getOnAttributeChange, getOnClick, getOnClosing, getOnInput, getOnLoaded, getOnMouseEnter, getOnMouseExit, getOnMouseMove, getOnOptionChange, getOnRemoveAttribute, getOnRemoveChild, getOnRemoveOption, getOnRightClick, getOnSetAttribute, getOnSetOption, getOnSpawned, onAddAttribute, onAddOption, onAppendChild, onAttributeChange, onClick, onClosing, onInput, onLoaded, onMouseEnter, onMouseExit, onMouseMove, onOptionChange, onRemoveAttribute, onRemoveChild, onRemoveOption, onRightClick, onSetAttribute, onSetOption, onSpawned, removeEventListener
Methods inherited from interface com.juliewoolie.dom.Node
enterVisitor, exitVisitor, getDepth, getOwningDocument, getParent, getRenderingBounds, getSiblingIndex, hasFlag, nextSibling, previousSibling
-
Method Details
-
getTooltipHidden
boolean getTooltipHidden()Get whether the element shows the automatically generated tooltip when hovered over or not.If
getTooltip()
does NOT return the automatically generated item tooltip, then the result of this method is ignored.Shorthand for parsing the value of the
Attributes.ITEM_TOOLTIP_HIDE
attribute. If the attribute is not set,false
is returned. If the attribute's value cannot be parsed into a boolean,false
is returned. Otherwise the parsed value of the attribute is returned.- Returns:
true
, if the item tooltip is hidden,false
otherwise.- See Also:
-
setTooltipHidden
void setTooltipHidden(boolean tooltipShown) Set whether the element shows the automatically generated tooltip when hovered over.Shorthand for setting the
Attributes.ITEM_TOOLTIP_HIDE
attribute.- Parameters:
tooltipShown
-true
, if the item tooltip is hidden,false
otherwise.- See Also:
-
getAdvancedTooltip
boolean getAdvancedTooltip()Get whether the shown item's tooltip shows the advancedF3+H
information.Shorthand for parsing the value of the
Attributes.ADVANCED_ITEM_TOOLTIPS
attribute. If the attribute is not set, then the value ofOptions.ADVANCED_ITEM_TOOLTIPS
is used. If the option has no set value, thenfalse
is returned. If the attribute/option's value cannot be parsed into a boolean,false
is returned, otherwise the parsed value is returned.- Returns:
true
, if advanced tooltips are shown,false
otherwise.- See Also:
-
setAdvancedTooltip
void setAdvancedTooltip(boolean advancedTooltip) Set whether the shown item's tooltip shows the advancedF3+H
information.Shorthand for setting the
Attributes.ADVANCED_ITEM_TOOLTIPS
attribute.- Parameters:
advancedTooltip
-true
, to show advanced tooltips,false
otherwise.- See Also:
-
getTooltip
Node getTooltip()Gets the element's tooltip.May return the item stack's tooltip, unless the element's tooltip has been overridden with
Element.setTitleNode(Node)
or if theAttributes.ITEM_TOOLTIP_HIDE
has been set totrue
- Specified by:
getTooltip
in interfaceElement
- Returns:
- Element tooltip
- See Also:
-
getItemStack
@Nullable @Nullable org.bukkit.inventory.ItemStack getItemStack()Gets the element's item stack- Returns:
- Item stack, or
null
, if not set or if it failed to load.
-
setItemStack
void setItemStack(@Nullable @Nullable org.bukkit.inventory.ItemStack stack) Sets the element's item stack.- Parameters:
stack
- Item tack.
-