- 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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStylesheet(javafx.css.StyleOrigin origin, String stylesheet, @Nullable URI documentHome) Adds a stylesheet with the specified origin.default voidaddStylesheet(javafx.css.StyleOrigin origin, URI url) Adds a stylesheet with the specified origin.voidaddStylesheet(javafx.css.StyleOrigin origin, URI stylesheetUri, URI documentHome) Adds a stylesheet with the specified origin.voidaddStylesheet(javafx.css.StyleOrigin origin, Stylesheet stylesheet) Adds a stylesheet with the specified origin.voidApplies all managed stylesheets to the specified element.default voidapplyStylesheetsTo(Iterable<E> iterable) booleanapplyStylesheetTo(javafx.css.StyleOrigin styleOrigin, Stylesheet s, E element, boolean suppressParseException) Applies the provided stylesheet.voidclearStylesheets(javafx.css.StyleOrigin origin) Removes all stylesheets with the specified origin.Returns a localized help text.Returns the logger.getMatchingRulesForElement(Stylesheet s, E elem) Returns the selector model of the style manager.default booleandefault booleanmatchesElement(Stylesheet s, E elem) Returns true if the provided stylesheet has selectors which match the specified element.voidSets the logger.<T> voidsetStylesheets(javafx.css.StyleOrigin origin, URI documentHome, List<T> stylesheets) Sets a list of stylesheets with the specified origin.default <T> voidsetStylesheets(javafx.css.StyleOrigin origin, List<T> stylesheets) Sets a list of stylesheets with the specified origin.
-
Method Details
-
addStylesheet
Adds a stylesheet with the specified origin.- Parameters:
origin- the style originurl- the stylesheet url
-
addStylesheet
Adds a stylesheet with the specified origin.- Parameters:
origin- the style originstylesheetUri- the stylesheet urldocumentHome- the document Home url
-
addStylesheet
Adds a stylesheet with the specified origin.- Parameters:
origin- the style originstylesheet- the stylesheet
-
addStylesheet
Adds a stylesheet with the specified origin.- Parameters:
origin- the style originstylesheet- the stylesheet given as a literal string
-
applyStylesheetsTo
-
clearStylesheets
void clearStylesheets(javafx.css.StyleOrigin origin) Removes all stylesheets with the specified origin.- Parameters:
origin- the style origin
-
setStylesheets
Sets a list of stylesheets with the specified origin.- Type Parameters:
T- type of the list elements- Parameters:
origin- the originstylesheets- list elements can be Strings or URIs.
-
setStylesheets
Sets a list of stylesheets with the specified origin.- Type Parameters:
T- type of the list elements- Parameters:
origin- the origindocumentHome- the document homestylesheets- list elements can be Strings or URIs.
-
applyStylesheetsTo
Applies all managed stylesheets to the specified element.- Parameters:
e- The element
-
getSelectorModel
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 valuess- the stylesheetelement- the elementsuppressParseException- if parse exceptions should be suppressed- Returns:
- true if an element was selected
- Throws:
ParseException- on parse exception
-
matchesElement
Returns true if the provided stylesheet has selectors which match the specified element.- Parameters:
s- the stylesheetelem- the element- Returns:
- true the element was selected
-
getMatchingRulesForElement
-
getLogger
Returns the logger.- Returns:
- the logger
- See Also:
-
setLogger
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
List<StylesheetsManager.StylesheetInfo> getStylesheets() -
hasStylesheets
default boolean hasStylesheets()
-