-
Enhancement
-
Resolution: Fixed
-
P2
-
8
Today it is not possible to change a user_agent stylesheet (theme) for a separate window (i.e. a different Scene). When setting the user_agent css, the whole application is impacted.
This is required for applications such as Scene Builder, which needs to view a user design with different styles: Caspian, themes related to embedded or touch devices, etc... without impacting the theme of SB itself.
Based on feedback from the SceneBuilder team, the current proposal is to add the following API to SubScene. The API will also be added to Scene to keep the two parallel.
Note that a user-agent stylesheet set on a SubScene or Scene will be used _in place of_ the platform-default user-agent stylesheet (which, in 1.8, is modena). Support is being added for @import make it easier to customize something like caspian or modena without having to duplicate all of the rules.
public ObjectProperty<String> userAgentStylesheetProperty()
/**
* Get the URL of the user-agent stylesheet that will be used by this SubScene. If the URL has not been set,
* the platform-default user-agent stylesheet will be used.
* <p>
* For additional information about using CSS with the scene graph,
* see the <a href="doc-files/cssref.html">CSS Reference Guide</a>.
* </p>
* @return The URL of the user-agent stylesheet that will be used by this SubScene,
* or null if has not been set.
*/
public String getUserAgentStylesheet()
/**
* Set the URL of the user-agent stylesheet that will be used by this SubScene in place of the
* the platform-default user-agent stylesheet. If the URL does not resolve to a valid location,
* the platform-default user-agent stylesheet will be used.
* <p>
* For additional information about using CSS with the scene graph,
* see the <a href="doc-files/cssref.html">CSS Reference Guide</a>.
* </p>
* @param url The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL
* does not have a [scheme:] component, the URL is considered to be the [path] component only.
* Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to
* the root of the application's classpath.
*/
public void setUserAgentStylesheet(String url)
This is required for applications such as Scene Builder, which needs to view a user design with different styles: Caspian, themes related to embedded or touch devices, etc... without impacting the theme of SB itself.
Based on feedback from the SceneBuilder team, the current proposal is to add the following API to SubScene. The API will also be added to Scene to keep the two parallel.
Note that a user-agent stylesheet set on a SubScene or Scene will be used _in place of_ the platform-default user-agent stylesheet (which, in 1.8, is modena). Support is being added for @import make it easier to customize something like caspian or modena without having to duplicate all of the rules.
public ObjectProperty<String> userAgentStylesheetProperty()
/**
* Get the URL of the user-agent stylesheet that will be used by this SubScene. If the URL has not been set,
* the platform-default user-agent stylesheet will be used.
* <p>
* For additional information about using CSS with the scene graph,
* see the <a href="doc-files/cssref.html">CSS Reference Guide</a>.
* </p>
* @return The URL of the user-agent stylesheet that will be used by this SubScene,
* or null if has not been set.
*/
public String getUserAgentStylesheet()
/**
* Set the URL of the user-agent stylesheet that will be used by this SubScene in place of the
* the platform-default user-agent stylesheet. If the URL does not resolve to a valid location,
* the platform-default user-agent stylesheet will be used.
* <p>
* For additional information about using CSS with the scene graph,
* see the <a href="doc-files/cssref.html">CSS Reference Guide</a>.
* </p>
* @param url The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL
* does not have a [scheme:] component, the URL is considered to be the [path] component only.
* Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to
* the root of the application's classpath.
*/
public void setUserAgentStylesheet(String url)
- blocks
-
JDK-8094359 Setting a property from the inspector may have no effect on content
- Resolved
- is blocked by
-
JDK-8098069 Add support for @import in CSS files
- Resolved
- relates to
-
JDK-8093853 [CSS] Add "@since JavaFX 8u20" tags to new userAgentStyleSheet API
- Resolved
-
JDK-8096122 [CSS] Unable to get an effective import with a CSS file containing @import statements
- Closed
-
JDK-8097789 [CSS] Add ability to resolve the URL given with an @import statement relative to the FX runtime
- Resolved