private static void displayRows ( final JFrame frm , final Vector < Map . Entry < String , ColumnType > > cols , final Vector < Vector < Object > > data , final Charset charset , final Formatting fmt , final Callable < Void > end ) { final UnaryFunction < Document , Callable < Void > > f = new UnaryFunction < Document , Callable < Void > > ( ) { public Callable < Void > apply ( final Document doc ) { final DocumentAppender ap = new DocumentAppender ( doc ) ; // Column definitions final ArrayList < String > cnames = new ArrayList < String > ( ) ; final ArrayList < ColumnType > ctypes = new ArrayList < ColumnType > ( ) ; final int c = cols . size ( ) ; ap . append ( fmt . imports ) ; ap . append ( "\r\n\r\nRowLists.rowList" + c + "(" ) ; int i = 0 ; for ( final Map . Entry < String , ColumnType > e : cols ) { final String name = e . getKey ( ) ; final ColumnType type = e . getValue ( ) ; cnames . add ( name ) ; ctypes . add ( type ) ; if ( i ++ > 0 ) { ap . append ( ", " ) ; } // end of if final String tname = ( fmt . typeMap . containsKey ( type ) ) ? fmt . typeMap . get ( type ) : "String" ; ap . append ( String . format ( fmt . colDef , tname , name ) ) ; } // end of while ap . append ( ")\r\n" ) ; // -- return new Callable < Void > ( ) { public Void call ( ) { RowFormatter . appendRows ( new VectorIterator ( data ) , ap , charset , fmt , ctypes ) ; return null ; } } ; } // end of apply } ; // end of f createConvertDialog ( frm , fmt , f , end ) ; }
Displays formatted rows .