private void showPage ( final UniqueKey < ? extends Model > pageModelKey , final Wave wave ) { if ( pageModelKey != null && ! pageModelKey . equals ( this . currentModelKey ) ) { LOGGER . info ( "Show Page Model: " + pageModelKey . toString ( ) ) ; // Create the Wave Bean that will hold all data processed by chained commands final DisplayModelWaveBean waveBean = DisplayModelWaveBean . create ( ) // Define the placeholder that will receive the content . childrenPlaceHolder ( view ( ) . node ( ) . getChildren ( ) ) // Allow to add element behind the stack to allow transition . appendChild ( false ) . showModelKey ( pageModelKey ) . hideModelKey ( this . currentModelKey ) ; this . currentModelKey = waveBean . showModelKey ( ) ; if ( wave != null ) { // The method was called after having received a wave // It will show the next page by sending a regular command, processed asynchronously into JAT after a JIT cycle // This call is non-blocking sendWave ( WBuilder . callCommand ( ShowFadingModelCommand . class ) . waveBean ( waveBean ) . relatedWave ( wave ) . addWaveListener ( new RelatedWaveListener ( ) ) ) ; } else { // The showPage method has been called programmatically without any wave provided // This is the first call used to initialize the stack so we perform the show transition immediately final Wave showWave = WBuilder . callCommand ( ShowFadingModelCommand . class ) . waveBean ( waveBean ) . addDatas ( JRebirthWaves . FORCE_SYNC ) ; // Run synchronously into JAT immediately without a waiting a JIT cycle // This call will block current thread until page is shown getCommand ( ShowFadingModelCommand . class , showWave . wUID ( ) ) . run ( showWave ) ; } } else { LOGGER . debug ( "Page Model currently displayed: " + pageModelKey . toString ( ) ) ; } }
Private method used to show another page .