@Test public void testRevalidate() { doReturn( false ).when( source ).isPaginated(); boolean result = plugin.initialize( context ); assertThat( result, is( equalTo( true ) ) ); assertThat( plugin.isEnabled(), is( equalTo( false ) ) ); doReturn( true ).when( source ).isPaginated(); doReturn( 0 ).when( source ).getPageNumber(); result = plugin.initialize( context ); assertThat( result, is( equalTo( true ) ) ); assertThat( plugin.isEnabled(), is( equalTo( false ) ) ); doReturn( true ).when( source ).isPaginated(); doReturn( 5 ).when( source ).getPageNumber(); result = plugin.initialize( context ); assertThat( result, is( equalTo( true ) ) ); assertThat( plugin.isEnabled(), is( equalTo( true ) ) ); }
private void revalidate() { if ( eventSource.isPaginated() == false ) { setEnabled( false ); return; } if ( eventSource.getPageNumber() <= 1 ) { setEnabled( false ); return; } setEnabled( true ); }
GoToPreviousPageActionPlugin extends AbstractActionPlugin implements ControlActionPlugin { private void revalidate() { if ( eventSource.isPaginated() == false ) { setEnabled( false ); return; } if ( eventSource.getPageNumber() <= 1 ) { setEnabled( false ); return; } setEnabled( true ); } }
GoToPreviousPageActionPlugin extends AbstractActionPlugin implements ControlActionPlugin { private void revalidate() { if ( eventSource.isPaginated() == false ) { setEnabled( false ); return; } if ( eventSource.getPageNumber() <= 1 ) { setEnabled( false ); return; } setEnabled( true ); } GoToPreviousPageActionPlugin(); }
GoToPreviousPageActionPlugin extends AbstractActionPlugin implements ControlActionPlugin { private void revalidate() { if ( eventSource.isPaginated() == false ) { setEnabled( false ); return; } if ( eventSource.getPageNumber() <= 1 ) { setEnabled( false ); return; } setEnabled( true ); } GoToPreviousPageActionPlugin(); void deinitialize( final SwingGuiContext swingGuiContext ); boolean initialize( final SwingGuiContext context ); String getDisplayName(); String getShortDescription(); Icon getSmallIcon(); Icon getLargeIcon(); KeyStroke getAcceleratorKey(); Integer getMnemonicKey(); boolean configure( final PreviewPane reportPane ); }
GoToPreviousPageActionPlugin extends AbstractActionPlugin implements ControlActionPlugin { private void revalidate() { if ( eventSource.isPaginated() == false ) { setEnabled( false ); return; } if ( eventSource.getPageNumber() <= 1 ) { setEnabled( false ); return; } setEnabled( true ); } GoToPreviousPageActionPlugin(); void deinitialize( final SwingGuiContext swingGuiContext ); boolean initialize( final SwingGuiContext context ); String getDisplayName(); String getShortDescription(); Icon getSmallIcon(); Icon getLargeIcon(); KeyStroke getAcceleratorKey(); Integer getMnemonicKey(); boolean configure( final PreviewPane reportPane );  }