Interface StylesheetsManager<E>

Type Parameters:
E - the element type that can be styled by this style manager
All Known Implementing Classes:
SimpleStylesheetsManager

public interface StylesheetsManager<E>
StylesheetsManager.
Author:
Werner Randelshofer
  • Method Details

    • addStylesheet

      default void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull URI url)
      Adds a stylesheet with the specified origin.
      Parameters:
      origin - the style origin
      url - the stylesheet url
    • addStylesheet

      void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull URI stylesheetUri, @NonNull URI documentHome)
      Adds a stylesheet with the specified origin.
      Parameters:
      origin - the style origin
      stylesheetUri - the stylesheet url
      documentHome - the document Home url
    • addStylesheet

      void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull Stylesheet stylesheet)
      Adds a stylesheet with the specified origin.
      Parameters:
      origin - the style origin
      stylesheet - the stylesheet
    • addStylesheet

      void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull String stylesheet, @Nullable URI documentHome)
      Adds a stylesheet with the specified origin.
      Parameters:
      origin - the style origin
      stylesheet - the stylesheet given as a literal string
    • applyStylesheetsTo

      default void applyStylesheetsTo(@NonNull Iterable<E> iterable)
    • clearStylesheets

      void clearStylesheets(javafx.css.StyleOrigin origin)
      Removes all stylesheets with the specified origin.
      Parameters:
      origin - the style origin
    • setStylesheets

      default <T> void setStylesheets(javafx.css.StyleOrigin origin, List<T> stylesheets)
      Sets a list of stylesheets with the specified origin.
      Type Parameters:
      T - type of the list elements
      Parameters:
      origin - the origin
      stylesheets - list elements can be Strings or URIs.
    • setStylesheets

      <T> void setStylesheets(javafx.css.StyleOrigin origin, URI documentHome, List<T> stylesheets)
      Sets a list of stylesheets with the specified origin.
      Type Parameters:
      T - type of the list elements
      Parameters:
      origin - the origin
      documentHome - the document home
      stylesheets - list elements can be Strings or URIs.
    • applyStylesheetsTo

      void applyStylesheetsTo(E e)
      Applies all managed stylesheets to the specified element.
      Parameters:
      e - The element
    • getSelectorModel

      @NonNull SelectorModel<E> getSelectorModel()
      Returns the selector model of the style manager.
      Returns:
      the selector model
    • applyStylesheetTo

      boolean applyStylesheetTo(javafx.css.StyleOrigin styleOrigin, Stylesheet s, E element, boolean suppressParseException) throws ParseException
      Applies the provided stylesheet.
      Parameters:
      styleOrigin - the style origin to be used when setting attribute values
      s - the stylesheet
      element - the element
      suppressParseException - if parse exceptions should be suppressed
      Returns:
      true if an element was selected
      Throws:
      ParseException - on parse exception
    • matchesElement

      default boolean matchesElement(@NonNull Stylesheet s, E elem)
      Returns true if the provided stylesheet has selectors which match the specified element.
      Parameters:
      s - the stylesheet
      elem - the element
      Returns:
      true the element was selected
    • getMatchingRulesForElement

      default List<StyleRule> getMatchingRulesForElement(@NonNull Stylesheet s, E elem)
    • getLogger

      Returns the logger.
      Returns:
      the logger
      See Also:
    • setLogger

      void setLogger(@NonNull Consumer3<Level,String,Throwable> logger)
      Sets the logger.

      By default, this class does not log anything.

      A good logger value would be:

       (l, s,t)->Logger.getLogger(SimpleStylesheetsManager.class.getName()).log(l,s,t);
       
      Parameters:
      logger - a logger
    • getHelpText

      String getHelpText()
      Returns a localized help text.
      Returns:
      the help text
    • getStylesheets

    • hasStylesheets

      default boolean hasStylesheets()