@SuppressWarnings("serial")
public static Field createFormattedField(String prompt, String caption, final String formato, final boolean direcao) {
final TextField listenedField = createTextField(prompt, caption);
listenedField.setImmediate(true);
listenedField.addListener(new ValueChangeListener() {
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
if (listenedField.getValue() != null) {
try {
listenedField.setValue(TextUtil.format(listenedField.getValue().toString(), formato, direcao));