Search in sources :

Example 1 with HeaderPair

use of com.qcadoo.mes.materialFlowResources.print.helper.DocumentPdfHelper.HeaderPair in project mes by qcadoo.

the class DispositionOrderPdfService method getDocumentHeaderTableContent.

private List<HeaderPair> getDocumentHeaderTableContent(final Entity documentEntity, final Locale locale) {
    List<HeaderPair> headerValues = Lists.newLinkedList();
    headerValues.add(new HeaderPair(translationService.translate(L_LOCATION_FROM, locale), DocumentDataProvider.locationFrom(documentEntity), false));
    headerValues.add(new HeaderPair(translationService.translate(L_STATE, locale), translationService.translate(L_STATE_VALUE + DocumentDataProvider.state(documentEntity), locale), false));
    headerValues.add(new HeaderPair(translationService.translate(L_TIME, locale), DocumentDataProvider.time(documentEntity), false));
    headerValues.add(new HeaderPair(translationService.translate(L_DESCRIPTION, locale), DocumentDataProvider.description(documentEntity), false));
    headerValues.add(new HeaderPair(translationService.translate(L_PZ, locale), DocumentDataProvider.pzLocation(documentEntity), true));
    headerValues.add(new HeaderPair(StringUtils.EMPTY, StringUtils.EMPTY, true));
    return headerValues;
}
Also used : HeaderPair(com.qcadoo.mes.materialFlowResources.print.helper.DocumentPdfHelper.HeaderPair)

Example 2 with HeaderPair

use of com.qcadoo.mes.materialFlowResources.print.helper.DocumentPdfHelper.HeaderPair in project mes by qcadoo.

the class DispositionOrderPdfService method addHeaderTable.

private void addHeaderTable(Document document, Entity documentEntity, Locale locale) throws DocumentException {
    PdfPTable table = pdfHelper.createPanelTable(2);
    table.setSpacingAfter(20);
    List<HeaderPair> headerValues = getDocumentHeaderTableContent(documentEntity, locale);
    for (HeaderPair pair : headerValues) {
        if (pair.getValue() != null && !pair.getValue().isEmpty()) {
            pdfHelper.addTableCellAsOneColumnTable(table, pair.getLabel(), pair.getValue(), pair.isBoldAndBigger());
        } else {
            pdfHelper.addTableCellAsOneColumnTable(table, StringUtils.EMPTY, StringUtils.EMPTY);
        }
    }
    document.add(table);
}
Also used : PdfPTable(com.lowagie.text.pdf.PdfPTable) HeaderPair(com.qcadoo.mes.materialFlowResources.print.helper.DocumentPdfHelper.HeaderPair)

Aggregations

HeaderPair (com.qcadoo.mes.materialFlowResources.print.helper.DocumentPdfHelper.HeaderPair)2 PdfPTable (com.lowagie.text.pdf.PdfPTable)1