Example usage for com.vaadin.ui Embedded Embedded

List of usage examples for com.vaadin.ui Embedded Embedded

Introduction

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

Prototype

public Embedded() 

Source Link

Document

Creates a new empty Embedded object.

Usage

From source file:com.etest.pdfviewer.MultipleChoiceHelpViewer.java

public MultipleChoiceHelpViewer() {
    setWidth("900px");
    setHeight("600px");
    center();//  w ww .j av a  2 s  .  c  o m

    StreamResource.StreamSource source = new StreamResource.StreamSource() {
        @Override
        public InputStream getStream() {
            try {
                return this.getClass().getResourceAsStream("/files/TestConstRules.pdf");
            } catch (Exception e) {
                e.getMessage();
                return null;
            }
        }
    };

    StreamResource resource = new StreamResource(source, "TestConstRules.pdf");
    resource.setMIMEType("application/pdf");

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    Embedded e = new Embedded();
    e.setSource(resource);
    e.setSizeFull();
    e.setType(Embedded.TYPE_BROWSER);
    v.addComponent(e);

    setContent(v);
}

From source file:com.etest.pdfviewer.SummaryReportViewer.java

public SummaryReportViewer(String summaryType) {
    setCaption(summaryType);/*from  w w w . j a v  a2  s  .co m*/
    setWidth("900px");
    setHeight("600px");
    center();

    StreamResource resource; //= new StreamResource(new InventoryCasesReportPDF(), "InventoryOfCases.pdf");   
    if (summaryType.equals("Summary: Case vs Items")) {
        resource = new StreamResource(new InventoryCasesReportPDF(), "InventoryOfCases.pdf");
    } else {
        resource = new StreamResource(new InventoryItemsReportPDF(), "InventoryOfItems.pdf");
    }
    resource.setMIMEType("application/pdf");

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    Embedded e = new Embedded();
    e.setSource(resource);
    e.setSizeFull();
    e.setType(Embedded.TYPE_BROWSER);
    v.addComponent(e);

    setContent(v);
}

From source file:com.etest.pdfviewer.TQCriticalIndexReportViewer.java

