File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
modules/javafx.controls/src/main/java/javafx/scene/control/skin
tests/system/src/test/java/test/robot/javafx/scene Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -127,16 +127,12 @@ public class PaginationSkin extends SkinBase<Pagination> {
127127 private boolean nextPageReached = false ;
128128 private boolean setInitialDirection = false ;
129129 private int direction ;
130-
131130 private int currentAnimatedIndex ;
132- private boolean hasPendingAnimation = false ;
133-
131+ private volatile boolean hasPendingAnimation ;
134132 private boolean animate = true ;
135-
136133 private final PaginationBehavior behavior ;
137134
138135
139-
140136 /* *************************************************************************
141137 * *
142138 * Listeners *
@@ -712,6 +708,10 @@ private int getCurrentPageIndex() {
712708 }
713709
714710 private void animateSwitchPage () {
711+ if (!Platform .isFxApplicationThread ()) {
712+ hasPendingAnimation = true ;
713+ return ;
714+ }
715715 if (timeline != null ) {
716716 timeline .setRate (8 );
717717 hasPendingAnimation = true ;
Original file line number Diff line number Diff line change @@ -402,7 +402,6 @@ public void menuButton() {
402402 });
403403 }
404404
405- @ Disabled ("JDK-8349105" ) // FIX
406405 @ Test
407406 public void pagination () {
408407 assumeFalse (SKIP_TEST );
@@ -414,9 +413,10 @@ public void pagination() {
414413 c .setPageFactory ((pageIndex ) -> {
415414 return new Label (pageIndex + " " + nextString ());
416415 });
417- c .setPageCount (100 );
418- c .setCurrentPageIndex (nextInt (100 ));
416+ int mx = 1 + nextInt (100 );
419417 accessControl (c );
418+ c .setPageCount (mx );
419+ c .setCurrentPageIndex (nextInt (mx ));
420420 });
421421 }
422422
You can’t perform that action at this time.
0 commit comments