/** * Resolves the initial page title for the given bootstrap context and * cancels any pending JS execution for it. * * @param context * the bootstrap context * @return the optional initial page title */ protected static Optional<String> resolvePageTitle( BootstrapContext context) { // check for explicitly set page title, eg. by PageTitleGenerator or // View level title or page.setTitle String title = context.getUI().getInternals().getTitle(); if (title != null) { // cancel the unnecessary execute javascript context.getUI().getInternals().cancelPendingTitleUpdate(); } return Optional.ofNullable(title); }
Class<? extends UI> uiClass = context.getUI().getClass();
body = document.appendElement("body"); } else { com.vaadin.hummingbird.dom.Element uiElement = context.getUI() .getElement();
context.getUI().getUIId());
public PushMode getPushMode() { if (pushMode == null) { pushMode = getUI().getPushConfiguration().getPushMode(); if (pushMode == null) { pushMode = getRequest().getService() .getDeploymentConfiguration().getPushMode(); } if (pushMode.isEnabled() && !getRequest().getService().ensurePushAvailable()) { /* * Fall back if not supported (ensurePushAvailable will log * information to the developer the first time this happens) */ pushMode = PushMode.DISABLED; } } return pushMode; }
static Document getBootstrapPage(BootstrapContext context) throws IOException { Document document = new Document(""); DocumentType doctype = new DocumentType("html", "", "", document.baseUri()); document.appendChild(doctype); Element html = document.appendElement("html"); Element head = html.appendElement("head"); JsonObject initialUidl = getInitialUidl(context.getUI()); setupDocumentHead(head, initialUidl, context); setupDocumentBody(document, context); document.outputSettings().prettyPrint(false); return document; }