Class StylesheetURLHandler
java.lang.Object
java.net.URLStreamHandler
atlantafx.base.theme.StylesheetURLHandler
A custom
URLStreamHandler that intercepts URLs using the "stylesheet" scheme
to support modular CSS stylesheet loading.
The handler processes URIs formatted as stylesheet:/path/to/theme.css?modules=mod1,mod2.
When a request contains a modules query parameter, the handler looks for an accompanying
manifest file (e.g., theme.manifest) alongside the base CSS file to load and serve
only the specified style modules.
The manifest file MUST be located in the same directory as the target stylesheet, sharing
the same file name with a .manifest extension (e.g., foo.css.manifest for foo.css).
If the modules parameter is omitted, the manifest file is missing, or an error occurs
during module extraction, the handler falls back to reading and returning the entire CSS file.
Usage Example:
// loads only the 'button' and 'tooltip' modules from foo.css
String url = "stylesheet:/foo.css?modules=button,tooltip";
Application.setUserAgentStylesheet(url);
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
-
Field Details
-
SCHEME
- See Also:
-
-
Constructor Details
-
StylesheetURLHandler
public StylesheetURLHandler()
-
-
Method Details
-
openConnection
- Specified by:
openConnectionin classURLStreamHandler
-