On Fri, 27 Sep 2024 14:45:42 GMT, Alexey Ivanov <[email protected]> wrote:
>>> Should we provide a way to place instruction frame in arbitrary location on >>> screen? >> >> You can do it by using the `InstructionUI` interface that's passed to you >> when you implement a custom layout. >> >> We're still trying to encapsulate the frame that hosts the instructions… if >> it's exposed, then the test developer can do whatever they want… yet then >> they have to ensure calling methods on that frame from EDT. >> >> I'd rather not expose the frame at this time. >> >> How often does one need to position the instructions at an arbitrary >> location on the screen? The `TOP_LEFT_CORNER` position is used by 6 tests >> only. > > With the instruction frame exposed, it would be possible to create owned > modeless `JDialog` or `Dialog` instead of `JFrame` and `Frame` which has a > great benefit: all the windows are brought to the top when you switch back to > the test from another application. And there's only a single window on the > taskbar for the test. > > I've been thinking about adding helper methods `createOwnedJDialog` and > `createOwnedDialog` to cover this use case. > > Currently, it's possible to host test UI in a modeless dialog if you use > `testUI` with `PanelCreator` that is pass a method which creates > `JComponent`. I admit I like navigating the UI much easier in this case. > If you call `.position(PassFailJFrame.Position.TOP_LEFT_CORNER)` after > `.positionTestUIRightRow`, it is respected. Perhaps, this behaviour should be called out in the docs somewhere. All `.positionTestUIRight*` as well as `.positionTestUIBottom*` *implicitly* set the position. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21207#discussion_r1778744618
