Skip to content

Commit d198a91

Browse files
author
duke
committed
Backport d1d824008d1dc70029013820814fd03c40b4e309
1 parent da87df7 commit d198a91

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,11 +1107,45 @@ public Builder testTimeOut(long testTimeOut) {
11071107
return this;
11081108
}
11091109

1110+
/**
1111+
* Sets the number of rows for displaying the instruction text.
1112+
* The default value is the number of lines in the text plus 1:
1113+
* {@code ((int) instructions.lines().count() + 1)}.
1114+
*
1115+
* @param rows the number of rows for instruction text
1116+
* @return this builder
1117+
*/
11101118
public Builder rows(int rows) {
11111119
this.rows = rows;
11121120
return this;
11131121
}
11141122

1123+
private int getDefaultRows() {
1124+
return (int) instructions.lines().count() + 1;
1125+
}
1126+
1127+
/**
1128+
* Adds a certain number of rows for displaying the instruction text.
1129+
*
1130+
* @param rowsAdd the number of rows to add to the number of rows
1131+
* @return this builder
1132+
* @see #rows
1133+
*/
1134+
public Builder rowsAdd(int rowsAdd) {
1135+
if (rows == 0) {
1136+
rows = getDefaultRows();
1137+
}
1138+
rows += rowsAdd;
1139+
1140+
return this;
1141+
}
1142+
1143+
/**
1144+
* Sets the number of columns for displaying the instruction text.
1145+
*
1146+
* @param columns the number of columns for instruction text
1147+
* @return this builder
1148+
*/
11151149
public Builder columns(int columns) {
11161150
this.columns = columns;
11171151
return this;
@@ -1352,7 +1386,7 @@ private void validate() {
13521386
}
13531387

13541388
if (rows == 0) {
1355-
rows = ROWS;
1389+
rows = getDefaultRows();
13561390
}
13571391

13581392
if (columns == 0) {

0 commit comments

Comments
 (0)