Example usage for com.vaadin.ui ComponentContainer setCaption

List of usage examples for com.vaadin.ui ComponentContainer setCaption

Introduction

In this page you can find the example usage for com.vaadin.ui ComponentContainer setCaption.

Prototype

public void setCaption(String caption);

Source Link

Document

Sets the caption of the component.

Usage

From source file:nz.co.senanque.vaadinsupport.I18n.I18nCaptionHelper.java

License:Apache License

private static void switchCaption(ComponentContainer componentContainer,
        MessageSourceAccessor messageSourceAccessor) {
    String newCaption = getTranslatedCaption(componentContainer.getCaption(), messageSourceAccessor);
    if (newCaption != null) {
        componentContainer.setCaption(newCaption);
    }//from  w w  w. j a va 2 s.  c  o  m
    Iterator<Component> it = componentContainer.getComponentIterator();
    while (it.hasNext()) {
        Component subcomponent = it.next();
        switchCaptions(subcomponent, messageSourceAccessor);
    }
}