/** * Gets the Vaadin/HTTP request. * * @return the Vaadin/HTTP request */ public VaadinRequest getRequest() { return bootstrapResponse.getRequest(); }
/** * Gets the Vaadin session. * * @return the Vaadin session */ public VaadinSession getSession() { return bootstrapResponse.getSession(); }
/** * Gets the UI class which will be used. * * @return the UI class */ public Class<? extends UI> getUIClass() { return bootstrapResponse.getUiClass(); }
BootstrapPageResponse pageResponse = new BootstrapPageResponse(this, request, context.getSession(), context.getUIClass(), document, headers, fragmentResponse.getUIProvider()); pageResponse.setUriResolver(context.getUriResolver()); List<Node> fragmentNodes = fragmentResponse.getFragmentNodes(); Element body = document.body(); for (Node node : fragmentNodes) { } else { StringBuilder sb = new StringBuilder(); for (Node node : fragmentResponse.getFragmentNodes()) { if (sb.length() != 0) { sb.append('\n');
BootstrapFragmentResponse bootstrapResponse = new BootstrapFragmentResponse( this, request, session, uiClass, new ArrayList<>(), provider); BootstrapContext context = new BootstrapContext(response, bootstrapResponse); bootstrapResponse.setUriResolver(context.getUriResolver());
/** * Override if required. * * @param context * @return */ public String getThemeName(BootstrapContext context) { UICreateEvent event = new UICreateEvent(context.getRequest(), context.getUIClass()); return context.getBootstrapResponse().getUIProvider().getTheme(event); }
public WidgetsetInfo getWidgetsetForUI(BootstrapContext context) { VaadinRequest request = context.getRequest(); UICreateEvent event = new UICreateEvent(context.getRequest(), context.getUIClass()); WidgetsetInfo widgetset = context.getBootstrapResponse().getUIProvider() .getWidgetsetInfo(event); if (widgetset == null) { // TODO do we want to move WidgetsetInfoImpl elsewhere? widgetset = new WidgetsetInfoImpl( request.getService().getConfiguredWidgetset(request)); } return widgetset; }
/** * Gets the push mode to use. * * @return the desired push mode */ public PushMode getPushMode() { if (pushMode == null) { UICreateEvent event = new UICreateEvent(getRequest(), getUIClass()); pushMode = getBootstrapResponse().getUIProvider() .getPushMode(event); 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; }