private Action buttonAction ( final String preface ) { return new Action ( ) { @ Override public void execute ( final ActionEvent event ) { StringBuffer buf = new StringBuffer ( preface ) ; buf . append ( "\n" ) ; for ( Object selected : wTable . getSelectedRows ( ) ) { // The Model uses the "bean" as the key PersonBean person = ( PersonBean ) selected ; buf . append ( person . toString ( ) ) . append ( "\n" ) ; } selectionText . setText ( buf . toString ( ) ) ; } } ; }
Common action for the table buttons .