RFR: 8328242: Add a log area to the PassFailJFrame

Phil Race prr at openjdk.org
Fri Mar 15 05:28:41 UTC 2024


On Fri, 15 Mar 2024 04:40:14 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

> Often manual tests have a text area in the instruction window to print feedback from the test to be evaluated by a tester.
> I stumbled across another test that needed this, so I decided to make these changes a standard feature.
> 
> List of changes:
> * The log text area can be added below the `Pass` and `Fail` buttons panel.
> To do this, use the builder methods `logArea()`, `logArea(int rows)`.
> * `PassFailJFrame.log(message)`, `PassFailJFrame.logClear()` and `PassFailJFrame.logSet()` are added to control this text area. (maybe I missed something?)
> * added `invokeOnEDTUncheckedException` for easier use of logging methods
> 
> So typical usage would be like:
> 
>         PassFailJFrame
>                 .builder()
>                 .title("GetBoundsResizeTest Instructions")
>                 .instructions(INSTRUCTIONS)
>                 .rows(20)
>                 .columns(70)
>                 .logArea()
>                 .build()
>                 .awaitAndCheck();
> 
> 
> ----
> 
> //somewhere in event handlers:
> PassFailJFrame.log("Very important message");

Marked as reviewed by prr (Reviewer).

The way you did it is as I imagined. As a result of the extra builder call,
there is an implicit log target created with a known way to use with which you can write to when you want.
And the size is the same width as the instructions with and you just specify
as many lines (rows) to be visible that makes sense, so long as it is scrollable.

-------------

PR Review: https://git.openjdk.org/jdk/pull/18319#pullrequestreview-1938142923
PR Comment: https://git.openjdk.org/jdk/pull/18319#issuecomment-1998960777


More information about the client-libs-dev mailing list