Java 类com.vaadin.ui.BrowserFrame 实例源码

项目:kumoreg    文件:PrintBadgeWindow.java   
public void showBadgesInBrowser(List<Attendee> attendeeList) {
    if (attendeeList.size() > 0) {
        StreamResource.StreamSource source = handler.getBadgeFormatter(this, attendeeList);
        String filename = "testbadge" + System.currentTimeMillis() + ".pdf";
        StreamResource resource = new StreamResource(source, filename);

        resource.setMIMEType("application/pdf");
        resource.getStream().setParameter("Content-Disposition", "attachment; filename="+filename);

        Window window = new Window();
        window.setWidth(800, Sizeable.Unit.PIXELS);
        window.setHeight(600, Sizeable.Unit.PIXELS);
        window.setModal(true);
        window.center();
        BrowserFrame pdf = new BrowserFrame("test", resource);
        pdf.setSizeFull();

        window.setContent(pdf);
        getUI().addWindow(window);
    } else {
        Notification.show("No attendees selected");
    }
}
项目:kumoreg    文件:PrintBadgeWindow.java   
public void showBadgesInBrowser(List<Attendee> attendeeList) {
    if (attendeeList.size() > 0) {
        StreamResource.StreamSource source = handler.getBadgeFormatter(this, attendeeList);
        String filename = "testbadge" + System.currentTimeMillis() + ".pdf";
        StreamResource resource = new StreamResource(source, filename);

        resource.setMIMEType("application/pdf");
        resource.getStream().setParameter("Content-Disposition", "attachment; filename="+filename);

        Window window = new Window();
        window.setWidth(800, Sizeable.Unit.PIXELS);
        window.setHeight(600, Sizeable.Unit.PIXELS);
        window.setModal(true);
        window.center();
        BrowserFrame pdf = new BrowserFrame("test", resource);
        pdf.setSizeFull();

        window.setContent(pdf);
        getUI().addWindow(window);
    } else {
        Notification.show("No attendees selected");
    }
}
项目:metl    文件:ApiPanel.java   
public ApiPanel(ApplicationContext context, TabbedPanel tabbedPanel) {   
    setSizeFull();
    String url = Page.getCurrent()
            .getLocation().getPath();
    BrowserFrame e = new BrowserFrame(null, new ExternalResource(url.substring(0, url.lastIndexOf("/")) + "/api.html"));
    e.setSizeFull();
    addComponent(e);
}
项目:metl    文件:ExploreServicesView.java   
public ExploreServicesView() {
    setSizeFull();
    String url = Page.getCurrent()
            .getLocation().getPath();
    BrowserFrame e = new BrowserFrame(null, new ExternalResource(url.substring(0, url.lastIndexOf("/")) + "/ws-api.html"));
    e.setSizeFull();
    addComponent(e);

}
项目:VaadinUtils    文件:JasperReportLayout.java   
private BrowserFrame getDisplayPanel()
{
    displayPanel = new BrowserFrame();
    displayPanel.setSizeFull();
    displayPanel.setStyleName("njadmin-hide-overflow-for-help");
    displayPanel.setImmediate(true);
    displayPanel.setId(PRINT_PANEL_ID);

    splitPanel.setSecondComponent(displayPanel);
    return displayPanel;

}
项目:cia    文件:AdminMonitoringPageModContentFactoryImpl.java   
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();

    final String pageId = getPageId(parameters);

    getMenuItemFactory().createMainPageMenuBar(menuBar);

    final BrowserFrame browser = new BrowserFrame(ADMIN_MONITORING, new ExternalResource(MONITORING_CONTEXT_PATH));
    browser.setSizeFull();

    content.addComponent(browser);
    content.setExpandRatio(browser, ContentRatio.FULL_SIZE);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_MONITORING_VIEW, ApplicationEventGroup.ADMIN,
            NAME, null, pageId);

    return content;

}