Package com.vaadin.ui

Examples of com.vaadin.ui.PushConfiguration


    /**
     * @since
     */
    private void refreshStatus() {
        PushConfiguration pc = ui.getPushConfiguration();
        String value = "";
        ArrayList<String> names = new ArrayList<String>();
        names.addAll(pc.getParameterNames());
        Collections.sort(names);
        for (String param : names) {
            value += param + ": " + pc.getParameter(param) + "\n";
        }
        status.setValue(value);
    }
View Full Code Here


     * @param request
     *            The UI init request
     */
    protected void setTransport(VaadinRequest request) {
        String transport = request.getParameter("transport");
        PushConfiguration config = getPushConfiguration();

        if ("xhr".equals(transport)) {
            config.setPushMode(PushMode.DISABLED);
        } else if ("websocket".equals(transport)) {
            enablePush(Transport.WEBSOCKET);
        } else if ("streaming".equals(transport)) {
            enablePush(Transport.STREAMING);
        } else if ("long-polling".equals(transport)) {
View Full Code Here

                    + "'. Supported are xhr,websocket,streaming,long-polling");
        }
    }

    protected void enablePush(Transport transport) {
        PushConfiguration config = getPushConfiguration();
        if (!config.getPushMode().isEnabled()) {
            config.setPushMode(PushMode.AUTOMATIC);
        }
        config.setTransport(transport);
        // Ensure no fallback is used
        getPushConfiguration().setParameter(
                PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none");
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.PushConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.