Search in sources :

Example 1 with PrinterOutputTypeFinderOutRowDto

use of org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeFinderForm method populateRows.

// .//GEN-END:_doValidate_2_be
// .//GEN-BEGIN:_populateRows_1_be
/**
 * This will populate the input GridModel with the data in the finderOutDto of the Component.
 * @param rows The GridModel object to populate.
 */
public void populateRows(GridModel rows) {
    rows.clearRows();
    PrinterOutputTypeFinderOutDto outputDto = (PrinterOutputTypeFinderOutDto) ((PrinterOutputTypeFinderComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            PrinterOutputTypeFinderOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement("outputType", rowDto.getOutputType());
            row.addElement("description", rowDto.getDescription());
            row.addElement("directPrinting", new CheckBoxModel((rowDto.getDirectPrinting() != null ? rowDto.getDirectPrinting() : Boolean.FALSE)));
        // .//GEN-END:_populateRows_1_be
        // Add custom code for the row //GEN-FIRST:_populateRows_1
        // .//GEN-LAST:_populateRows_1
        // .//GEN-BEGIN:_populateRows_2_be
        }
    }
}
Also used : PrinterOutputTypeFinderOutDto(org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutDto) PrinterOutputTypeFinderOutRowDto(org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto)

Example 2 with PrinterOutputTypeFinderOutRowDto

use of org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class PrinterOutputTypeFinderTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private PrinterOutputTypeFinderOutDto buildDto(UOW uow, Collection results, PrinterOutputTypeFinderInDto input) throws UOWException {
    PrinterOutputTypeFinderOutDto output = new PrinterOutputTypeFinderOutDto();
    int maxRecords = input.getMaxRecords() != null ? input.getMaxRecords().intValue() : 0;
    int counter = 0;
    for (Iterator i = results.iterator(); i.hasNext(); ) {
        if (++counter > maxRecords && maxRecords > 0) {
            output.setMoreRecordsExist(Boolean.TRUE);
            break;
        }
        PrinterOutputTypeFinderOutRowDto row = new PrinterOutputTypeFinderOutRowDto();
        PrinterOutputType printerOutputType = (PrinterOutputType) i.next();
        // .//GEN-END:_buildDto_1_be
        // Add custom code before all the setters //GEN-FIRST:_buildDto_1
        // .//GEN-LAST:_buildDto_1
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        row.setOutputType(printerOutputType.getOutputType());
        // .//GEN-END:_buildDto_OutputType_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        row.setDescription(printerOutputType.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_DirectPrinting_1_be
        row.setDirectPrinting(printerOutputType.getDirectPrinting());
        // .//GEN-END:_buildDto_DirectPrinting_1_be
        // Add custom code to pass values to the dto //GEN-FIRST:_buildDto_2
        // .//GEN-LAST:_buildDto_2
        // .//GEN-BEGIN:_buildDto_3_be
        output.addRows(row);
    }
    return output;
}
Also used : PrinterOutputTypeFinderOutDto(org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutDto) PrinterOutputType(org.jaffa.modules.printing.domain.PrinterOutputType) PrinterOutputTypeFinderOutRowDto(org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto)

Aggregations

PrinterOutputTypeFinderOutDto (org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutDto)2 PrinterOutputTypeFinderOutRowDto (org.jaffa.modules.printing.components.printeroutputtypefinder.dto.PrinterOutputTypeFinderOutRowDto)2 PrinterOutputType (org.jaffa.modules.printing.domain.PrinterOutputType)1