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(SelectorModel<E> selectorModel) SimpleStylesheetsManager(SelectorModel<E> selectorModel, List<CssFunction<E>> functions) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStylesheet(javafx.css.StyleOrigin origin, String str, @Nullable URI documentHome) Adds a stylesheet with the specified origin.voidaddStylesheet(javafx.css.StyleOrigin origin, URI stylesheetUri, @Nullable URI documentHome) Adds a stylesheet with the specified origin.voidaddStylesheet(javafx.css.StyleOrigin origin, Stylesheet stylesheet) Adds a stylesheet with the specified origin.voidapplyStylesheetsTo(E elem) Applies all managed stylesheets to the specified element.voidapplyStylesheetsTo(Iterable<E> iterable) booleanapplyStylesheetTo(javafx.css.StyleOrigin styleOrigin, Stylesheet s, E elem, boolean suppressParseException) Applies the provided stylesheet.voidclearStylesheets(@Nullable javafx.css.StyleOrigin origin) Removes all stylesheets with the specified origin.protected Collection<SimpleStylesheetsManager<E>.StylesheetEntry> @Nullable StringList<CssFunction<E>> Returns a localized help text.protected Collection<SimpleStylesheetsManager<E>.StylesheetEntry> Returns the logger.Returns the selector model of the style manager.protected Collection<SimpleStylesheetsManager<E>.StylesheetEntry> booleanvoidsetDefaultNamespace(@Nullable String defaultNamespace) voidsetFunctions(List<CssFunction<E>> functions) voidSets the logger.voidsetParserFactory(Supplier<CssParser> parserFactory) voidsetSelectorModel(SelectorModel<E> newValue) <T> voidsetStylesheets(javafx.css.StyleOrigin origin, @Nullable URI documentHome, @Nullable List<T> stylesheets) Sets a list of stylesheets with the specified origin.voidsetUriResolver(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
-
-
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(javafx.css.StyleOrigin origin, 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
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
public void clearStylesheets(@Nullable javafx.css.StyleOrigin origin) 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(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
-
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(javafx.css.StyleOrigin styleOrigin, Stylesheet s, 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
-