Example usage for com.vaadin.ui BrowserFrame setPrimaryStyleName

List of usage examples for com.vaadin.ui BrowserFrame setPrimaryStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui BrowserFrame setPrimaryStyleName.

Prototype

@Override
    public void setPrimaryStyleName(String style) 

Source Link

Usage

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  w w .  ja va 2  s  . c om*/

    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);
}