Skip to content

Commit

Permalink
Backport d1d824008d1dc70029013820814fd03c40b4e309
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Oct 23, 2024
1 parent 3660c07 commit d2e344a
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1105,11 +1105,45 @@ public Builder testTimeOut(long testTimeOut) {
return this;
}

/**
* Sets the number of rows for displaying the instruction text.
* The default value is the number of lines in the text plus 1:
* {@code ((int) instructions.lines().count() + 1)}.
*
* @param rows the number of rows for instruction text
* @return this builder
*/
public Builder rows(int rows) {
this.rows = rows;
return this;
}

private int getDefaultRows() {
return (int) instructions.lines().count() + 1;
}

/**
* Adds a certain number of rows for displaying the instruction text.
*
* @param rowsAdd the number of rows to add to the number of rows
* @return this builder
* @see #rows
*/
public Builder rowsAdd(int rowsAdd) {
if (rows == 0) {
rows = getDefaultRows();
}
rows += rowsAdd;

return this;
}

/**
* Sets the number of columns for displaying the instruction text.
*
* @param columns the number of columns for instruction text
* @return this builder
*/
public Builder columns(int columns) {
this.columns = columns;
return this;
Expand Down Expand Up @@ -1350,7 +1384,7 @@ private void validate() {
}

if (rows == 0) {
rows = ROWS;
rows = getDefaultRows();
}

if (columns == 0) {
Expand Down

0 comments on commit d2e344a

Please sign in to comment.