citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java
private static void displayDocumentAttachements(final VerticalLayout panelContent,
			final List<DocumentAttachment> documentAttachmentList) {
		for (final DocumentAttachment documentAttachment : documentAttachmentList) {

			if (PDF.equalsIgnoreCase(documentAttachment.getFileType())) {
				final WTPdfViewer wtPdfViewer = new WTPdfViewer();
				wtPdfViewer.setSizeFull();

				wtPdfViewer.setResource(new StreamResource(new StreamSourceImplementation(documentAttachment.getFileUrl()), documentAttachment.getFileName()));

				panelContent.addComponent(wtPdfViewer);
				panelContent.setExpandRatio(wtPdfViewer, ContentRatio.LARGE);
			} else {
				final VerticalLayout verticalLayout = new VerticalLayout();
				panelContent.addComponent(verticalLayout);
				panelContent.setExpandRatio(verticalLayout, ContentRatio.SMALL);
				final ExternalAttachmentDownloadLink link = new ExternalAttachmentDownloadLink(
						documentAttachment.getFileName(), documentAttachment.getFileType(),
						documentAttachment.getFileUrl());
				verticalLayout.addComponent(link);
			}
		}
	}
private static void displayDocumentAttachements(final VerticalLayout panelContent,
			final List<DocumentAttachment> documentAttachmentList) {
		for (final DocumentAttachment documentAttachment : documentAttachmentList) {

			if (PDF.equalsIgnoreCase(documentAttachment.getFileType())) {
				final WTPdfViewer wtPdfViewer = new WTPdfViewer();
				wtPdfViewer.setSizeFull();

				wtPdfViewer.setResource(new StreamResource(new StreamSourceImplementation(documentAttachment.getFileUrl()), documentAttachment.getFileName()));

				panelContent.addComponent(wtPdfViewer);
				panelContent.setExpandRatio(wtPdfViewer, ContentRatio.LARGE);
			} else {
				final VerticalLayout verticalLayout = new VerticalLayout();
				panelContent.addComponent(verticalLayout);
				panelContent.setExpandRatio(verticalLayout, ContentRatio.SMALL);
				final ExternalAttachmentDownloadLink link = new ExternalAttachmentDownloadLink(
						documentAttachment.getFileName(), documentAttachment.getFileType(),
						documentAttachment.getFileUrl());
				verticalLayout.addComponent(link);
			}
		}
	}
private static void displayDocumentAttachements ( final VerticalLayout panelContent , final List < DocumentAttachment > documentAttachmentList ) { for ( final DocumentAttachment documentAttachment : documentAttachmentList ) { if ( PDF . equalsIgnoreCase ( documentAttachment . getFileType ( ) ) ) { final WTPdfViewer wtPdfViewer = new WTPdfViewer ( ) ; wtPdfViewer . setSizeFull ( ) ; wtPdfViewer . setResource ( new StreamResource ( new StreamSourceImplementation ( documentAttachment . getFileUrl ( ) ) , documentAttachment . getFileName ( ) ) ) ; panelContent . addComponent ( wtPdfViewer ) ; panelContent . setExpandRatio ( wtPdfViewer , ContentRatio . LARGE ) ; } else { final VerticalLayout verticalLayout = new VerticalLayout ( ) ; panelContent . addComponent ( verticalLayout ) ; panelContent . setExpandRatio ( verticalLayout , ContentRatio . SMALL ) ; final ExternalAttachmentDownloadLink link = new ExternalAttachmentDownloadLink ( documentAttachment . getFileName ( ) , documentAttachment . getFileType ( ) , documentAttachment . getFileUrl ( ) ) ; verticalLayout . addComponent ( link ) ; } } }
Display document attachements.

@param panelContent the panel content
@param documentAttachmentList the document attachment list
Display document attachements .