Example usage for com.vaadin.ui AbstractComponent getUI

List of usage examples for com.vaadin.ui AbstractComponent getUI

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractComponent getUI.

Prototype

@Override
public UI getUI() 

Source Link

Document

Finds a UI ancestor of this connector.

Usage

From source file:com.lst.deploymentautomation.vaadin.util.Utils.java

License:Open Source License

/**
 * Shows (or hides, if msg is null) localized error message on the given component. 
 * @param component/* w w w  . j a  v a  2s . co m*/
 * @param msg
 * @param args
 */
public static void setComponentError(AbstractComponent component, String msg, Object... args) {
    if (msg == null) {
        component.setComponentError(null);
    } else {
        String localizedMsg = getLocalizedString(component.getUI().getLocale(), msg, args);
        component.setComponentError(new UserError(localizedMsg));
    }
}