Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v3]

2023-03-14 Thread Ambarish Rapte
On Sat, 18 Feb 2023 13:30:42 GMT, Marius Hanl wrote: >> This PR adds the last missing method for dealing with nested event loops. >> As also written in the ticket, there is currently no (public) way to find >> out whether it is safe to start an event loop now or not. >> Classes like `Dialog` che

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v3]

2023-02-22 Thread Kevin Rushforth
On Sat, 18 Feb 2023 13:30:42 GMT, Marius Hanl wrote: >> This PR adds the last missing method for dealing with nested event loops. >> As also written in the ticket, there is currently no (public) way to find >> out whether it is safe to start an event loop now or not. >> Classes like `Dialog` che

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v3]

2023-02-18 Thread Kevin Rushforth
On Sat, 18 Feb 2023 13:30:42 GMT, Marius Hanl wrote: >> This PR adds the last missing method for dealing with nested event loops. >> As also written in the ticket, there is currently no (public) way to find >> out whether it is safe to start an event loop now or not. >> Classes like `Dialog` che

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v3]

2023-02-18 Thread Marius Hanl
> This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check via > `Toolkit.getToolkit().canStartNestedEventLoop()`

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-18 Thread Marius Hanl
On Thu, 16 Feb 2023 22:09:26 GMT, Kevin Rushforth wrote: >> Marius Hanl has updated the pull request incrementally with one additional >> commit since the last revision: >> >> JDK-8302355: checkFxUserThread(), adjusted javadoc accordingly. Added Tests > > modules/javafx.graphics/src/main/java

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Phil Race
On Thu, 16 Feb 2023 18:54:18 GMT, Kevin Rushforth wrote: >> @prrace What is your preference here? >> Since `enterNestedEventLoop` and `exitNestedEventLoop` throw an exception >> when not on the fx user thread, I feel like it makes sense to also add it >> here as well. > > Phil's comment got me

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Kevin Rushforth
On Thu, 16 Feb 2023 21:48:08 GMT, Marius Hanl wrote: >> This PR adds the last missing method for dealing with nested event loops. >> As also written in the ticket, there is currently no (public) way to find >> out whether it is safe to start an event loop now or not. >> Classes like `Dialog` che

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Phil Race
On Wed, 15 Feb 2023 21:39:02 GMT, Kevin Rushforth wrote: >> Should I also adjust the `Toolkit` javadoc or only the `Platform` one? > > It might be a good idea to also adjust the Toolkit docs; it doesn't get > generated as javadoc, but could be useful for someone looking at the code. If > you do

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Kevin Rushforth
On Thu, 16 Feb 2023 18:25:23 GMT, Marius Hanl wrote: >> So someone is asking a question when they call this. >> Throwing an Exception could be considered an unfriendly way of answering it. >> It only makes sense if you think the programmer will have enough information >> to be sure that if S/HE

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Marius Hanl
On Thu, 16 Feb 2023 03:45:28 GMT, Phil Race wrote: >> It might be a good idea to also adjust the Toolkit docs; it doesn't get >> generated as javadoc, but could be useful for someone looking at the code. >> If you do, it wouldn't be part of the CSR, since Toolkit isn't API. > > So someone is as

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop() [v2]

2023-02-16 Thread Marius Hanl
> This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check via > `Toolkit.getToolkit().canStartNestedEventLoop()`

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-15 Thread Kevin Rushforth
On Wed, 15 Feb 2023 20:11:47 GMT, Marius Hanl wrote: >> modules/javafx.graphics/src/main/java/javafx/application/Platform.java line >> 396: >> >>> 394: /** >>> 395: * Indicates whether a nested event loop can be started from the >>> current thread in the current state. >>> 396: *

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-15 Thread Kevin Rushforth
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-15 Thread Marius Hanl
On Wed, 15 Feb 2023 16:06:59 GMT, Kevin Rushforth wrote: > Also, please provide a test. I was thinking of writing a simple unit test and implementing some kind of dummy nested event loop mechanism inside the `StubToolkit`, which will follow the real implementation. But then I still only test t

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-15 Thread Johan Vos
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-15 Thread Kevin Rushforth
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-14 Thread Marius Hanl
On Tue, 14 Feb 2023 09:54:19 GMT, John Hendrikx wrote: > Okay, I found the use case you had, apparently you want to be able to show > dialogs from an uncaught exception handler which could trigger when an > exception occurs during layout. When it returns `false` you use > `Platform.runLater`,

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-14 Thread John Hendrikx
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-14 Thread John Hendrikx
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

Re: RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-13 Thread Kevin Rushforth
On Mon, 13 Feb 2023 19:31:56 GMT, Marius Hanl wrote: > This PR adds the last missing method for dealing with nested event loops. > As also written in the ticket, there is currently no (public) way to find out > whether it is safe to start an event loop now or not. > Classes like `Dialog` check v

RFR: JDK-8302355: Public API for Toolkit.canStartNestedEventLoop()

2023-02-13 Thread Marius Hanl
This PR adds the last missing method for dealing with nested event loops. As also written in the ticket, there is currently no (public) way to find out whether it is safe to start an event loop now or not. Classes like `Dialog` check via `Toolkit.getToolkit().canStartNestedEventLoop()` (sun api),