private void changePage ( final int direction ) { int currentPage = pages . indexOf ( cardManager . getVisible ( ) ) ; currentPage = Math . min ( 2 , Math . max ( 0 , currentPage + direction ) ) ; cardManager . makeVisible ( pages . get ( currentPage ) ) ; prevButton . setDisabled ( currentPage == 0 ) ; nextButton . setDisabled ( currentPage == 2 ) ; finishButton . setDisabled ( currentPage != 2 ) ; cancelButton . setUnsavedChanges ( currentPage > 0 ) ; }
Handles a pagination request .