Package org.openhab.core.sitemap
Interface Widget
- All Known Subinterfaces:
Button,Buttongrid,Chart,Colorpicker,Colortemperaturepicker,Default,Frame,Group,Image,Input,LinkableWidget,Mapview,NonLinkableWidget,Selection,Setpoint,Slider,Switch,Text,Video,Webview
@NonNullByDefault
public interface Widget
A representation of a sitemap widget.
- Author:
- Mark Herwege - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetIcon()Get widget icon.Get the widget icon color rules.Get the widget icon rules.@Nullable StringgetItem()Gets the item name for the widget.@Nullable StringgetLabel()Get widget label.Get the widget label color rules.@Nullable ParentGet the widget value color rules.Get the widget visibility rules.Get type of widget.booleanTrue if the widget icon is static, false otherwise.voidSet widget icon.voidsetIconColor(List<Rule> iconColorRules) Replace the widget icon color rules with a new list of icon color rules.voidsetIconRules(List<Rule> iconRules) Replace the widget icon rules with a new list of icon rules.voidSets the widget item.voidSet widget label.voidsetLabelColor(List<Rule> labelColorRules) Replace the widget label color rules with a new list of label color rules.voidvoidsetStaticIcon(@Nullable Boolean staticIcon) Set to true if the widget icon is static.voidsetValueColor(List<Rule> valueColorRules) Replace the widget value color rules with a new list of value color rules.voidsetVisibility(List<Rule> visibilityRules) Replace the widget visibility rules with a new list of visibility rules.
-
Method Details
-
getParent
@Nullable Parent getParent()- Returns:
- parent
-
setParent
Sets the parentWidgetorSitemap. Widgets in a sitemap should always have a parent. Implementations ofWidgetshould have a constructor withParentparameter to make building a sitemap easier.- Parameters:
parent-
-
getItem
@Nullable String getItem()Gets the item name for the widget. For specific widget type, the item is required and for these widgets, this method should not return null.- Returns:
- item, or null if no item defined for the widget
-
setItem
Sets the widget item.- Parameters:
item-
-
getLabel
@Nullable String getLabel()Get widget label.- Returns:
- label
-
setLabel
Set widget label.- Parameters:
label-
-
getIcon
@Nullable String getIcon()Get widget icon.- Returns:
- icon
-
setIcon
Set widget icon.- Parameters:
icon-
-
getIconRules
Get the widget icon rules. This method should return a modifiable list, allowing updates to the icon rules.- Returns:
- icon rules
-
setIconRules
Replace the widget icon rules with a new list of icon rules.- Parameters:
iconRules-
-
isStaticIcon
boolean isStaticIcon()True if the widget icon is static, false otherwise.- Returns:
- static icon
-
setStaticIcon
Set to true if the widget icon is static.- Parameters:
staticIcon-
-
getLabelColor
Get the widget label color rules. This method should return a modifiable list, allowing updates to the label color rules.- Returns:
- label color rules
-
setLabelColor
Replace the widget label color rules with a new list of label color rules.- Parameters:
labelColorRules-
-
getValueColor
Get the widget value color rules. This method should return a modifiable list, allowing updates to the value color rules.- Returns:
- value color rules
-
setValueColor
Replace the widget value color rules with a new list of value color rules.- Parameters:
valueColorRules-
-
getIconColor
Get the widget icon color rules. This method should return a modifiable list, allowing updates to the icon color rules.- Returns:
- icon color rules
-
setIconColor
Replace the widget icon color rules with a new list of icon color rules.- Parameters:
iconColorRules-
-
getVisibility
Get the widget visibility rules. This method should return a modifiable list, allowing updates to the visibility rules.- Returns:
- visibility rules
-
setVisibility
Replace the widget visibility rules with a new list of visibility rules.- Parameters:
visibilityRules-
-
getWidgetType
String getWidgetType()Get type of widget.- Returns:
- widget type
-