Interface UiStyles


public interface UiStyles
Container for styles.
  • Field Details

  • Method Details

    • get

      String get()
      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 PATTERN_SINGLE. Any number of styles or in other words the result of this has to match PATTERN_MULTIPLE. The first style is called the primary style.
      Returns:
      the style(s) of this object.
    • set

      void set(String styles)
      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.
    • contains

      boolean contains(String style)
      Parameters:
      style - is the style to check.
      Returns:
      true if the given style is present in the styles, false otherwise.
    • add

      boolean add(String style)
      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

      boolean remove(String style)
      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

      String getPrimary()
      Returns:
      the primary style of this widget. Will be null if not defined.
    • setPrimary

      void setPrimary(String primaryStyle)
      Parameters:
      primaryStyle - is the new value of getPrimary().