Example usage for com.vaadin.client ApplicationConfiguration getCommunicationError

List of usage examples for com.vaadin.client ApplicationConfiguration getCommunicationError

Introduction

In this page you can find the example usage for com.vaadin.client ApplicationConfiguration getCommunicationError.

Prototype

public ErrorMessage getCommunicationError() 

Source Link

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.clientmanager.CubaClientManagerConnector.java

License:Apache License

public CubaClientManagerConnector() {
    registerRpc(CubaClientManagerClientRpc.class, new CubaClientManagerClientRpc() {
        @Override//  w w  w  .j  av a  2s . c o m
        public void updateSystemMessagesLocale(Map<String, String> localeMap) {
            ApplicationConfiguration conf = getConnection().getConfiguration();
            ApplicationConfiguration.ErrorMessage communicationError = conf.getCommunicationError();
            communicationError
                    .setCaption(localeMap.get(CubaClientManagerClientRpc.COMMUNICATION_ERROR_CAPTION_KEY));
            communicationError
                    .setMessage(localeMap.get(CubaClientManagerClientRpc.COMMUNICATION_ERROR_MESSAGE_KEY));

            ApplicationConfiguration.ErrorMessage authError = conf.getAuthorizationError();
            authError.setCaption(localeMap.get(CubaClientManagerClientRpc.AUTHORIZATION_ERROR_CAPTION_KEY));
            authError.setMessage(localeMap.get(CubaClientManagerClientRpc.AUTHORIZATION_ERROR_MESSAGE_KEY));

            ApplicationConfiguration.ErrorMessage sessionExpiredError = conf.getSessionExpiredError();
            sessionExpiredError
                    .setCaption(localeMap.get(CubaClientManagerClientRpc.SESSION_EXPIRED_ERROR_CAPTION_KEY));
            sessionExpiredError
                    .setMessage(localeMap.get(CubaClientManagerClientRpc.SESSION_EXPIRED_ERROR_MESSAGE_KEY));
        }
    });
}

From source file:com.haulmont.cuba.web.widgets.client.clientmanager.CubaClientManagerConnector.java

License:Apache License

public CubaClientManagerConnector() {
    //noinspection Convert2Lambda
    registerRpc(CubaClientManagerClientRpc.class, new CubaClientManagerClientRpc() {
        @Override//from  www.j a  v a2 s  .c o m
        public void updateSystemMessagesLocale(Map<String, String> localeMap) {
            ApplicationConfiguration conf = getConnection().getConfiguration();
            ApplicationConfiguration.ErrorMessage communicationError = conf.getCommunicationError();
            communicationError
                    .setCaption(localeMap.get(CubaClientManagerClientRpc.COMMUNICATION_ERROR_CAPTION_KEY));
            communicationError
                    .setMessage(localeMap.get(CubaClientManagerClientRpc.COMMUNICATION_ERROR_MESSAGE_KEY));

            ApplicationConfiguration.ErrorMessage authError = conf.getAuthorizationError();
            authError.setCaption(localeMap.get(CubaClientManagerClientRpc.AUTHORIZATION_ERROR_CAPTION_KEY));
            authError.setMessage(localeMap.get(CubaClientManagerClientRpc.AUTHORIZATION_ERROR_MESSAGE_KEY));

            ApplicationConfiguration.ErrorMessage sessionExpiredError = conf.getSessionExpiredError();
            sessionExpiredError
                    .setCaption(localeMap.get(CubaClientManagerClientRpc.SESSION_EXPIRED_ERROR_CAPTION_KEY));
            sessionExpiredError
                    .setMessage(localeMap.get(CubaClientManagerClientRpc.SESSION_EXPIRED_ERROR_MESSAGE_KEY));
        }
    });
}