Class UiStylesImpl

    • Constructor Detail

      • UiStylesImpl

        public UiStylesImpl()
        The constructor.
    • Method Detail

      • get

        public final String get()
        Description copied from interface: UiStyles
        This method gets the style(s) (also called style-name(s)) of this object. The style defines aspects for the appearance (look & feel) of a UI element when displayed to the user.
        If you are familiar with web-technology just think of this as the class attribute of HTML elements that are then configured via some cascading style sheet (CSS).
        The following situations can be distinguished:
        • no style
          The empty string is returned.
        • single style
          The name of that single style is returned. The result does NOT contain any whitespace.
        • multiple styles
          The list of individual styles are separated by whitespaces in the result.
        Each individual style has to match UiStyles.PATTERN_SINGLE. Any number of styles or in other words the result of this has to match UiStyles.PATTERN_MULTIPLE. The first style is called the primary style.
        Specified by:
        get in interface UiStyles
        Returns:
        the style(s) of this object.
      • set

        public final void set​(String styles)
        Specified by:
        set in interface UiStyles
        Parameters:
        styles - the new styles. Either a single style or a list of styles separated by whitespaces. Use the empty string to unset all styles.
      • onStylesChanged

        protected void onStylesChanged()
        Triggered whenever the styles changed.
      • contains

        public final boolean contains​(String style)
        Specified by:
        contains in interface UiStyles
        Parameters:
        style - is the style to check.
        Returns:
        true if the given style is present in the styles, false otherwise.
      • add

        public final boolean add​(String style)
        Specified by:
        add in interface UiStyles
        Parameters:
        style - is the style to add. If this style is already contained in the styles, this will have no effect.
        Returns:
        true if the style has actually been added, false if it was already present before.
      • remove

        public final boolean remove​(String style)
        Specified by:
        remove in interface UiStyles
        Parameters:
        style - is the style to remove. If this style is not contained in the styles, this will have no effect.
        Returns:
        true if the given style has actually been removed, false otherwise (if it was not present).
      • getPrimary

        public final String getPrimary()
        Specified by:
        getPrimary in interface UiStyles
        Returns:
        the primary style of this widget. Will be null if not defined.