|
| 1 | +# Fugerit Document Generation Framework (fj-doc) |
| 2 | + |
| 3 | +## Bundle library : simple table (fj-doc-lib-simpletable) |
| 4 | + |
| 5 | +[back to fj-doc index](../README.md) |
| 6 | + |
| 7 | +*Description* : |
| 8 | +This is the first of a series of bundled libraries using fj-doc framework for specific tasks. |
| 9 | + |
| 10 | +*Status* : |
| 11 | +All basic features are implemented. |
| 12 | + |
| 13 | + |
| 14 | +*Quickstart* : |
| 15 | +This module is already configured, and can be called just creating the model of the table to be rendered and providing a TypeHandler. |
| 16 | + |
| 17 | +``` |
| 18 | +
|
| 19 | + OutputStream os = .... |
| 20 | + DocTypeHandler handler = ... |
| 21 | +
|
| 22 | + // the table model |
| 23 | + SimpleTable simpleTableModel = new SimpleTable( "30;30;40" ); |
| 24 | + SimpleRow headerRow = new SimpleRow( BooleanUtils.BOOLEAN_TRUE ); |
| 25 | + headerRow.addCell( "Name" ); |
| 26 | + headerRow.addCell( "Surname" ); |
| 27 | + headerRow.addCell( "Title" ); |
| 28 | + simpleTableModel.addRow( headerRow ); |
| 29 | + SimpleRow luthienRow = new SimpleRow(); |
| 30 | + luthienRow.addCell( "Luthien" ); |
| 31 | + luthienRow.addCell( "Tinuviel" ); |
| 32 | + luthienRow.addCell( "Queen" ); |
| 33 | + simpleTableModel.addRow( luthienRow ); |
| 34 | + SimpleRow thorinRow = new SimpleRow(); |
| 35 | + thorinRow.addCell( "Thorin" ); |
| 36 | + thorinRow.addCell( "Oakshield" ); |
| 37 | + thorinRow.addCell( "King" ); |
| 38 | + simpleTableModel.addRow( thorinRow ); |
| 39 | + |
| 40 | + SimpleTableDocConfig docConfig = SimpleTableDocConfig.newConfig(); |
| 41 | + docConfig.processSimpleTable(simpleTableModel, handler, os); |
| 42 | + |
| 43 | +``` |
0 commit comments