public TQCriticalIndexReportViewer(int tqCoverageId) {
    this.tqCoverageId = tqCoverageId;
    setWidth("900px");
    setHeight("600px");
    center();//  ww  w  .  j  a  v a  2  s . co  m

    StreamResource resource = new StreamResource(new TQCriticalIndexValuesReportPDF(getTQCoverageId()),
            "TQCriticalIndexValues.pdf");
    resource.setMIMEType("application/pdf");

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    Embedded e = new Embedded();
    e.setSource(resource);
    e.setSizeFull();
    e.setType(Embedded.TYPE_BROWSER);
    v.addComponent(e);

    setContent(v);
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public AbstractComponent valo_GetGoBackEmbedded(boolean createIfNeeded) {
    if (valo_BackEmbedded == null && createIfNeeded) {
        valo_BackEmbedded = new Embedded();
        valo_BackEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);

        if (validationSettings.getDiscardLink() != null && !validationSettings.getDiscardLink().isEmpty()) {
            backButton.setCaption(validationSettings.getDiscardLink());
        } else {/*ww  w.j a va2s .c  o m*/
            backButton.setIcon(FVIconFactory.getInstance().getFVIcon(FVIconFactory.ICON_CANCEL));
        }

        valo_BackEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                goBack();
            }
        });
    }
    return valo_BackEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetPdfGeneratorEmbedded(boolean createIfNeeded) {
    if (valo_PdfGeneratorEmbedded == null && createIfNeeded && ConfigInfo.isForDevelopment()) {
        valo_PdfGeneratorEmbedded = new Embedded();
        valo_PdfGeneratorEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_PdfGeneratorEmbedded//from  w  w w.j  a  v a2 s  .  c o  m
                .setSource(FVIconFactory.getInstance().getFVIcon_Big(FVIconFactory.ICON_ADOBE));

        focXmlPDFParser = new FocXmlPDFParser(getCentralPanel(), getFocData());

        valo_PdfGeneratorEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
            }
        });

        BrowserWindowOpener opener = new BrowserWindowOpener(focXmlPDFParser.getStreamResource());
        opener.extend(valo_PdfGeneratorEmbedded);
    }
    return valo_PdfGeneratorEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetMSWordGeneratorEmbedded(boolean createIfNeeded) {
    if (valo_MSWordGeneratorEmbedded == null && createIfNeeded && ConfigInfo.isForDevelopment()) {
        valo_MSWordGeneratorEmbedded = new Embedded();
        valo_MSWordGeneratorEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_MSWordGeneratorEmbedded/*from w  ww . j a v  a 2  s . c  om*/
                .setSource(FVIconFactory.getInstance().getFVIcon_Big(FVIconFactory.ICON_WORD));

        focXmlMSWordParser = new FocXmlMSWordParser(getCentralPanel(), getFocData());

        valo_MSWordGeneratorEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
            }
        });

        BrowserWindowOpener opener = new BrowserWindowOpener(focXmlMSWordParser.getStreamResource());
        opener.extend(valo_MSWordGeneratorEmbedded);
    }
    return valo_MSWordGeneratorEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetPDFPrintEmbedded(boolean createIfNeeded) {
    if (valo_PDFPrintEmbedded == null && createIfNeeded) {
        valo_PDFPrintEmbedded = new Embedded();
        valo_PDFPrintEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_PDFPrintEmbedded.setSource(FVIconFactory.getInstance().getFVIcon_Big(FVIconFactory.ICON_ADOBE));
        valo_PDFPrintEmbedded.setImmediate(true);

        valo_PDFPrintEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override/*  www  .  j  a  v a  2  s. c  o m*/
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                printJasperFireEvent();
            }
        });
    }
    return valo_PDFPrintEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetPrintEmbedded(boolean createIfNeeded) {
    if (valo_PrintEmbedded == null && createIfNeeded) {
        valo_PrintEmbedded = new Embedded();
        valo_PrintEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_PrintEmbedded.setSource(FVIconFactory.getInstance().getFVIcon_Big(FVIconFactory.ICON_PRINT));
        valo_PrintEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override//from w w  w.  j av  a2 s.c o m
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                printClickListener();
            }
        });
    }
    return valo_PrintEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetPrintAndExitEmbedded(boolean createIfNeeded) {
    if (valo_PrintAndExitEmbedded == null) {
        valo_PrintAndExitEmbedded = new Embedded();
        valo_PrintAndExitEmbedded.setDescription("Print and Exit");
        valo_PrintAndExitEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_PrintAndExitEmbedded/*from   w  w  w  . j av a 2  s .c o m*/
                .setSource(FVIconFactory.getInstance().getFVIcon_Big(FVIconFactory.ICON_PRINT_AND_EXIT));
        valo_PrintAndExitEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                printAndExitClickListener();
            }
        });
    }
    return valo_PrintAndExitEmbedded;
}

From source file:com.foc.vaadin.gui.layouts.validationLayout.FVValidationLayout.java

License:Apache License

public Embedded valo_GetAttachEmbedded(boolean createIfNeeded) {
    if (valo_AttachImageEmbedded == null && createIfNeeded) {
        valo_AttachImageEmbedded = new Embedded();
        valo_AttachImageEmbedded.setDescription("Upload Image");
        valo_AttachImageEmbedded.addStyleName(FocXMLGuiComponentStatic.STYLE_HAND_POINTER_ON_HOVER);
        valo_AttachImageEmbedded.setSource(FVIconFactory.getInstance().getFVIcon(FVIconFactory.ICON_ATTACH));
        valo_AttachImageEmbedded.addClickListener(new MouseEvents.ClickListener() {

            @Override/*from   w w  w  .  j  a  va  2s.  c  o  m*/
            public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
                attachClickListener();
            }
        });
    }
    return valo_AttachImageEmbedded;
}