public class Element extends Node<Element>
Contains methods for updating and querying various parts of the element, such as attributes.
Modifier | Constructor and Description |
---|---|
protected |
Element(StateNode node,
ElementStateProvider stateProvider)
Private constructor for initializing with an existing node and state
provider.
|
|
Element(String tag)
Creates an element using the given tag name.
|
|
Element(String tag,
boolean autocreate)
Deprecated.
The
autoCreate parameter no longer has any effect.
Use Element(String) instead. |
Modifier and Type | Method and Description |
---|---|
Registration |
addAttachListener(ElementAttachListener attachListener)
Adds an attach listener for this element.
|
Registration |
addDetachListener(ElementDetachListener detachListener)
Adds a detach listener for this element.
|
DomListenerRegistration |
addEventListener(String eventType,
DomEventListener listener)
Adds an event listener for the given event type.
|
DomListenerRegistration |
addEventListener(String eventType,
DomEventListener listener,
String... eventDataExpressions)
Deprecated.
Instead, use the returned registration instance for adding
event data expressions
|
Registration |
addPropertyChangeListener(String name,
PropertyChangeListener listener)
Adds a property change listener.
|
DomListenerRegistration |
addPropertyChangeListener(String propertyName,
String domEventName,
PropertyChangeListener listener)
Adds a property change listener and configures the property to be
synchronized to the server when a given DOM event is fired.
|
Element |
addSynchronizedProperty(String property)
Deprecated.
|
Element |
addSynchronizedProperty(String property,
DisabledUpdateMode mode)
Deprecated.
|
Element |
addSynchronizedPropertyEvent(String eventType)
Deprecated.
|
<T extends Component> |
as(Class<T> componentType)
Creates a new component instance using this element.
|
ShadowRoot |
attachShadow()
Attaches shadow root node.
|
void |
callFunction(String functionName,
Serializable... arguments)
Deprecated.
Use
callJsFunction(String,Serializable...) instead
since it also allows getting return value back. |
PendingJavaScriptResult |
callJsFunction(String functionName,
Serializable... arguments)
Calls the given function on the element with the given arguments.
|
static Element |
createText(String text)
Creates a text node with the given text.
|
void |
executeJavaScript(String expression,
Serializable... parameters)
Deprecated.
Use
executeJs(String,Serializable...) instead since
it also allows getting return value back. |
PendingJavaScriptResult |
executeJs(String expression,
Serializable... parameters)
Asynchronously runs the given JavaScript expression in the browser in the
context of this element.
|
static Element |
get(StateNode node)
Gets the element mapped to the given state node.
|
static Element |
get(StateNode node,
ElementStateProvider stateProvider)
Gets the element mapped to the given state node and element state
provider.
|
String |
getAttribute(String attribute)
Gets the value of the given attribute.
|
Stream<String> |
getAttributeNames()
Gets the defined attribute names.
|
Element |
getChild(int index)
Returns the child element at the given position.
|
int |
getChildCount()
Gets the number of child elements.
|
Stream<Element> |
getChildren()
Gets all the children of this element.
|
ClassList |
getClassList()
Gets the set of CSS class names used for this element.
|
Optional<Component> |
getComponent()
Gets the component this element has been mapped to, if any.
|
String |
getOuterHTML()
Gets the outer HTML for the element.
|
Element |
getParent()
Gets the parent element.
|
String |
getProperty(String name)
Gets the value of the given property as a string.
|
boolean |
getProperty(String name,
boolean defaultValue)
Gets the value of the given property as a boolean, or the given default
value if the underlying value is
null . |
double |
getProperty(String name,
double defaultValue)
Gets the value of the given property as a double, or the given default
value if the underlying value is
null |
int |
getProperty(String name,
int defaultValue)
Gets the value of the given property as an integer, or the given default
value if the underlying value is
null |
String |
getProperty(String name,
String defaultValue)
Gets the value of the given property as a string.
|
Stream<String> |
getPropertyNames()
Gets the defined property names.
|
Serializable |
getPropertyRaw(String name)
Gets the raw property value without any value conversion.
|
protected Element |
getSelf()
Gets the narrow typed reference to this object.
|
Optional<ShadowRoot> |
getShadowRoot()
Gets the shadow root of the element, if any.
|
Style |
getStyle()
Gets the style instance for managing element inline styles.
|
Stream<String> |
getSynchronizedProperties()
Deprecated.
|
Stream<String> |
getSynchronizedPropertyEvents()
Deprecated.
|
String |
getTag()
Gets the tag name for the element.
|
String |
getText()
Gets the text content of this element.
|
String |
getTextRecursively()
Gets the text content of this element tree.
|
ThemeList |
getThemeList()
Gets the set of the theme names applied to the corresponding element in
theme attribute. |
boolean |
hasAttribute(String attribute)
Checks if the given attribute has been set.
|
boolean |
hasProperty(String name)
Checks whether this element has a property with the given name.
|
boolean |
isEnabled()
Get the enabled state of the element.
|
boolean |
isTextNode()
Checks whether this element represents a text node.
|
boolean |
isVisible()
Gets the element visibility value.
|
Element |
removeAttribute(String attribute)
Removes the given attribute.
|
Element |
removeFromParent()
Removes this element from its parent.
|
Element |
removeFromTree()
Removes this element from its parent and state tree.
|
Element |
removeProperty(String name)
Removes the given property.
|
Element |
removeSynchronizedProperty(String property)
Deprecated.
|
Element |
removeSynchronizedPropertyEvent(String eventType)
Deprecated.
|
Element |
setAttribute(String attribute,
AbstractStreamResource resource)
Sets the given attribute to the given
StreamResource value. |
Element |
setAttribute(String attribute,
boolean value)
Sets the given attribute to the given boolean value.
|
Element |
setAttribute(String attribute,
String value)
Sets the given attribute to the given value.
|
Element |
setEnabled(boolean enabled)
Sets the enabled state of the element.
|
Element |
setProperty(String name,
boolean value)
Sets the given property to the given boolean value.
|
Element |
setProperty(String name,
double value)
Sets the given property to the given numeric value.
|
Element |
setProperty(String name,
String value)
Sets the given property to the given string value.
|
Element |
setPropertyJson(String name,
elemental.json.JsonValue value)
Sets the given property to the given JSON value.
|
Element |
setText(String textContent)
Sets the text content of this element, replacing any existing children.
|
Element |
setVisible(boolean visible)
Sets the element visibility value.
|
Element |
synchronizeProperty(String property,
String eventType)
Deprecated.
|
Element |
synchronizeProperty(String property,
String eventType,
DisabledUpdateMode mode)
Deprecated.
|
String |
toString() |
accept, appendChild, appendVirtualChild, ensureChildHasParent, equals, getNode, getParentNode, getStateProvider, hashCode, indexOfChild, insertChild, isVirtualChild, removeAllChildren, removeChild, removeChild, removeVirtualChild, setChild
protected Element(StateNode node, ElementStateProvider stateProvider)
node
- the state node, not nullstateProvider
- the state provider, not nullpublic Element(String tag)
tag
- the tag name of the element. Must be a non-empty string and
can contain letters, numbers and dashes (-)@Deprecated public Element(String tag, boolean autocreate)
autoCreate
parameter no longer has any effect.
Use Element(String)
instead.tag
- tag name of the element. Must be a non-empty string and can
contain letters, numbers and dashes (-)autocreate
- parameter is ignored, but retained in the API for backwards
compatibilitypublic static Element get(StateNode node)
node
- the state node, not null
null
public static Element get(StateNode node, ElementStateProvider stateProvider)
node
- the state nodestateProvider
- the element state providernull
public int getChildCount()
If the property "innerHTML" has been set explicitly then its value (the
new element structure) won't be populated on the server side and this
method will return 0
.
getChildCount
in class Node<Element>
setProperty(String, String)
public Element getChild(int index)
If property "innerHTML" has been set explicitly then its value (the new element structure) won't be populated on the server side and this method will not work.
getChild
in class Node<Element>
index
- the index of the child element to returnsetProperty(String, String)
public Stream<Element> getChildren()
If property "innerHTML" has been set explicitly then its value (the new element structure) won't be populated on the server side and this method returns an empty stream.
getChildren
in class Node<Element>
setProperty(String, String)
public static Element createText(String text)
text
- the text in the node, null
is interpreted as an
empty stringnull
public String getTag()
public Element setAttribute(String attribute, String value)
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
An attribute always has a String key and a String value.
Note: An empty attribute value ("") will be rendered as <div something> and not <div something="">.
Note that setting the attribute class
will override anything
that has been set previously via getClassList()
.
Note that you cannot set the attribute style
using this
method. Instead you should use getStyle()
object.
Note that attribute changes made on the server are sent to the client but attribute changes made on the client side are not reflected back to the server.
attribute
- the name of the attributevalue
- the value of the attribute, not nullpublic Element setAttribute(String attribute, boolean value)
true
will internally set the value to ""
, which
will be rendered as <div name>, i.e. without any explicit
value. Setting the value to false
is a shorthand for
removing the attribute.
Use hasAttribute(String)
to check whether a boolean attribute
has been set.
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
attribute
- the name of the attributevalue
- the value of the attributesetAttribute(String, String)
public Element setAttribute(String attribute, AbstractStreamResource resource)
StreamResource
value.
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
This is a convenience method to register a StreamResource
instance into the session and use the registered resource URI as an
element attribute.
attribute
- the name of the attributeresource
- the resource value, not nullsetAttribute(String, String)
public String getAttribute(String attribute)
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
An attribute always has a String key and a String value.
Note that for attribute class
the contents of the
getClassList()
collection are returned as a single concatenated
string.
Note that for attribute style
the contents of the
getStyle()
object are returned as a single concatenated string.
Note that attribute changes made on the server are sent to the client but attribute changes made on the client side are not reflected back to the server.
attribute
- the name of the attributepublic boolean hasAttribute(String attribute)
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
Note that attribute changes made on the server are sent to the client but attribute changes made on the client side are not reflected back to the server.
attribute
- the name of the attributepublic Stream<String> getAttributeNames()
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
Note that attribute changes made on the server are sent to the client but attribute changes made on the client side are not reflected back to the server.
public Element removeAttribute(String attribute)
Attribute names are considered case insensitive and all names will be converted to lower case automatically.
If the attribute has not been set, does nothing.
Note that attribute changes made on the server are sent to the client but attribute changes made on the client side are not reflected back to the server.
attribute
- the name of the attributepublic DomListenerRegistration addEventListener(String eventType, DomEventListener listener)
Event listeners are triggered in the order they are registered.
eventType
- the type of event to listen to, not null
listener
- the listener to add, not null
DomListenerRegistration
@Deprecated public DomListenerRegistration addEventListener(String eventType, DomEventListener listener, String... eventDataExpressions)
When an event is fired in the browser, custom JavaScript expressions
defined in the eventDataExpressions
parameter are evaluated
to extract data that is sent back to the server. The expression is
evaluated in a context where element
refers to this element
and event
refers to the fired event. The result of the
evaluation is available in DomEvent.getEventData()
with the
expression as the key in the JSON object. An expression might be e.g.
element.value
the get the value of an input element for
a change event.
event.button === 0
to get true for click events
triggered by the primary mouse button.
Event listeners are triggered in the order they are registered.
eventType
- the type of event to listen to, not null
listener
- the listener to add, not null
eventDataExpressions
- definitions for data that should be passed back to the server
together with the eventpublic Element removeFromParent()
Has no effect if the element does not have a parent
public Element removeFromTree()
public Element getParent()
The method may return null
if the parent is not an element but a
Node
.
Node.getParentNode()
public Element setProperty(String name, String value)
Note in order to update the following properties, you need to use the specific API for that:
Property | Method |
---|---|
classList / className | getClassList() |
style | getStyle() |
textContent | getText() and getTextRecursively()
|
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
The "innerHTML" property has an impact on the descendants structure of the element. So setting the "innerHTML" property removes all the children.
name
- the property name, not null
value
- the property valuepublic Element setProperty(String name, boolean value)
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
name
- the property name, not null
value
- the property valuepublic Element setProperty(String name, double value)
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
name
- the property name, not null
value
- the property valuepublic Element setPropertyJson(String name, elemental.json.JsonValue value)
Please note that this method does not accept null
as a
value, since Json.createNull()
should be used instead for JSON
values.
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
name
- the property name, not null
value
- the property value, not null
public Registration addPropertyChangeListener(String name, PropertyChangeListener listener)
Use either two way Polymer binding or synchronize property explicitly to be able to get property change events from the client.
name
- the property name to add the listener for, not
null
listener
- listener to get notifications about property value changes,
not null
synchronizeProperty(String, String)
public DomListenerRegistration addPropertyChangeListener(String propertyName, String domEventName, PropertyChangeListener listener)
addPropertyChangeListener(String, PropertyChangeListener)
propertyName
- the name of the element property to listen to, not
null
domEventName
- the name of the DOM event for which the property should be
synchronized to the server, not null
listener
- the property change listener not add, not null
public String getProperty(String name, String defaultValue)
name
- the property name, not null
defaultValue
- the value to return if the property is not set, or if the
value is null
public String getProperty(String name)
name
- the property name, not null
null
if no value is setpublic boolean getProperty(String name, boolean defaultValue)
null
.
A value defined as some other type than boolean is converted according to JavaScript semantics:
true
, except for the empty string.
true
, except for 0 and
NaN
.
true
.
name
- the property name, not null
defaultValue
- the value to return if the property is not set, or if the
value is null
public double getProperty(String name, double defaultValue)
null
A value defined as some other type than double is converted according to JavaScript semantics:
NaN
is returned if
the string can't be parsed.
true
is 1, boolean false
is 0.
NaN
.
name
- the property name, not null
defaultValue
- the value to return if the property is not set, or if the
value is null
public int getProperty(String name, int defaultValue)
null
The value is converted in the same way as for
getProperty(String, double)
, and then truncated to
int
.
name
- the property name, not null
defaultValue
- the value to return if the property is not set, or if the
value is null
public Serializable getPropertyRaw(String name)
String
, Double
, Boolean
or
JsonValue
. null
is returned if there is no property
with the given name or if the value is set to null
.name
- the property name, not nullnull
public Element removeProperty(String name)
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
name
- the property name, not null
public boolean hasProperty(String name)
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
name
- the property name, not null
true
if the property is present; otherwise
false
public Stream<String> getPropertyNames()
Note that properties changed on the server are updated on the client but
changes made on the client side are not reflected back to the server
unless configured using addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
public boolean isTextNode()
true
if this element is a text node; otherwise
false
public Element setText(String textContent)
textContent
- the text content to set, null
is interpreted as
an empty stringpublic String getText()
getTextRecursively()
to get the full text that recursively
includes the text content of the entire element tree.getTextRecursively()
,
setText(String)
public String getTextRecursively()
getText()
to only
get the text from text nodes that are immediate children of this element.getText()
public ClassList getClassList()
class
attribute.
Despite the name implying a list being returned, the return type is
actually a Set
since the in-browser return value behaves like a
Set
in Java.
null
public ThemeList getThemeList()
theme
attribute. The set returned can be modified to add or
remove the theme names, changes to the set will be reflected in the
attribute value.
Despite the name implying a list being returned, the return type is
actually a Set
since the in-browser return value behaves like a
Set
in Java.
null
public Style getStyle()
@Deprecated public Element synchronizeProperty(String property, String eventType)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.property
's value when the given
eventType
occurs on this element on the client side. As a result
the property
's value is automatically updated to this
Element
.
Only properties which can be set using setProperty can be synchronized, e.g. classList cannot be synchronized.
This is convenience method for batching
addSynchronizedProperty(String)
and
addSynchronizedPropertyEvent(String)
.
The method is shorthand for
synchronizeProperty(String, String, DisabledUpdateMode)
with
DisabledUpdateMode.ONLY_WHEN_ENABLED parameter value.
property
- the property name to synchronizeeventType
- the client side event which trigger synchronization of the
property values to the serversynchronizeProperty(String, String, DisabledUpdateMode)
@Deprecated public Element synchronizeProperty(String property, String eventType, DisabledUpdateMode mode)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.property
's value when the given
eventType
occurs on this element on the client side. As a result
the property
's value is automatically updated to this
Element
.
Only properties which can be set using setProperty can be synchronized, e.g. classList cannot be synchronized.
When multiple update mode settings are defined for the same property, the most permissive mode is used. This means that there might be unexpected updates for a disabled component if multiple parties independently configure different aspects for the same component. This is based on the assumption that if a property is explicitly safe to update for disabled components in one context, then the nature of that property is probably such that it's also safe to update in other contexts.
This is convenience method for batching
addSynchronizedProperty(String, DisabledUpdateMode)
and
addSynchronizedPropertyEvent(String)
.
property
- the property name to synchronizeeventType
- the client side event which trigger synchronization of the
property values to the servermode
- controls property update from the client side to the server
side when the element is disabled, not null
@Deprecated public Element addSynchronizedProperty(String property)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.Element
.
Synchronization takes place whenever one of the events defined using
addSynchronizedPropertyEvent(String)
is fired for the element.
Only properties which can be set using setProperty can be synchronized, e.g. classList cannot be synchronized.
The method is shorthand for
addSynchronizedProperty(String, DisabledUpdateMode)
with
DisabledUpdateMode.ONLY_WHEN_ENABLED parameter value.
addSynchronizedProperty(String, DisabledUpdateMode)
property
- the property name to synchronize@Deprecated public Element addSynchronizedProperty(String property, DisabledUpdateMode mode)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.Element
.
Synchronization takes place whenever one of the events defined using
addSynchronizedPropertyEvent(String)
is fired for the element.
Only properties which can be set using setProperty can be synchronized, e.g. classList cannot be synchronized.
When multiple update mode settings are defined for the same property, the most permissive mode is used. This means that there might be unexpected updates for a disabled component if multiple parties independently configure different aspects for the same component. This is based on the assumption that if a property is explicitly safe to update for disabled components in one context, then the nature of that property is probably such that it's also safe to update in other contexts.
property
- the property name to synchronizemode
- controls property update from the client side to the server
side when the element is disabled, not null
@Deprecated public Element addSynchronizedPropertyEvent(String eventType)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.Synchronization takes place whenever one of the given events is fired for the element (on the client side).
Use addSynchronizedProperty(String)
to define which properties
to synchronize.
eventType
- the client side event which trigger synchronization of the
property values to the server@Deprecated public Element removeSynchronizedProperty(String property)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.getSynchronizedProperties()
).property
- the property name to removeaddSynchronizedProperty(String)
@Deprecated public Element removeSynchronizedPropertyEvent(String eventType)
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.getSynchronizedPropertyEvents()
).eventType
- the client side event which trigger synchronization of the
property values to the serveraddSynchronizedPropertyEvent(String)
@Deprecated public Stream<String> getSynchronizedProperties()
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.Element
.addSynchronizedProperty(String)
,
addSynchronizedPropertyEvent(String)
@Deprecated public Stream<String> getSynchronizedPropertyEvents()
addPropertyChangeListener(String, String, PropertyChangeListener)
or
DomListenerRegistration.synchronizeProperty(String)
instead.addSynchronizedProperty(String)
,
addSynchronizedPropertyEvent(String)
public Optional<Component> getComponent()
public Registration addAttachListener(ElementAttachListener attachListener)
When a hierarchy of elements is being attached, the event is fired child-first.
attachListener
- the attach listener to addpublic Registration addDetachListener(ElementDetachListener detachListener)
When a hierarchy of elements is being detached, the event is fired child-first.
detachListener
- the detach listener to addpublic String getOuterHTML()
This operation recursively iterates the element and all children and should not be called unnecessarily.
public <T extends Component> T as(Class<T> componentType)
You can use this method when you have an element instance and want to use
it through the API of a Component
class.
This method makes the component instance use the underlying element but
does not attach the new component instance to the element so that
getComponent()
would return the component instance. This
means that getParent()
, getChildren()
and possibly
other methods which rely on Element
-> Component
mappings will not work.
To also map the element to the Component
instance, use
Component.from(Element, Class)
T
- the component typecomponentType
- the component typeComponent.from(Element, Class)
@Deprecated public void callFunction(String functionName, Serializable... arguments)
callJsFunction(String,Serializable...)
instead
since it also allows getting return value back.
The function will be called after all pending DOM updates have completed,
at the same time that Page.executeJs(String, Serializable...)
calls are invoked.
If the element is not attached, the function call will be deferred until the element is attached.
functionName
- the name of the function to call, may contain dots to indicate
a function on a property.arguments
- the arguments to pass to the function. Must be of a type
supported by the communication mechanism, as defined by
JsonCodec
JsonCodec for supported argument types
public PendingJavaScriptResult callJsFunction(String functionName, Serializable... arguments)
It is possible to get access to the return value of the execution by registering a handler with the returned pending result. If no handler is registered, the return value will be ignored.
The function will be called after all pending DOM updates have completed,
at the same time that Page.executeJs(String, Serializable...)
calls are invoked.
If the element is not attached or not visible, the function call will be deferred until the element is attached and visible.
functionName
- the name of the function to call, may contain dots to indicate
a function on a property.arguments
- the arguments to pass to the function. Must be of a type
supported by the communication mechanism, as defined by
JsonCodec
JsonCodec for supported argument types
@Deprecated public void executeJavaScript(String expression, Serializable... parameters)
executeJs(String,Serializable...)
instead since
it also allows getting return value back.this
. The given parameters will be available as variables
named $0
, $1
, and so on. Supported parameter
types are:
String
Integer
Double
Boolean
JsonValue
Element
(will be sent as null
if the server-side
element instance is not attached when the invocation is sent to the
client)
'prefix' + $0
instead of 'prefix$0'
and
value[$0]
instead of value.$0
since JavaScript
variables aren't evaluated inside strings or property names.expression
- the JavaScript expression to invokeparameters
- parameters to pass to the expressionpublic PendingJavaScriptResult executeJs(String expression, Serializable... parameters)
PendingJavaScriptResult
can be used to retrieve any
return
value from the JavaScript expression. If no return
value handler is registered, the return value will be ignored.
This element will be available to the expression as this
.
The given parameters will be available as variables named
$0
, $1
, and so on. Supported parameter types
are:
String
Integer
Double
Boolean
JsonValue
Element
(will be sent as null
if the server-side
element instance is not attached when the invocation is sent to the
client)
'prefix' + $0
instead of 'prefix$0'
and
value[$0]
instead of value.$0
since JavaScript
variables aren't evaluated inside strings or property names.
If the element is not attached or not visible, the function call will be deferred until the element is attached and visible.
expression
- the JavaScript expression to invokeparameters
- parameters to pass to the expressionpublic ShadowRoot attachShadow()
public Optional<ShadowRoot> getShadowRoot()
public Element setVisible(boolean visible)
visible
- the element visibility valuepublic boolean isVisible()
true
if the element is visible, false
otherwisepublic Element setEnabled(boolean enabled)
enabled
- the enabled statepublic boolean isEnabled()
Object may be enabled by itself by but if its ascendant is disabled then it's considered as (implicitly) disabled.
true
if node is enabled, false
otherwiseCopyright © 2025. All rights reserved.