Package org.openhab.core.ui.components
Class RootUIComponent
java.lang.Object
org.openhab.core.ui.components.UIComponent
org.openhab.core.ui.components.RootUIComponent
- All Implemented Interfaces:
Identifiable<String>
A root component is a special type of
UIComponent
at the root of the hierarchy.
It has a number of specific parameters, a set of tags, a timestamp, some configurable
parameters ("props") and is identifiable by its UID (generally a GUID).- Author:
- Yannick Schaus - Initial contribution
-
Constructor Summary
ConstructorDescriptionEmpty constructor for deserialization.RootUIComponent
(String name) Constructs a root component.RootUIComponent
(String uid, String name) Constructs a root component with a specific UID. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a tag to the componentvoid
Adds several tags to the componentvoid
addTags
(Collection<String> tags) Adds several tags to the componentgetProps()
Gets the configurable parameters ("props") of the componentgetTags()
Gets the set of tags attached to the component@Nullable Date
Gets the timestamp of the componentgetUID()
Get the unique identifier.boolean
Returns whether the component has a certain tagvoid
Removes all tags on the componentvoid
Removes a tag on a componentvoid
setProps
(ConfigDescriptionDTO props) Sets the configurable parameters ("props") of the componentvoid
setTimestamp
(Date date) Sets the specified timestamp of the componentvoid
Updates the timestamp of the component to the current date and time.Methods inherited from class org.openhab.core.ui.components.UIComponent
addComponent, addConfig, addSlot, getComponent, getConfig, getSlot, getSlots, getType, setComponent, setConfig, setSlots
-
Constructor Details
-
RootUIComponent
public RootUIComponent()Empty constructor for deserialization. -
RootUIComponent
Constructs a root component.- Parameters:
name
- the name of the UI component to render on client frontends, ie. "oh-block"
-
RootUIComponent
Constructs a root component with a specific UID.- Parameters:
uid
- the UID of the new cardname
- the name of the UI component to render on client frontends, ie. "oh-block"
-
-
Method Details
-
getUID
Description copied from interface:Identifiable
Get the unique identifier.- Specified by:
getUID
in interfaceIdentifiable<String>
- Returns:
- the unique identifier
-
getTags
Gets the set of tags attached to the component- Returns:
- the card tags
-
getTimestamp
Gets the timestamp of the component- Returns:
- the timestamp
-
setTimestamp
Sets the specified timestamp of the component- Parameters:
date
- the timestamp
-
updateTimestamp
public void updateTimestamp()Updates the timestamp of the component to the current date and time. -
hasTag
Returns whether the component has a certain tag- Parameters:
tag
- the tag to check- Returns:
- true if the component is tagged with the specified tag
-
addTag
Adds a tag to the component- Parameters:
tag
- the tag to add
-
addTags
Adds several tags to the component- Parameters:
tags
- the tags to add
-
addTags
Adds several tags to the component- Parameters:
tags
- the tags to add
-
removeTag
Removes a tag on a component- Parameters:
tag
- the tag to remove
-
removeAllTags
public void removeAllTags()Removes all tags on the component -
getProps
Gets the configurable parameters ("props") of the component- Returns:
- the configurable parameters
-
setProps
Sets the configurable parameters ("props") of the component- Parameters:
props
- the configurable parameters
-