List of usage examples for com.vaadin.ui BrowserFrame setSource
public void setSource(Resource source)
From source file:de.metas.ui.web.vaadin.report.VaadinJRViewerProvider.java
License:Open Source License
@Override public void openViewer(final byte[] data, final OutputType type, final String title, final ProcessInfo pi) throws JRException { final StreamResource pdfResource = new StreamResource(() -> new ByteArrayInputStream(data), "report.pdf"); final Window window = new Window(); window.setCaption(title);/*from w ww. j a v a 2 s . c o m*/ window.setStyleName(STYLE); window.center(); window.setWidth(800, Unit.PIXELS); window.setHeight(600, Unit.PIXELS); final BrowserFrame pdfComp = new BrowserFrame(); pdfComp.setPrimaryStyleName(STYLE + "-content"); pdfComp.setSizeFull(); pdfComp.setSource(pdfResource); window.setContent(pdfComp); UI.getCurrent().addWindow(window); }