Example usage for com.vaadin.client ApplicationConfiguration getAuthorizationError

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

Introduction

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

Prototype

public ErrorMessage getAuthorizationError() 

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//from w  w w  .ja va 2s.  co 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// w  w  w . jav  a  2  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));
        }
    });
}