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 Details

    • getParent

      @Nullable Parent getParent()
      Get the direct parent Widget or Sitemap.
      Returns:
      parent
    • setParent

      void setParent(Parent parent)
      Sets the parent Widget or Sitemap. Widgets in a sitemap should always have a parent. Implementations of Widget should have a constructor with Parent parameter 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

      void setItem(@Nullable String item)
      Sets the widget item.
      Parameters:
      item -
    • getLabel

      @Nullable String getLabel()
      Get widget label.
      Returns:
      label
    • setLabel

      void setLabel(@Nullable String label)
      Set widget label.
      Parameters:
      label -
    • getIcon

      @Nullable String getIcon()
      Get widget icon.
      Returns:
      icon
    • setIcon

      void setIcon(@Nullable String icon)
      Set widget icon.
      Parameters:
      icon -
    • getIconRules

      List<Rule> getIconRules()
      Get the widget icon rules. This method should return a modifiable list, allowing updates to the icon rules.
      Returns:
      icon rules
    • setIconRules

      void setIconRules(List<Rule> iconRules)
      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

      void setStaticIcon(@Nullable Boolean staticIcon)
      Set to true if the widget icon is static.
      Parameters:
      staticIcon -
    • getLabelColor

      List<Rule> 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

      void setLabelColor(List<Rule> labelColorRules)
      Replace the widget label color rules with a new list of label color rules.
      Parameters:
      labelColorRules -
    • getValueColor

      List<Rule> 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

      void setValueColor(List<Rule> valueColorRules)
      Replace the widget value color rules with a new list of value color rules.
      Parameters:
      valueColorRules -
    • getIconColor

      List<Rule> 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

      void setIconColor(List<Rule> iconColorRules)
      Replace the widget icon color rules with a new list of icon color rules.
      Parameters:
      iconColorRules -
    • getVisibility

      List<Rule> getVisibility()
      Get the widget visibility rules. This method should return a modifiable list, allowing updates to the visibility rules.
      Returns:
      visibility rules
    • setVisibility

      void setVisibility(List<Rule> visibilityRules)
      Replace the widget visibility rules with a new list of visibility rules.
      Parameters:
      visibilityRules -
    • getWidgetType

      String getWidgetType()
      Get type of widget.
      Returns:
      widget type