Re: Reloading stylesheets

2013-12-12 Thread ngalarneau
David, Sounds good. Thanks, Neil From: David Grieve To: ngalarn...@abinitio.com Cc: "openjfx-dev@openjdk.java.net List" Date: 12/12/2013 08:52 AM Subject: Re: Reloading stylesheets Thanks, Neil. The underlying cause is likely to be the same. I'm go

Re: Reloading stylesheets

2013-12-12 Thread David Grieve
https://javafx-jira.kenai.com/browse/RT-34850 > > The slight difference is that I applied the stylesheet on the scene > instead of the button. > > > Neil > > > > From: Jerome Cambon > To: openjfx-dev@openjdk.java.net > Date: 12/12/2013 04:26 AM >

Re: Reloading stylesheets

2013-12-12 Thread ngalarneau
my impression is that RELOADING should also >> work... >> >> Thank you for any suggestions, >> >> Neil >> >> >> >> >> From: David Grieve >> To: Werner Lehmann >> Cc: openjfx-dev@openjdk.java.net >> Date: 12/10/201

Re: Reloading stylesheets

2013-12-12 Thread Jerome Cambon
your description below, my impression is that RELOADING should also work... Thank you for any suggestions, Neil From: David Grieve To: Werner Lehmann Cc: openjfx-dev@openjdk.java.net Date: 12/10/2013 11:10 AM Subject:Re: Reloading stylesheets Sent by:openjfx-dev-bo

Re: Reloading stylesheets

2013-12-11 Thread David Grieve
lso > work... > > Thank you for any suggestions, > > Neil > > > > > From: David Grieve > To: Werner Lehmann > Cc: openjfx-dev@openjdk.java.net > Date: 12/10/2013 11:10 AM > Subject:Re: Reloading stylesheets > Sent by:op

Re: Reloading stylesheets

2013-12-11 Thread ngalarneau
my impression is that RELOADING should also work... Thank you for any suggestions, Neil From: David Grieve To: Werner Lehmann Cc: openjfx-dev@openjdk.java.net Date: 12/10/2013 11:10 AM Subject:Re: Reloading stylesheets Sent by:openjfx-dev-boun...@openjdk.java.net The

RE: Reloading stylesheets

2013-12-10 Thread John Smith
ument provides a start but more details would be useful. Cheers, Mark -- Forwarded message -- From: Werner Lehmann Date: Tue, Dec 10, 2013 at 9:03 AM Subject: Re: Reloading stylesheets To: Cc: "openjfx-dev@openjdk.java.net" Makes sense. Thanks! On 10.12.2013 17:09, D

Re: Reloading stylesheets

2013-12-10 Thread Werner Lehmann
Makes sense. Thanks! On 10.12.2013 17:09, David Grieve wrote: The way it works in 8.0 is that there is a cache of loaded stylesheets. [...]

Re: Reloading stylesheets

2013-12-10 Thread David Grieve
The way it works in 8.0 is that there is a cache of loaded stylesheets. When a scene or parent adds a stylesheet, the stylesheet is added to the cache. Any other scene or parent that uses the same stylesheet will get the one from cache. If a scene or parent later removes the stylesheet, the styl

Re: Reloading stylesheets

2013-12-10 Thread Werner Lehmann
Interesting. Assuming the stylesheets are still cached, how would it know when to reload and not use the cached sheet? Or has sheet processing been optimized so much that caching is not necessary anymore... On 10.12.2013 16:15, Tom Schindl wrote: No on FX8 you need to remove and readd them! So

Re: Reloading stylesheets

2013-12-10 Thread Tom Schindl
No on FX8 you need to remove and readd them! So the only thing different is that you omit the reload-call on FX8. Tom On 10.12.13 16:10, Werner Lehmann wrote: > Got it. The key was to move the stylesheets from the root node to the > scene before reloading them: > > scene.styleSheets.clear > scen

Re: Reloading stylesheets

2013-12-10 Thread Werner Lehmann
Got it. The key was to move the stylesheets from the root node to the scene before reloading them: scene.styleSheets.clear scene.styleSheets.addAll(root.styleSheets) root.styleSheets.clear styleManager.reload(scene) The hotkey also works now: shift+ctrl+7 reloads CSS while the scene is visible

Re: Reloading stylesheets

2013-12-10 Thread Tom Schindl
My code does: > // Force CSS-Reloading > if( isJavaFX2() ) { > ReflectiveInvoke.onStyleManagerClass(scene); > } > > scene.getStylesheets().clear(); > scene.getStylesheets().addAll(contentData.cssFiles); A difference I see is that your stylesheets are on the Root-Container whereas mine a

Re: Reloading stylesheets

2013-12-10 Thread Werner Lehmann
Thanks, Tom. Somehow it does not work for me. Any idea? Basically this is what I am doing: Parent root = ... root.getStyleSheets().add(...stylesheets...) Scene scene = new Scene(root) StyleManager.getInstance().reloadStylesheets(scene) Then I show the scene in a JFXPanel, change and save the st

Re: Reloading stylesheets

2013-12-10 Thread Scott Palmer
Hmm.. I'll have to take a look at what I was doing, because I had something that appeared to work with 2.x and I'm pretty sure I wasn't using internal APIs. Perhaps it was only working by chance. Scott On Tue, Dec 10, 2013 at 7:46 AM, Tom Schindl wrote: > That doesn't work in 2.x because the C

Re: Reloading stylesheets

2013-12-10 Thread Tom Schindl
That doesn't work in 2.x because the CSS is cached on a scene base! A trick that could work is to load the CSS with an URL like this like: my.css?timestamp=123456789 but I have not tried that and don't know if this would work. Tom On 10.12.13 13:41, Scott Palmer wrote: > Have you tried simply r

Re: Reloading stylesheets

2013-12-10 Thread Scott Palmer
Have you tried simply removing and re-adding the stylesheet to the scene? Scott On Tue, Dec 10, 2013 at 7:21 AM, Werner Lehmann < lehm...@media-interactive.de> wrote: > Hi, > > is there a way to reload previously loaded stylesheets (in FX2)? > > Currently I have to restart the application each

Re: Reloading stylesheets

2013-12-10 Thread Tom Schindl
There is internal API: com.sun.javafx.css.StyleManager.getInstance().reloadStylesheets(scene); which is GONE in FX8 (but there it is not needed anyways) if you want to support both platforms you need to use reflection to call it. In e(fx)clipse preview I do: > if( isJavaFX2() ) { > Reflec