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