java.lang.Object
org.jhotdraw8.css.manager.SimpleStylesheetsManager<E>
- Type Parameters:
E- the element type that can be styled by this style manager
- All Implemented Interfaces:
StylesheetsManager<E>
SimpleStylesheetsManager.
- Author:
- Werner Randelshofer
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.jhotdraw8.css.manager.StylesheetsManager
StylesheetsManager.StylesheetInfo -
Constructor Summary
ConstructorsConstructorDescriptionSimpleStylesheetsManager(@NonNull SelectorModel<E> selectorModel) SimpleStylesheetsManager(@NonNull SelectorModel<E> selectorModel, @NonNull List<CssFunction<E>> functions) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull String str, @Nullable URI documentHome) Adds a stylesheet with the specified origin.voidaddStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull URI stylesheetUri, @Nullable URI documentHome) Adds a stylesheet with the specified origin.voidaddStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull Stylesheet stylesheet) Adds a stylesheet with the specified origin.voidapplyStylesheetsTo(@NonNull E elem) Applies all managed stylesheets to the specified element.voidapplyStylesheetsTo(@NonNull Iterable<E> iterable) booleanapplyStylesheetTo(@NonNull javafx.css.StyleOrigin styleOrigin, @NonNull Stylesheet s, @NonNull E elem, boolean suppressParseException) Applies the provided stylesheet.voidclearStylesheets(@Nullable javafx.css.StyleOrigin origin) Removes all stylesheets with the specified origin.protected @NonNull Collection<SimpleStylesheetsManager<E>.StylesheetEntry> Returns a localized help text.protected @NonNull Collection<SimpleStylesheetsManager<E>.StylesheetEntry> Returns the logger.Returns the selector model of the style manager.protected @NonNull Collection<SimpleStylesheetsManager<E>.StylesheetEntry> booleanvoidsetDefaultNamespace(@Nullable String defaultNamespace) voidsetFunctions(@NonNull List<CssFunction<E>> functions) voidSets the logger.voidsetParserFactory(@NonNull Supplier<CssParser> parserFactory) voidsetSelectorModel(@NonNull SelectorModel<E> newValue) <T> voidsetStylesheets(@NonNull javafx.css.StyleOrigin origin, @Nullable URI documentHome, @Nullable List<T> stylesheets) Sets a list of stylesheets with the specified origin.voidsetUriResolver(@NonNull UriResolver uriResolver) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.css.manager.StylesheetsManager
addStylesheet, getMatchingRulesForElement, matchesElement, setStylesheets
-
Constructor Details
-
SimpleStylesheetsManager
-
SimpleStylesheetsManager
public SimpleStylesheetsManager(@NonNull SelectorModel<E> selectorModel, @NonNull List<CssFunction<E>> functions)
-
-
Method Details
-
setSelectorModel
-
getSelectorModel
Description copied from interface:StylesheetsManagerReturns the selector model of the style manager.- Specified by:
getSelectorModelin interfaceStylesheetsManager<E>- Returns:
- the selector model
-
getLogger
Description copied from interface:StylesheetsManagerReturns the logger.- Specified by:
getLoggerin interfaceStylesheetsManager<E>- Returns:
- the logger
- See Also:
-
setLogger
Description copied from interface:StylesheetsManagerSets 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);
- Specified by:
setLoggerin interfaceStylesheetsManager<E>- Parameters:
logger- a logger
-
addStylesheet
public void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull URI stylesheetUri, @Nullable URI documentHome) Description copied from interface:StylesheetsManagerAdds a stylesheet with the specified origin.- Specified by:
addStylesheetin interfaceStylesheetsManager<E>- Parameters:
origin- the style originstylesheetUri- the stylesheet urldocumentHome- the document Home url
-
addStylesheet
Description copied from interface:StylesheetsManagerAdds a stylesheet with the specified origin.- Specified by:
addStylesheetin interfaceStylesheetsManager<E>- Parameters:
origin- the style originstylesheet- the stylesheet
-
addStylesheet
public void addStylesheet(@NonNull javafx.css.StyleOrigin origin, @NonNull String str, @Nullable URI documentHome) Description copied from interface:StylesheetsManagerAdds a stylesheet with the specified origin.- Specified by:
addStylesheetin interfaceStylesheetsManager<E>- Parameters:
origin- the style originstr- the stylesheet given as a literal string
-
clearStylesheets
Description copied from interface:StylesheetsManagerRemoves all stylesheets with the specified origin.- Specified by:
clearStylesheetsin interfaceStylesheetsManager<E>- Parameters:
origin- the style origin
-
setStylesheets
public <T> void setStylesheets(@NonNull javafx.css.StyleOrigin origin, @Nullable URI documentHome, @Nullable List<T> stylesheets) Description copied from interface:StylesheetsManagerSets a list of stylesheets with the specified origin.- Specified by:
setStylesheetsin interfaceStylesheetsManager<E>- Type Parameters:
T- type of the list elements- Parameters:
origin- the origindocumentHome- the document homestylesheets- list elements can be Strings or URIs.
-
getAuthorStylesheets
-
getUserAgentStylesheets
protected @NonNull Collection<SimpleStylesheetsManager<E>.StylesheetEntry> getUserAgentStylesheets() -
getInlineStylesheets
-
applyStylesheetsTo
Description copied from interface:StylesheetsManagerApplies all managed stylesheets to the specified element.- Specified by:
applyStylesheetsToin interfaceStylesheetsManager<E>- Parameters:
elem- The element
-
applyStylesheetsTo
- Specified by:
applyStylesheetsToin interfaceStylesheetsManager<E>
-
applyStylesheetTo
public boolean applyStylesheetTo(@NonNull javafx.css.StyleOrigin styleOrigin, @NonNull Stylesheet s, @NonNull E elem, boolean suppressParseException) throws ParseException Description copied from interface:StylesheetsManagerApplies the provided stylesheet.- Specified by:
applyStylesheetToin interfaceStylesheetsManager<E>- Parameters:
styleOrigin- the style origin to be used when setting attribute valuess- the stylesheetelem- the elementsuppressParseException- if parse exceptions should be suppressed- Returns:
- true if an element was selected
- Throws:
ParseException- on parse exception
-
getFunctions
-
setFunctions
-
getHelpText
Description copied from interface:StylesheetsManagerReturns a localized help text.- Specified by:
getHelpTextin interfaceStylesheetsManager<E>- Returns:
- the help text
-
getStylesheets
- Specified by:
getStylesheetsin interfaceStylesheetsManager<E>
-
hasStylesheets
public boolean hasStylesheets()- Specified by:
hasStylesheetsin interfaceStylesheetsManager<E>
-
getParserFactory
-
setParserFactory
-
getUriResolver
-
setUriResolver
-
getDefaultNamespace
-
setDefaultNamespace
-